cvs: php4 /main SAPI.c
| From: | Zeev Suraski | Date: | Sat, 19 Aug 2000 16:38:19 +0000 |
| Subject: | cvs: php4 /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1235@lists.php.net to get a copy of this message | ||
zeev Sat Aug 19 09:38:19 2000 EDT
Modified files:
/php4/main SAPI.c
Log:
Avoid an endless loop situation in case of an error situation while sending headers
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.81 php4/main/SAPI.c:1.82
--- php4/main/SAPI.c:1.81 Wed Aug 2 15:53:55 2000
+++ php4/main/SAPI.c Sat Aug 19 09:38:19 2000
@@ -462,6 +462,11 @@
return SUCCESS;
}
+ /* Success-oriented. We set headers_sent to 1 here to avoid an infinite loop
+ * in case of an error situation.
+ */
+ SG(headers_sent) = 1;
+
if (sapi_module.send_headers) {
retval = sapi_module.send_headers(&SG(sapi_headers) SLS_CC);
} else {
@@ -470,7 +475,6 @@
switch (retval) {
case SAPI_HEADER_SENT_SUCCESSFULLY:
- SG(headers_sent) = 1;
ret = SUCCESS;
break;
case SAPI_HEADER_DO_SEND:
@@ -490,10 +494,10 @@
sapi_free_header(&default_header);
}
sapi_module.send_header(NULL, SG(server_context));
- SG(headers_sent) = 1;
ret = SUCCESS;
break;
case SAPI_HEADER_SEND_FAILED:
+ SG(headers_sent) = 0;
ret = FAILURE;
break;
}