diff options
| author | George Schlossnagle <gschlossnagle@php.net> | 2002-11-18 00:59:23 +0000 |
|---|---|---|
| committer | George Schlossnagle <gschlossnagle@php.net> | 2002-11-18 00:59:23 +0000 |
| commit | 99c7ddc3a8f9ecf1a3968f6e59dc9d95106bb0c7 (patch) | |
| tree | 9f8c0a9c6624eebc713f72d18e09ec311a22aef2 /main/SAPI.c | |
| parent | a3e9ae20d9b4d2d96becc2f4a94d3a876fe2b3a2 (diff) | |
| download | php-git-99c7ddc3a8f9ecf1a3968f6e59dc9d95106bb0c7.tar.gz | |
added support functions for the apache_hooks SAPI
Diffstat (limited to 'main/SAPI.c')
| -rw-r--r-- | main/SAPI.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index 08eec845eb..91186311db 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -278,10 +278,42 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len TSRMLS_DC return 0; } +SAPI_API void sapi_activate_headers_only(TSRMLS_D) +{ + if (SG(request_info).headers_read == 1) + return; + SG(request_info).headers_read = 1; + zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0); + SG(sapi_headers).send_default_content_type = 1; + + /* + SG(sapi_headers).http_response_code = 200; + */ + SG(sapi_headers).http_status_line = NULL; + SG(request_info).current_user = NULL; + SG(request_info).current_user_length = 0; + SG(request_info).no_headers = 0; + + /* It's possible to override this general case in the activate() callback, if + * necessary. + */ + if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { + SG(request_info).headers_only = 1; + } else { + SG(request_info).headers_only = 0; + } + if (SG(server_context)) { + SG(request_info).cookie_data = sapi_module.read_cookies(TSRMLS_C); + if (sapi_module.activate) { + sapi_module.activate(TSRMLS_C); + } + } +} /* * Called from php_request_startup() for every request. */ + SAPI_API void sapi_activate(TSRMLS_D) { zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0); @@ -389,6 +421,9 @@ SAPI_API void sapi_deactivate(TSRMLS_D) SG(sapi_headers).mimetype = NULL; } sapi_send_headers_free(TSRMLS_C); + SG(sapi_started) = 0; + SG(headers_sent) = 0; + SG(request_info).headers_read = 0; } |
