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],
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)
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.
AC_ARG_WITH(pcre-regex,
[ --with-pcre-regex[=DIR] Include Perl Compatible Regular Expressions support],[
if test "$withval" = "yes"; then
- EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
+ EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
fi
],[
- EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
+ EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
AC_ARG_WITH(pcre-regex,
[ --with-pcre-regex[=DIR] Include Perl Compatible Regular Expressions support],[
if test "$withval" = "yes"; then
- EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
+ EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
fi
],[
- EXTRA_LIBS="-Lext/pcre/pcrelib -lpcre $EXTRA_LIBS"
+ EXTRA_LIBS="-L$abs_builddir/ext/pcre/pcrelib -lpcre $EXTRA_LIBS"
PCRE_SUBDIR="pcrelib"
AC_DEFINE(HAVE_PCRE, 1)
AC_MSG_RESULT(yes)
}
+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);
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);
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
+}
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");
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) {
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;
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 */
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);