]> granicus.if.org Git - php/commitdiff
MFH BUFF check
authorSascha Schumann <sas@php.net>
Tue, 11 Feb 2003 02:25:48 +0000 (02:25 +0000)
committerSascha Schumann <sas@php.net>
Tue, 11 Feb 2003 02:25:48 +0000 (02:25 +0000)
sapi/apache/config.m4
sapi/apache/mod_php4.c

index 63c2aa5c5d4b2fb84c578e40a209905cc17ea6fa..3ff82b3e2454c123c045b33cb70a8faf17b6ec3d 100644 (file)
@@ -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).],
index c4afc8b32e3c213c72ec6b52dcdc670149423f94..b2abb928d8c42375e1f349976066f6d358cacb5c 100644 (file)
@@ -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;
 }
 /* }}} */