cvs: php4 /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c

From: Date: Sun, 29 Oct 2000 16:14:28 +0000
Subject: cvs: php4 /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2343@lists.php.net to get a copy of this message
sas Sun Oct 29 08:14:28 2000 EDT Modified files: /php4/sapi/isapi php4isapi.c /php4/sapi/nsapi nsapi.c /php4/sapi/phttpd phttpd.c /php4/sapi/pi3web pi3web_sapi.c /php4/sapi/roxen roxen.c Log: Unify handling of aborted connections Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.58 php4/sapi/isapi/php4isapi.c:1.59 --- php4/sapi/isapi/php4isapi.c:1.58 Tue Sep 19 10:43:11 2000 +++ php4/sapi/isapi/php4isapi.c Sun Oct 29 08:14:26 2000 @@ -151,7 +151,7 @@ ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) { - zend_bailout(); + php_handle_aborted_connection(); } return num_bytes; } Index: php4/sapi/nsapi/nsapi.c diff -u php4/sapi/nsapi/nsapi.c:1.12 php4/sapi/nsapi/nsapi.c:1.13 --- php4/sapi/nsapi/nsapi.c:1.12 Fri Sep 8 07:43:55 2000 +++ php4/sapi/nsapi/nsapi.c Sun Oct 29 08:14:26 2000 @@ -141,9 +141,8 @@ rc = (nsapi_request_context *)SG(server_context); retval = net_write(rc->sn->csd, (char *)str, str_length); if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/) - return -1; - else - return retval; + php_handle_aborted_connection(); + return retval; } static int Index: php4/sapi/phttpd/phttpd.c diff -u php4/sapi/phttpd/phttpd.c:1.20 php4/sapi/phttpd/phttpd.c:1.21 --- php4/sapi/phttpd/phttpd.c:1.20 Sun Oct 29 01:14:55 2000 +++ php4/sapi/phttpd/phttpd.c Sun Oct 29 08:14:26 2000 @@ -69,7 +69,9 @@ sent_bytes = fd_write(PHG(cip)->fd,str,str_length); - if (sent_bytes == -1) perror("fd_write\n"); + if (sent_bytes == -1) { + php_handle_aborted_connection(); + } return sent_bytes; } Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.10 php4/sapi/pi3web/pi3web_sapi.c:1.11 --- php4/sapi/pi3web/pi3web_sapi.c:1.10 Fri Sep 8 07:43:56 2000 +++ php4/sapi/pi3web/pi3web_sapi.c Sun Oct 29 08:14:27 2000 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.10 2000/09/08 14:43:56 zeev Exp $ */ +/* $Id: pi3web_sapi.c,v 1.11 2000/10/29 16:14:27 sas Exp $ */ #if WIN32|WINNT # include <windows.h> @@ -80,7 +80,7 @@ PUTS("<table border=5 width=600>\n"); PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n"); php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.10 2000/09/08 14:43:56 zeev Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.11 2000/10/29 16:14:27 sas Exp $"); php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); php_info_print_table_row(2, "Debug Enabled", variable_buf); @@ -145,6 +145,9 @@ if ( !IWasLoaded ) return 0; cb->WriteClient(cb->ConnID, (char *) str, &num_bytes, 0 ); + + if (num_bytes != str_length) + php_handle_aborted_connection(); return num_bytes; } Index: php4/sapi/roxen/roxen.c diff -u php4/sapi/roxen/roxen.c:1.37 php4/sapi/roxen/roxen.c:1.38 --- php4/sapi/roxen/roxen.c:1.37 Fri Sep 8 07:43:57 2000 +++ php4/sapi/roxen/roxen.c Sun Oct 29 08:14:27 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: roxen.c,v 1.37 2000/09/08 14:43:57 zeev Exp $ */ +/* $Id: roxen.c,v 1.38 2000/10/29 16:14:27 sas Exp $ */ #include "php.h" #ifdef HAVE_ROXEN @@ -233,8 +233,7 @@ pop_stack(); if(sent_bytes != str_length) { /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); + php_handle_aborted_connection(); } return sent_bytes; } @@ -447,7 +446,7 @@ { /* char buf[512]; */ php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.37 2000/09/08 14:43:57 zeev Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.38 2000/10/29 16:14:27 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());

« previous php.cvs (#2343) next »