You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by to...@apache.org on 2011/05/20 16:20:55 UTC

svn commit: r1125411 - in /perl/modperl/branches/threading: ./ Changes src/modules/perl/modperl_error.h src/modules/perl/modperl_filter.c src/modules/perl/modperl_io_apache.c xs/Apache2/RequestIO/Apache2__RequestIO.h

Author: torsten
Date: Fri May 20 14:20:55 2011
New Revision: 1125411

URL: http://svn.apache.org/viewvc?rev=1125411&view=rev
Log:
Merged revisions 1124132 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1124132 | stevehay | 2011-05-18 11:30:00 +0200 (Wed, 18 May 2011) | 2 lines
  
  PerlIOApache_flush() and mpxs_Apache2__RequestRec_rflush() now no longer throw exceptions when modperl_wbucket_flush() fails if the failure was just a reset connection or an aborted connection. The failure is simply logged to the error log instead. This should fix cases of httpd.exe crashing when users press the Stop button in their web browsers.
........

Modified:
    perl/modperl/branches/threading/   (props changed)
    perl/modperl/branches/threading/Changes
    perl/modperl/branches/threading/src/modules/perl/modperl_error.h
    perl/modperl/branches/threading/src/modules/perl/modperl_filter.c
    perl/modperl/branches/threading/src/modules/perl/modperl_io_apache.c
    perl/modperl/branches/threading/xs/Apache2/RequestIO/Apache2__RequestIO.h

Propchange: perl/modperl/branches/threading/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 20 14:20:55 2011
@@ -1 +1 @@
-/perl/modperl/trunk:594682-672484,672819-681118,693357,700369,732889-736218,751909-752425,757553-774171,807116,807332-807649,907778-932879,933373-933563,935519,936643,940287,957309-983073,985740,987933-1023553,1029211-1052232,1062311-1062448,1066644-1074122,1076733,1083541,1089349-1096565
+/perl/modperl/trunk:594682-672484,672819-681118,693357,700369,732889-736218,751909-752425,757553-774171,807116,807332-807649,907778-932879,933373-933563,935519,936643,940287,957309-983073,985740,987933-1023553,1029211-1052232,1062311-1062448,1066644-1074122,1076733,1083541,1089349-1096565,1124132

Propchange: perl/modperl/branches/threading/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 20 14:20:55 2011
@@ -1 +1 @@
-/perl/modperl/trunk:1-712967,712969-1102165
+/perl/modperl/trunk:1-712967,712969-1125405

Modified: perl/modperl/branches/threading/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/Changes?rev=1125411&r1=1125410&r2=1125411&view=diff
==============================================================================
--- perl/modperl/branches/threading/Changes (original)
+++ perl/modperl/branches/threading/Changes Fri May 20 14:20:55 2011
@@ -31,6 +31,13 @@ Expose modperl_interp_t via ModPerl::Int
 
 =item 2.0.6-dev
 
+PerlIOApache_flush() and mpxs_Apache2__RequestRec_rflush() now no longer throw
+exceptions when modperl_wbucket_flush() fails if the failure was just a reset
+connection or an aborted connection. The failure is simply logged to the error
+log instead. This should fix cases of httpd.exe crashing when users press the
+Stop button in their web browsers.
+[Steve Hay]
+
 Fixed a few issues that came up with LWP 6.00:
 - t/response/TestAPI/request_rec.pm assumes HTTP/1.0 but LWP 6 uses 1.1
 - t/api/err_headers_out.t fails due to a bug somewhere in LWP 6

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_error.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_error.h?rev=1125411&r1=1125410&r2=1125411&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_error.h (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_error.h Fri May 20 14:20:55 2011
@@ -45,6 +45,22 @@ void modperl_croak(pTHX_ apr_status_t rc
         }                                                    \
     } STMT_END
 
+#define MP_RUN_CROAK_RESET_OK(s, rc_run, func) STMT_START               \
+    {                                                                   \
+        apr_status_t rc = rc_run;                                       \
+        if (rc != APR_SUCCESS) {                                        \
+            if (APR_STATUS_IS_ECONNRESET(rc) ||                         \
+                APR_STATUS_IS_ECONNABORTED(rc)) {                       \
+                ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,              \
+                             "%s got: %s", func,                        \
+                             modperl_error_strerror(aTHX_ rc));         \
+            }                                                           \
+            else {                                                      \
+                modperl_croak(aTHX_ rc, func);                          \
+            }                                                           \
+        }                                                               \
+    } STMT_END
+
 #endif /* MODPERL_ERROR_H */
 
 /*

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_filter.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_filter.c?rev=1125411&r1=1125410&r2=1125411&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_filter.c (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_filter.c Fri May 20 14:20:55 2011
@@ -472,24 +472,6 @@ static int modperl_run_filter_init(ap_fi
     return status;
 }
 
-
-#define MP_RUN_CROAK_RESET_OK(func)                                     \
-    {                                                                   \
-        apr_status_t rc = func(filter);                                 \
-        if (rc != APR_SUCCESS) {                                        \
-            if (APR_STATUS_IS_ECONNRESET(rc) ||                         \
-                APR_STATUS_IS_ECONNABORTED(rc)) {                       \
-                ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,              \
-                             "Apache2::Filter internal flush got: %s",  \
-                             modperl_error_strerror(aTHX_ rc));         \
-            }                                                           \
-            else {                                                      \
-                modperl_croak(aTHX_ rc,                                 \
-                              "Apache2::Filter internal flush");        \
-            }                                                           \
-        }                                                               \
-    }
-
 int modperl_run_filter(modperl_filter_t *filter)
 {
     AV *args = Nullav;
@@ -563,10 +545,12 @@ int modperl_run_filter(modperl_filter_t 
             apr_brigade_destroy(filter->bb_in);
             filter->bb_in = NULL;
         }
-        MP_RUN_CROAK_RESET_OK(modperl_input_filter_flush);
+        MP_RUN_CROAK_RESET_OK(s, modperl_input_filter_flush(filter),
+                              "Apache2::Filter internal flush");
     }
     else {
-        MP_RUN_CROAK_RESET_OK(modperl_output_filter_flush);
+        MP_RUN_CROAK_RESET_OK(s, modperl_output_filter_flush(filter),
+                              "Apache2::Filter internal flush");
     }
 
     MP_FILTER_RESTORE_ERRSV(errsv);

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_io_apache.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_io_apache.c?rev=1125411&r1=1125410&r2=1125411&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_io_apache.c (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_io_apache.c Fri May 20 14:20:55 2011
@@ -169,8 +169,9 @@ PerlIOApache_flush(pTHX_ PerlIO *f)
                                   rcfg->wbucket->outbuf,
                                   rcfg->wbucket->outcnt));
 
-    MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE),
-                 ":Apache2 IO flush");
+    MP_RUN_CROAK_RESET_OK(st->r->server,
+                          modperl_wbucket_flush(rcfg->wbucket, FALSE),
+                          ":Apache2 IO flush");
 
     return 0;
 }

Modified: perl/modperl/branches/threading/xs/Apache2/RequestIO/Apache2__RequestIO.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/xs/Apache2/RequestIO/Apache2__RequestIO.h?rev=1125411&r1=1125410&r2=1125411&view=diff
==============================================================================
--- perl/modperl/branches/threading/xs/Apache2/RequestIO/Apache2__RequestIO.h (original)
+++ perl/modperl/branches/threading/xs/Apache2/RequestIO/Apache2__RequestIO.h Fri May 20 14:20:55 2011
@@ -179,8 +179,9 @@ void mpxs_Apache2__RequestRec_rflush(pTH
                rcfg->wbucket->outcnt,
                apr_pstrmemdup(rcfg->wbucket->pool, rcfg->wbucket->outbuf,
                               rcfg->wbucket->outcnt));
-    MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, TRUE),
-                 "Apache2::RequestIO::rflush");
+    MP_RUN_CROAK_RESET_OK(r->server,
+                          modperl_wbucket_flush(rcfg->wbucket, TRUE),
+                          "Apache2::RequestIO::rflush");
 }
 
 static MP_INLINE long mpxs_ap_get_client_block(pTHX_ request_rec *r,