cvs: php4 /sapi/aolserver aolserver.c /sapi/apache mod_php4.c /sapi/apache2filter sapi_apache2.c /sapi/thttpd thttpd.c
| From: | Sascha Schumann | Date: | Sun, 29 Oct 2000 16:01:02 +0000 |
| Subject: | cvs: php4 /sapi/aolserver aolserver.c /sapi/apache mod_php4.c /sapi/apache2filter sapi_apache2.c /sapi/thttpd thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2341@lists.php.net to get a copy of this message | ||
sas Sun Oct 29 08:01:02 2000 EDT
Modified files:
/php4/sapi/aolserver aolserver.c
/php4/sapi/apache mod_php4.c
/php4/sapi/apache2filter sapi_apache2.c
/php4/sapi/thttpd thttpd.c
Log:
Add/unify aborted connection handling
Index: php4/sapi/aolserver/aolserver.c
diff -u php4/sapi/aolserver/aolserver.c:1.50 php4/sapi/aolserver/aolserver.c:1.51
--- php4/sapi/aolserver/aolserver.c:1.50 Sun Oct 29 03:38:25 2000
+++ php4/sapi/aolserver/aolserver.c Sun Oct 29 08:01:01 2000
@@ -22,7 +22,7 @@
* - CGI/1.1 conformance
*/
-/* $Id: aolserver.c,v 1.50 2000/10/29 11:38:25 zeev Exp $ */
+/* $Id: aolserver.c,v 1.51 2000/10/29 16:01:01 sas Exp $ */
/* conflict between PHP and AOLserver headers */
#define Debug php_Debug
@@ -98,6 +98,9 @@
sent_bytes = Ns_ConnWrite(NSG(conn), (void *) str, str_length);
+ if (sent_bytes != str_length)
+ php_handle_aborted_connection();
+
return sent_bytes;
}
@@ -208,7 +211,7 @@
NSLS_FETCH();
php_info_print_table_start();
- php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.50
2000/10/29 11:38:25 zeev Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.51
2000/10/29 16:01:01 sas Exp $");
php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.73 php4/sapi/apache/mod_php4.c:1.74
--- php4/sapi/apache/mod_php4.c:1.73 Sun Oct 29 03:38:25 2000
+++ php4/sapi/apache/mod_php4.c Sun Oct 29 08:01:01 2000
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.73 2000/10/29 11:38:25 zeev Exp $ */
+/* $Id: mod_php4.c,v 1.74 2000/10/29 16:01:01 sas Exp $ */
#define NO_REGEX_EXTRA_H
#ifdef WIN32
@@ -126,7 +126,6 @@
{
int ret;
SLS_FETCH();
- PLS_FETCH();
if (SG(server_context)) {
ret = rwrite(str, str_length, (request_rec *) SG(server_context));
@@ -134,10 +133,7 @@
ret = fwrite(str, 1, str_length, stderr);
}
if(ret != str_length) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
return ret;
}
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.13 php4/sapi/apache2filter/sapi_apache2.c:1.14
--- php4/sapi/apache2filter/sapi_apache2.c:1.13 Sun Oct 29 07:10:49 2000
+++ php4/sapi/apache2filter/sapi_apache2.c Sun Oct 29 08:01:01 2000
@@ -43,12 +43,7 @@
str_length -= now;
}
if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
- PLS_FETCH();
- PG(connection_status) = PHP_CONNECTION_ABORTED;
-
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
return str_length;
@@ -160,12 +155,7 @@
b = ap_bucket_create_flush();
AP_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
- PLS_FETCH();
- PG(connection_status) = PHP_CONNECTION_ABORTED;
-
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
}
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.26 php4/sapi/thttpd/thttpd.c:1.27
--- php4/sapi/thttpd/thttpd.c:1.26 Fri Oct 27 03:31:10 2000
+++ php4/sapi/thttpd/thttpd.c Sun Oct 29 08:01:02 2000
@@ -40,9 +40,16 @@
static int sapi_thttpd_ub_write(const char *str, uint str_length)
{
+ int n;
TLS_FETCH();
- return send(TG(hc)->conn_fd, str, str_length, 0);
+ n = send(TG(hc)->conn_fd, str, str_length, 0);
+
+ if (n == EPIPE) {
+ php_handle_aborted_connection();
+ }
+
+ return n;
}
static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers SLS_DC)