[PHP4BETA] CVS update: php4

From: Date: Fri, 28 May 1999 22:41:48 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-1156@lists.php.net to get a copy of this message
Date: Friday May 28, 1999 @ 18:41 Author: zeev Update of /repository/php4 In directory php:/tmp/cvs-serv25185 Modified Files: SAPI.c configure.in.in mod_php4.c rfc1867.c Log Message: * Get Apache module to compile again with the regex stuff. * Get Apache to propertly work with POST, and some SAPI fixes Index: php4/SAPI.c diff -u php4/SAPI.c:1.22 php4/SAPI.c:1.23 --- php4/SAPI.c:1.22 Tue May 25 18:28:24 1999 +++ php4/SAPI.c Fri May 28 18:41:48 1999 @@ -74,6 +74,12 @@ } +SAPI_API void sapi_shutdown() +{ + zend_hash_destroy(&known_post_content_types); +} + + static void sapi_free_header(sapi_header_struct *sapi_header) { efree(sapi_header->header); @@ -167,6 +173,9 @@ if (SG(server_context)) { if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "POST")) { + if (!SG(request_info).content_type) { + sapi_module.sapi_error(E_COMPILE_ERROR, "No content-type in POST request"); + } sapi_read_post_data(SLS_C); } SG(request_info).cookie_data = sapi_module.read_cookies(SLS_C); @@ -291,4 +300,4 @@ SAPI_API void sapi_unregister_post_reader(sapi_post_content_type_reader *post_content_type_reader) { zend_hash_del(&known_post_content_types, post_content_type_reader->content_type, post_content_type_reader->content_type_len+1); -} \ No newline at end of file +} Index: php4/configure.in.in diff -u php4/configure.in.in:1.32 php4/configure.in.in:1.33 --- php4/configure.in.in:1.32 Thu May 27 04:53:21 1999 +++ php4/configure.in.in Fri May 28 18:41:48 1999 @@ -1,4 +1,4 @@ -dnl $Id: configure.in.in,v 1.32 1999/05/27 08:53:21 ssb Exp $ -*- sh -*- +dnl $Id: configure.in.in,v 1.33 1999/05/28 22:41:48 zeev Exp $ -*- sh -*- dnl Process this file with autoconf to produce a configure script. @@ -298,6 +298,12 @@ divert(2) +abs_srcdir=(cd $srcdir; pwd) +abs_builddir=pwd +AC_SUBST(abs_srcdir) +AC_SUBST(abs_builddir) + +AC_MSG_CHECKING(for Apache module support via DSO through APACI) AC_MSG_CHECKING(whether to use bundled regex library) AC_ARG_WITH(system-regex, [ --with-system-regex Do not use the bundled regex library], @@ -308,7 +314,7 @@ AC_DEFINE(REGEX,0) ],[ REGEX_LIB=regex/libregex.a - EXTRA_LIBS="-Lregex -lregex $EXTRA_LIBS" + EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS" HSREGEX=yes AC_MSG_RESULT(yes) AC_DEFINE(HSREGEX) @@ -354,12 +360,6 @@ APACHE_INSTALL_FILES="$srcdir/mod_php4.* libphp4.module" -abs_srcdir=(cd $srcdir; pwd) -abs_builddir=pwd -AC_SUBST(abs_srcdir) -AC_SUBST(abs_builddir) - -AC_MSG_CHECKING(for Apache module support via DSO through APACI) AC_ARG_WITH(shared-apache, [ --with-shared-apache[=DIR] Build shared Apache module. DIR is the top-level Apache build directory, defaults to /usr/local/etc/httpd. Index: php4/mod_php4.c diff -u php4/mod_php4.c:1.2 php4/mod_php4.c:1.3 --- php4/mod_php4.c:1.2 Thu May 27 23:54:15 1999 +++ php4/mod_php4.c Fri May 28 18:41:48 1999 @@ -28,7 +28,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php4.c,v 1.2 1999/05/28 03:54:15 rasmus Exp $ */ +/* $Id: mod_php4.c,v 1.3 1999/05/28 22:41:48 zeev Exp $ */ #include "httpd.h" #include "http_config.h" @@ -208,7 +208,9 @@ SG(request_info).path_translated = r->filename; SG(request_info).request_uri = r->uri; SG(request_info).request_method = (char *)r->method; + printf("Obtaining content type...\n"); SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); + printf("Obtained content type: %s\n", SG(request_info).content_type); SG(request_info).content_length = (content_length ? atoi(content_length) : 0); if (r->headers_in) { @@ -238,6 +240,9 @@ int fd, retval; SLS_FETCH(); + if (setjmp(EG(bailout))!=0) { + return OK; + } /* We don't accept OPTIONS requests, but take everything else */ if (r->method_number == M_OPTIONS) { r->allowed |= (1 << METHODS) - 1; @@ -291,12 +296,13 @@ hard_timeout("send", r); SG(server_context) = r; - init_request_info(SLS_C); php_save_umask(); chdir_file(filename); add_common_vars(r); add_cgi_vars(r); + + init_request_info(SLS_C); apache_php_module_main(r, fd, display_source_mode SLS_CC); /* Done, restore umask, turn off timeout, close file and return */ @@ -382,6 +388,7 @@ void php_init_handler(server_rec *s, pool *p) { register_cleanup(p, NULL, php_module_shutdown, php_module_shutdown_for_exec); + sapi_startup(&sapi_module); php_module_startup(&sapi_module); #if MODULE_MAGIC_NUMBER >= 19980527 ap_add_version_component("PHP/" PHP_VERSION); Index: php4/rfc1867.c diff -u php4/rfc1867.c:1.1 php4/rfc1867.c:1.2 --- php4/rfc1867.c:1.1 Tue May 25 18:28:24 1999 +++ php4/rfc1867.c Fri May 28 18:41:48 1999 @@ -7,6 +7,9 @@ char input_buffer[FILE_UPLOAD_INPUT_BUFFER_SIZE]; uint read_bytes; + sapi_module.sapi_error(E_COMPILE_ERROR, "File upload is not yet supported"); + return; + boundary = strstr(content_type_dup, "boundary"); if (!boundary || !(boundary=strchr(boundary, '='))) { sapi_module.sapi_error(E_COMPILE_ERROR, "Missing boundary in multipart/form-data POST data"); -- PHP 4 Beta

« previous php.version4 (#1156) next »