summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-05-05 21:05:44 +0000
committerZeev Suraski <zeev@php.net>1999-05-05 21:05:44 +0000
commitaee864e9d8e9f7eed671f8ccfe1f9ed68202161e (patch)
tree22e53f5dc323061f21fcccec28fed038e647919d /main/SAPI.c
parent2740382c2c5758e72850e8357046b94b9ac3e5e4 (diff)
downloadphp-git-aee864e9d8e9f7eed671f8ccfe1f9ed68202161e.tar.gz
Get CGI to work with the new headers code.
Now Apache is the only interface that doesn't use it.
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 12499aee3b..af8f1f0b39 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -97,6 +97,7 @@ SAPI_API int sapi_add_header(const char *header_line, uint header_line_len)
SAPI_API int sapi_send_headers()
{
int retval;
+ sapi_header_struct default_header = { DEFAULT_CONTENT_TYPE, sizeof(DEFAULT_CONTENT_TYPE)-1 };
SLS_FETCH();
if (SG(headers_sent)) {
@@ -115,7 +116,13 @@ SAPI_API int sapi_send_headers()
return SUCCESS;
break;
case SAPI_HEADER_DO_SEND:
+ if (SG(sapi_headers).content_type.header) {
+ sapi_module.send_header(&SG(sapi_headers).content_type, SG(server_context));
+ } else {
+ sapi_module.send_header(&default_header, SG(server_context));
+ }
zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) sapi_module.send_header, SG(server_context));
+ sapi_module.send_header(NULL, SG(server_context));
SG(headers_sent) = 1;
return SUCCESS;
break;