cvs: /php4 main.c mod_php4.c /php4/serverapi cgi_sapi.c
| From: | Rasmus Lerdorf | Date: | Sat, 04 Sep 1999 20:37:24 +0000 |
| Subject: | cvs: /php4 main.c mod_php4.c /php4/serverapi cgi_sapi.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4091@lists.php.net to get a copy of this message | ||
rasmus Sat Sep 4 16:37:24 1999 EDT
Modified files:
/php4 main.c mod_php4.c
/php4/serverapi cgi_sapi.c
Log:
Might as well bail as soon as we know we should since this is now
possible. We still need to set our connection status bit field so a
shutdown function can figure out if a script was terminated due to an
abort, timeout or finished normally.
Index: php4/main.c
diff -u php4/main.c:1.109 php4/main.c:1.110
--- php4/main.c:1.109 Sat Sep 4 16:12:47 1999
+++ php4/main.c Sat Sep 4 16:37:23 1999
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.109 1999/09/04 20:12:47 rasmus Exp $ */
+/* $Id: main.c,v 1.110 1999/09/04 20:37:23 rasmus Exp $ */
#include <stdio.h>
@@ -244,7 +244,7 @@
if (SG(server_context)) {
if(rputs(s, (request_rec *) SG(server_context))==-1) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
}
} else {
fputs(s, stdout);
@@ -257,7 +257,7 @@
if (SG(server_context)) {
if(rputc(c, (request_rec *) SG(server_context))!=c) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
}
} else {
fputc(c, stdout);
@@ -853,7 +853,7 @@
PG(header_is_being_sent) = 0;
SG(request_info).headers_only = 0;
- PG(connection_status) = PHP_CONNECTION_NORMAL;
+ PG(connection_status) |= PHP_CONNECTION_NORMAL;
#if HAVE_SETLOCALE
setlocale(LC_CTYPE, "");
Index: php4/mod_php4.c
diff -u php4/mod_php4.c:1.19 php4/mod_php4.c:1.20
--- php4/mod_php4.c:1.19 Sat Sep 4 16:12:47 1999
+++ php4/mod_php4.c Sat Sep 4 16:37:24 1999
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.19 1999/09/04 20:12:47 rasmus Exp $ */
+/* $Id: mod_php4.c,v 1.20 1999/09/04 20:37:24 rasmus Exp $ */
#include "httpd.h"
#include "http_config.h"
@@ -103,6 +103,7 @@
}
if(ret != str_length) {
PG(connection_status) = PHP_CONNECTION_ABORTED;
+ if(!PG(ignore_user_abort)) zend_bailout();
}
return ret;
}
Index: php4/serverapi/cgi_sapi.c
diff -u php4/serverapi/cgi_sapi.c:1.5 php4/serverapi/cgi_sapi.c:1.6
--- php4/serverapi/cgi_sapi.c:1.5 Sat Sep 4 16:12:47 1999
+++ php4/serverapi/cgi_sapi.c Sat Sep 4 16:37:24 1999
@@ -28,7 +28,8 @@
int sapi_header(void *scid, char *header){
int ret = puts(header);
if(ret==EOF) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
+ zend_bailout();
}
return ret;
}
@@ -36,7 +37,8 @@
int sapi_flush(void *scid){
int ret = fflush(stdout);
if(ret==EOF) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
+ if(!PG(ignore_user_abort)) zend_bailout();
}
return ret;
}
@@ -44,7 +46,8 @@
int sapi_puts(void *scid, char *string){
int ret = puts(string);
if(ret==EOF) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
+ if(!PG(ignore_user_abort)) zend_bailout();
}
return ret;
}
@@ -52,7 +55,8 @@
int sapi_putc(void *scid, char c){
int ret = putc(c,stdout);
if(ret!=c) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
+ if(!PG(ignore_user_abort)) zend_bailout();
}
return ret;
}
@@ -60,7 +64,8 @@
int sapi_writeclient(void *scid, char *string, int len){
int ret = fwrite(string,len,1,stdout);
if(ret!=len) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
+ PG(connection_status) |= PHP_CONNECTION_ABORTED;
+ if(!PG(ignore_user_abort)) zend_bailout();
}
return ret;
}