summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-09-08 14:43:57 +0000
committerZeev Suraski <zeev@php.net>2000-09-08 14:43:57 +0000
commit91c808ecc421ddaea9b0ae7f842daa727cfbf575 (patch)
treeb7fa79691812e958c99a413dac3d46319ab17d5a /sapi
parentd10336ec0e00baed0e5157db45d9eb597065bb47 (diff)
downloadphp-git-91c808ecc421ddaea9b0ae7f842daa727cfbf575.tar.gz
Restore the headers_only test to the centralized SAPI startup. If necessary, it can
be overriden in the activate() callback.
Diffstat (limited to 'sapi')
-rw-r--r--sapi/aolserver/aolserver.c5
-rw-r--r--sapi/apache/mod_php4.c6
-rw-r--r--sapi/cgi/cgi_main.c5
-rw-r--r--sapi/isapi/php4isapi.c5
-rw-r--r--sapi/nsapi/nsapi.c6
-rw-r--r--sapi/phttpd/phttpd.c5
-rw-r--r--sapi/pi3web/pi3web_sapi.c5
-rw-r--r--sapi/roxen/roxen.c5
-rw-r--r--sapi/servlet/servlet.c5
-rw-r--r--sapi/thttpd/thttpd.c5
10 files changed, 5 insertions, 47 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 0a8a33397a..8e18fa48f4 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -458,11 +458,6 @@ php_ns_request_ctor(NSLS_D SLS_DC)
index = Ns_SetIFind(NSG(conn)->headers, "content-type");
SG(request_info).content_type = index == -1 ? NULL :
Ns_SetValue(NSG(conn)->headers, index);
- if (!strcmp(NSG(conn)->request->method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
SG(sapi_headers).http_response_code = 200;
tmp = Ns_ConnAuthUser(NSG(conn));
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 9999e0fdaa..0d2fbecc7a 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -305,6 +305,11 @@ static int php_apache_sapi_activate(SLS_D)
block_alarms();
register_cleanup(((request_rec *) SG(server_context))->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec);
unblock_alarms();
+
+ /* Override the default headers_only value - sometimes "GET" requests should actually only
+ * send headers.
+ */
+ SG(request_info).headers_only = r->header_only;
return SUCCESS;
}
@@ -379,7 +384,6 @@ static void init_request_info(SLS_D)
SG(request_info).request_method = (char *)r->method;
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
- SG(request_info).headers_only = r->header_only;
SG(sapi_headers).http_response_code = r->status;
if (r->headers_in) {
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 6b57cffba4..5240c4ac44 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -316,11 +316,6 @@ static void init_request_info(SLS_D)
SG(request_info).content_type = getenv("CONTENT_TYPE");
SG(request_info).content_length = (content_length?atoi(content_length):0);
SG(sapi_headers).http_response_code = 200;
- 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;
- }
/* CGI does not support HTTP authentication */
SG(request_info).auth_user = NULL;
SG(request_info).auth_password = NULL;
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c
index 75c2d50e07..61450d0d24 100644
--- a/sapi/isapi/php4isapi.c
+++ b/sapi/isapi/php4isapi.c
@@ -475,11 +475,6 @@ static void init_request_info(sapi_globals_struct *sapi_globals, LPEXTENSION_CON
SG(request_info).content_type = lpECB->lpszContentType;
SG(request_info).content_length = lpECB->cbTotalBytes;
SG(sapi_headers).http_response_code = 200; /* I think dwHttpStatusCode is invalid at this stage -RL */
- if (!strcmp(lpECB->lpszMethod, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
if (!bFilterLoaded) { /* we don't have valid ISAPI Filter information */
SG(request_info).auth_user = SG(request_info).auth_password = NULL;
}
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 210ac1766f..70b002b6c3 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -479,12 +479,6 @@ nsapi_request_ctor(NSLS_D SLS_DC)
SG(request_info).content_type = nsapi_strdup(content_type);
SG(request_info).content_length = (content_length == NULL) ? 0 : strtoul(content_length, 0, 0);
SG(sapi_headers).http_response_code = 200;
- if (!strcmp(request_method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
-
}
static void
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index 72d81f401a..4bedea5675 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -203,11 +203,6 @@ php_phttpd_request_ctor(PHLS_D SLS_DC)
SG(request_info).request_method = PHG(cip)->hip->method;
SG(request_info).path_translated = malloc(MAXPATHLEN+1);
SG(sapi_headers).http_response_code = 200;
- if (!strcmp(PHG(cip)->hip->method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
if (url_expand(PHG(cip)->hip->url, SG(request_info).path_translated, MAXPATHLEN, &PHG(sb), NULL, NULL) == NULL) {
/* handle error */
}
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index bd89121457..0f148f632a 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -319,11 +319,6 @@ static void init_request_info(sapi_globals_struct *sapi_globals, LPCONTROL_BLOCK
SG(request_info).auth_user = lpCB->lpszUser;
SG(request_info).auth_password = lpCB->lpszPassword;
SG(sapi_headers).http_response_code = 200;
- if (!strcmp(lpCB->lpszMethod, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
}
static void hash_pi3web_variables(ELS_D SLS_DC)
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index b2c0dbf8e5..594ca16819 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -660,11 +660,6 @@ void f_php_roxen_request_handler(INT32 args)
SG(request_info).content_length = lookup_integer_header("HTTP_CONTENT_LENGTH", 0);
SG(request_info).content_type = lookup_string_header("HTTP_CONTENT_TYPE", NULL);
SG(sapi_headers).http_response_code = 200;
- if (!strcmp(SG(request_info).request_method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
/* FIXME: Check for auth stuff needs to be fixed... */
SG(request_info).auth_user = NULL;
diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c
index edea63bb67..1227a79f68 100644
--- a/sapi/servlet/servlet.c
+++ b/sapi/servlet/servlet.c
@@ -357,11 +357,6 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
SETSTRING( SG(request_info).request_uri, requestURI );
SETSTRING( SG(request_info).content_type, contentType );
SG(sapi_headers).http_response_code = 200;
- if (!strcmp(SG(request_info).request_method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
SG(request_info).content_length = contentLength;
SG(request_info).auth_password = NULL;
if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC)==FAILURE) {
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 81a22a7f44..1dc2b11b2f 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -234,11 +234,6 @@ static void thttpd_request_ctor(TLS_D SLS_DC)
snprintf(buf, 1023, "/%s", TG(hc)->origfilename);
SG(request_info).request_uri = strdup(buf);
SG(request_info).request_method = httpd_method_str(TG(hc)->method);
- if (!strcmp(SG(request_info).request_method, "HEAD")) {
- SG(request_info).headers_only = 1;
- } else {
- SG(request_info).headers_only = 0;
- }
SG(sapi_headers).http_response_code = 200;
SG(request_info).content_type = TG(hc)->contenttype;
SG(request_info).content_length = TG(hc)->contentlength;