summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-02-11 02:23:29 +0000
committerSascha Schumann <sas@php.net>2003-02-11 02:23:29 +0000
commit67f18fcf6c5918e9273dbdab165b99bd60b3e736 (patch)
tree1e2d013a9b05d7d1a8f2518dcb6d7f57fbd2d5b8
parent90ade25ad0fd0252412f7d7e69a30c888f280ec6 (diff)
downloadphp-git-67f18fcf6c5918e9273dbdab165b99bd60b3e736.tar.gz
Detect whether BUFFs contain a fd element. IBM is hiding the actual
descriptor behind a void *, so we just disable this for IBM servers
-rw-r--r--sapi/apache/config.m413
-rw-r--r--sapi/apache/mod_php4.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4
index 63c2aa5c5d..3ff82b3e24 100644
--- a/sapi/apache/config.m4
+++ b/sapi/apache/config.m4
@@ -212,6 +212,19 @@ PHP_SUBST(APXS_LDFLAGS)
PHP_SUBST(APACHE_INSTALL)
PHP_SUBST(STRONGHOLD)
+AC_CACHE_CHECK([for member fd in BUFF *],ac_cv_php_fd_in_buff,[
+ save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $APACHE_INCLUDE"
+ AC_TRY_COMPILE([#include <httpd.h>],[conn_rec *c; int fd = c->client->fd;],[
+ ac_cv_php_fd_in_buff=yes],[ac_cv_php_fd_in_buff=no],[ac_cv_php_fd_in_buff=no])
+ CPPFLAGS=$save
+],[
+ if test "$ac_cv_php_fd_in_buff" = "yes"; then
+ AC_DEFINE(PHP_APACHE_HAVE_CLIENT_FD, 1, [ ])
+ fi
+])
+
+
AC_MSG_CHECKING(for mod_charset compatibility option)
AC_ARG_WITH(mod_charset,
[ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache).],
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 9f3d7444dd..f0cb048b7e 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -348,6 +348,7 @@ static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
*/
static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
{
+#if PHP_APACHE_HAVE_CLIENT_FD
request_rec *r = SG(server_context);
int fd;
@@ -357,6 +358,7 @@ static int sapi_apache_get_fd(int *nfd TSRMLS_DC)
if (nfd) *nfd = fd;
return SUCCESS;
}
+#endif
return FAILURE;
}
/* }}} */