cvs: php4 /main SAPI.c SAPI.h /sapi/aolserver aolserver.c /sapi/apache mod_php4.c /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c /sapi/nsapi
nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c /sapi/servlet servlet.c /sapi/thttpd thttpd.c
| From: | Zeev Suraski | Date: | Fri, 08 Sep 2000 14:44:00 +0000 |
| Subject: | cvs: php4 /main SAPI.c SAPI.h /sapi/aolserver aolserver.c /sapi/apache mod_php4.c /sapi/cgi cgi_main.c /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c /sapi/servlet servlet.c /sapi/thttpd thttpd.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1635@lists.php.net to get a copy of this message | ||
zeev Fri Sep 8 07:44:00 2000 EDT
Modified files:
/php4/main SAPI.c SAPI.h
/php4/sapi/aolserver aolserver.c
/php4/sapi/apache mod_php4.c
/php4/sapi/cgi cgi_main.c
/php4/sapi/isapi php4isapi.c
/php4/sapi/nsapi nsapi.c
/php4/sapi/phttpd phttpd.c
/php4/sapi/pi3web pi3web_sapi.c
/php4/sapi/roxen roxen.c
/php4/sapi/servlet servlet.c
/php4/sapi/thttpd thttpd.c
Log:
Restore the headers_only test to the centralized SAPI startup. If necessary, it can
be overriden in the activate() callback.
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.87 php4/main/SAPI.c:1.88
--- php4/main/SAPI.c:1.87 Sun Sep 3 21:22:47 2000
+++ php4/main/SAPI.c Fri Sep 8 07:43:54 2000
@@ -277,17 +277,14 @@
SG(request_info).current_user = NULL;
SG(request_info).current_user_length = 0;
-#if 0
- /* This can't be done here. We need to do that in the individual SAPI
- * modules because you can actually have a GET request that is only
- * allowed to send back headers.
+ /* 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;
}
-#endif
if (SG(server_context)) {
if (SG(request_info).request_method
Index: php4/main/SAPI.h
diff -u php4/main/SAPI.h:1.50 php4/main/SAPI.h:1.51
--- php4/main/SAPI.h:1.50 Sun Aug 20 07:20:21 2000
+++ php4/main/SAPI.h Fri Sep 8 07:43:54 2000
@@ -100,6 +100,7 @@
struct stat global_stat;
char *default_mimetype;
char *default_charset;
+ HashTable *rfc_1867_uploaded_files;
} sapi_globals_struct;
Index: php4/sapi/aolserver/aolserver.c
diff -u php4/sapi/aolserver/aolserver.c:1.48 php4/sapi/aolserver/aolserver.c:1.49
--- php4/sapi/aolserver/aolserver.c:1.48 Mon Aug 28 02:01:53 2000
+++ php4/sapi/aolserver/aolserver.c Fri Sep 8 07:43:54 2000
@@ -22,7 +22,7 @@
* - CGI/1.1 conformance
*/
-/* $Id: aolserver.c,v 1.48 2000/08/28 09:01:53 rasmus Exp $ */
+/* $Id: aolserver.c,v 1.49 2000/09/08 14:43:54 zeev Exp $ */
/* conflict between PHP and AOLserver headers */
#define Debug php_Debug
@@ -208,7 +208,7 @@
NSLS_FETCH();
php_info_print_table_start();
- php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.48
2000/08/28 09:01:53 rasmus Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.49
2000/09/08 14:43:54 zeev Exp $");
php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -458,11 +458,6 @@
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));
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.65 php4/sapi/apache/mod_php4.c:1.66
--- php4/sapi/apache/mod_php4.c:1.65 Sun Aug 20 07:29:00 2000
+++ php4/sapi/apache/mod_php4.c Fri Sep 8 07:43:55 2000
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.65 2000/08/20 14:29:00 sas Exp $ */
+/* $Id: mod_php4.c,v 1.66 2000/09/08 14:43:55 zeev Exp $ */
#define NO_REGEX_EXTRA_H
#ifdef WIN32
@@ -305,6 +305,11 @@
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 @@
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) {
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.68 php4/sapi/cgi/cgi_main.c:1.69
--- php4/sapi/cgi/cgi_main.c:1.68 Sun Aug 27 12:46:03 2000
+++ php4/sapi/cgi/cgi_main.c Fri Sep 8 07:43:55 2000
@@ -316,11 +316,6 @@
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;
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.55 php4/sapi/isapi/php4isapi.c:1.56
--- php4/sapi/isapi/php4isapi.c:1.55 Mon Aug 28 12:31:56 2000
+++ php4/sapi/isapi/php4isapi.c Fri Sep 8 07:43:55 2000
@@ -475,11 +475,6 @@
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;
}
Index: php4/sapi/nsapi/nsapi.c
diff -u php4/sapi/nsapi/nsapi.c:1.11 php4/sapi/nsapi/nsapi.c:1.12
--- php4/sapi/nsapi/nsapi.c:1.11 Sun Aug 13 11:00:38 2000
+++ php4/sapi/nsapi/nsapi.c Fri Sep 8 07:43:55 2000
@@ -479,12 +479,6 @@
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
Index: php4/sapi/phttpd/phttpd.c
diff -u php4/sapi/phttpd/phttpd.c:1.18 php4/sapi/phttpd/phttpd.c:1.19
--- php4/sapi/phttpd/phttpd.c:1.18 Wed Aug 2 15:48:43 2000
+++ php4/sapi/phttpd/phttpd.c Fri Sep 8 07:43:56 2000
@@ -203,11 +203,6 @@
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 */
}
Index: php4/sapi/pi3web/pi3web_sapi.c
diff -u php4/sapi/pi3web/pi3web_sapi.c:1.9 php4/sapi/pi3web/pi3web_sapi.c:1.10
--- php4/sapi/pi3web/pi3web_sapi.c:1.9 Mon Aug 21 22:43:31 2000
+++ php4/sapi/pi3web/pi3web_sapi.c Fri Sep 8 07:43:56 2000
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pi3web_sapi.c,v 1.9 2000/08/22 05:43:31 sas Exp $ */
+/* $Id: pi3web_sapi.c,v 1.10 2000/09/08 14:43:56 zeev Exp $ */
#if WIN32|WINNT
# include <windows.h>
@@ -80,7 +80,7 @@
PUTS("<table border=5 width=600>\n");
PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR
"\">Pi3Web Server Information</th></tr>\n");
php_info_print_table_header(2, "Information Field", "Value");
- php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.9
2000/08/22 05:43:31 sas Exp $");
+ php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v
1.10 2000/09/08 14:43:56 zeev Exp $");
php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp());
snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled());
php_info_print_table_row(2, "Debug Enabled", variable_buf);
@@ -319,11 +319,6 @@
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)
Index: php4/sapi/roxen/roxen.c
diff -u php4/sapi/roxen/roxen.c:1.36 php4/sapi/roxen/roxen.c:1.37
--- php4/sapi/roxen/roxen.c:1.36 Sun Aug 20 07:29:00 2000
+++ php4/sapi/roxen/roxen.c Fri Sep 8 07:43:57 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: roxen.c,v 1.36 2000/08/20 14:29:00 sas Exp $ */
+/* $Id: roxen.c,v 1.37 2000/09/08 14:43:57 zeev Exp $ */
#include "php.h"
#ifdef HAVE_ROXEN
@@ -447,7 +447,7 @@
{
/* char buf[512]; */
php_info_print_table_start();
- php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.36 2000/08/20
14:29:00 sas Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.37 2000/09/08
14:43:57 zeev Exp $");
/* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -660,11 +660,6 @@
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;
Index: php4/sapi/servlet/servlet.c
diff -u php4/sapi/servlet/servlet.c:1.38 php4/sapi/servlet/servlet.c:1.39
--- php4/sapi/servlet/servlet.c:1.38 Mon Aug 21 10:01:49 2000
+++ php4/sapi/servlet/servlet.c Fri Sep 8 07:43:57 2000
@@ -357,11 +357,6 @@
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) {
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.22 php4/sapi/thttpd/thttpd.c:1.23
--- php4/sapi/thttpd/thttpd.c:1.22 Tue Aug 29 08:09:44 2000
+++ php4/sapi/thttpd/thttpd.c Fri Sep 8 07:43:57 2000
@@ -234,11 +234,6 @@
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;