cvs: /php4 ChangeLog SAPI.c configure.in /php4/sapi README

From: Date: Mon, 04 Oct 1999 18:08:17 +0000
Subject: cvs: /php4 ChangeLog SAPI.c configure.in /php4/sapi README
Groups: php.version4 
Request: Send a blank email to php-version4+get-5148@lists.php.net to get a copy of this message
sas Mon Oct 4 14:08:17 1999 EDT Modified files: /php4 ChangeLog SAPI.c configure.in /php4/sapi README Log: * Fix header("HTTP/..") behaviour * Fix leak WRT http_status_line * Update sapi/README * Remove %PHP_OUTPUT_FILES sort Index: php4/ChangeLog diff -u php4/ChangeLog:1.163 php4/ChangeLog:1.164 --- php4/ChangeLog:1.163 Mon Oct 4 09:31:36 1999 +++ php4/ChangeLog Mon Oct 4 14:07:44 1999 @@ -2,6 +2,8 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ?? 1999, Version 4.0 Beta 3 +- Fixed header("HTTP/..."); behaviour (Sascha) +- Improved UNIX build system. Now utilizes libtool (Sascha) - Upgrade some more internal functions to use new Zend function API. (Thies, Zend library) - Fixed backwards incompatibility with ereg() (Thies) Index: php4/SAPI.c diff -u php4/SAPI.c:1.31 php4/SAPI.c:1.32 --- php4/SAPI.c:1.31 Thu Sep 16 19:18:15 1999 +++ php4/SAPI.c Mon Oct 4 14:07:44 1999 @@ -198,7 +198,21 @@ } } +static int sapi_extract_response_code(const char *header_line) +{ + int code = 200; + const char *ptr; + for (ptr = header_line; *ptr; ptr++) { + if (*ptr == ' ' && *(ptr + 1) != ' ') { + code = atoi(ptr + 1); + break; + } + } + + return code; +} + /* This function expects a *duplicated* string, that was previously emalloc()'d. * Pointers sent to this functions will be automatically freed by the framework. */ @@ -221,6 +235,8 @@ /* Check the header for a few cases that we have special support for in SAPI */ if (header_line_len>=5 && !memcmp(header_line, "HTTP/", 5)) { + /* filter out the response code */ + SG(sapi_headers).http_response_code = sapi_extract_response_code(header_line); SG(sapi_headers).http_status_line = header_line; return SUCCESS; } else { @@ -256,6 +272,7 @@ SAPI_API int sapi_send_headers() { int retval; + int ret = FAILURE; sapi_header_struct default_header = { SAPI_DEFAULT_CONTENT_TYPE, sizeof(SAPI_DEFAULT_CONTENT_TYPE)-1 }; SLS_FETCH(); @@ -272,7 +289,7 @@ switch (retval) { case SAPI_HEADER_SENT_SUCCESSFULLY: SG(headers_sent) = 1; - return SUCCESS; + ret = FAILURE; break; case SAPI_HEADER_DO_SEND: if (SG(sapi_headers).http_status_line) { @@ -281,7 +298,6 @@ http_status_line.header = SG(sapi_headers).http_status_line; http_status_line.header_len = strlen(SG(sapi_headers).http_status_line); sapi_module.send_header(&http_status_line, SG(server_context)); - efree(SG(sapi_headers).http_status_line); } if (SG(sapi_headers).send_default_content_type) { sapi_module.send_header(&default_header, SG(server_context)); @@ -289,13 +305,18 @@ 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; + ret = SUCCESS; break; case SAPI_HEADER_SEND_FAILED: - return FAILURE; + ret = FAILURE; break; + } + + if (SG(sapi_headers).http_status_line) { + efree(SG(sapi_headers).http_status_line); } - return FAILURE; + + return ret; } Index: php4/configure.in diff -u php4/configure.in:1.12 php4/configure.in:1.13 --- php4/configure.in:1.12 Mon Oct 4 11:18:01 1999 +++ php4/configure.in Mon Oct 4 14:07:44 1999 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.12 1999/10/04 15:18:01 sas Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.13 1999/10/04 18:07:44 sas Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(0) @@ -724,8 +724,6 @@ AC_SUBST(PHP_LIBS) AC_SUBST(PHP_SAPI) AC_SUBST(INSTALL_IT) - -PHP_OUTPUT_FILES=echo $PHP_OUTPUT_FILES | sort #libphp4.module AC_OUTPUT([Makefile php4.spec ext/Makefile sapi/Makefile $PHP_OUTPUT_FILES Index: php4/sapi/README diff -u php4/sapi/README:1.2 php4/sapi/README:1.3 --- php4/sapi/README:1.2 Mon Oct 4 11:18:24 1999 +++ php4/sapi/README Mon Oct 4 14:07:46 1999 @@ -10,8 +10,8 @@ respectively. Additionally, the following m4 macros can be used to influence what is created during "make": -PHP_BUILD_SHARED -- build shared target libs/php_lib.so -PHP_BUILD_STATIC -- build static target libs/php_lib.a +PHP_BUILD_SHARED -- build shared target libs/libphp4.so +PHP_BUILD_STATIC -- build static target libs/libphp4.a PHP_BUILD_PROGRAM -- build executable php (paths relative to top build dir)

« previous php.version4 (#5148) next »