cvs: php4(PHP_4) /sapi/thttpd config.m4 thttpd.c
| From: | Sascha Schumann | Date: | Mon, 12 May 2003 01:02:28 +0000 |
| Subject: | cvs: php4(PHP_4) /sapi/thttpd config.m4 thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20837@lists.php.net to get a copy of this message | ||
sas Sun May 11 21:02:28 2003 EDT
Modified files: (Branch: PHP_4)
/php4/sapi/thttpd config.m4 thttpd.c
Log:
MFH
Index: php4/sapi/thttpd/config.m4
diff -u php4/sapi/thttpd/config.m4:1.17.4.3 php4/sapi/thttpd/config.m4:1.17.4.4
--- php4/sapi/thttpd/config.m4:1.17.4.3 Tue May 6 06:16:08 2003
+++ php4/sapi/thttpd/config.m4 Sun May 11 21:02:28 2003
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.17.4.3 2003/05/06 10:16:08 sas Exp $
+dnl $Id: config.m4,v 1.17.4.4 2003/05/12 01:02:28 sas Exp $
dnl
AC_ARG_WITH(thttpd,
@@ -7,12 +7,18 @@
if test ! -d $withval; then
AC_MSG_RESULT(thttpd directory does not exist ($withval))
fi
- if egrep thttpd.2.21b $withval/version.h >/dev/null; then
- :
+
+ PHP_EXPAND_PATH($withval, THTTPD)
+
+ if grep thttpd.2.21b $withval/version.h >/dev/null; then
+ patch="test -f $THTTPD/php_patched || \
+ (cd $THTTPD && patch -p 1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch
php_patched)"
+
+ elif grep Premium $withval/version.h >/dev/null; then
+ patch=
else
- AC_MSG_ERROR([This version only supports thttpd-2.21b])
+ AC_MSG_ERROR([This version only supports thttpd-2.21b and Premium thttpd])
fi
- PHP_EXPAND_PATH($withval, THTTPD)
PHP_TARGET_RDYNAMIC
INSTALL_IT="\
echo 'PHP_LIBS = -L. -lphp4 \$(PHP_LIBS) \$(EXTRA_LIBS)' > $THTTPD/php_makefile; \
@@ -21,8 +27,7 @@
rm -f $THTTPD/php_thttpd.c $THTTPD/php_thttpd.h $THTTPD/libphp4.a; \
\$(LN_S) $abs_srcdir/sapi/thttpd/thttpd.c $THTTPD/php_thttpd.c; \
\$(LN_S) $abs_srcdir/sapi/thttpd/php_thttpd.h $abs_builddir/$SAPI_STATIC $THTTPD/;\
- test -f $THTTPD/php_patched || \
- (cd $THTTPD && patch -p 1 < $abs_srcdir/sapi/thttpd/thttpd_patch && touch
php_patched)"
+ $patch"
PHP_THTTPD="yes, using $THTTPD"
PHP_ADD_INCLUDE($THTTPD)
PHP_SELECT_SAPI(thttpd, static)
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.77.2.2.2.5 php4/sapi/thttpd/thttpd.c:1.77.2.2.2.6
--- php4/sapi/thttpd/thttpd.c:1.77.2.2.2.5 Thu May 1 16:50:16 2003
+++ php4/sapi/thttpd/thttpd.c Sun May 11 21:02:28 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: thttpd.c,v 1.77.2.2.2.5 2003/05/01 20:50:16 sas Exp $ */
+/* $Id: thttpd.c,v 1.77.2.2.2.6 2003/05/12 01:02:28 sas Exp $ */
#include "php.h"
#include "SAPI.h"
@@ -49,6 +49,9 @@
int seen_cn;
} php_thttpd_globals;
+#ifdef PREMIUM_THTTPD
+# define do_keep_alive persistent
+#endif
#ifdef ZTS
static int thttpd_globals_id;
@@ -632,7 +635,7 @@
if (hc->method == METHOD_POST)
hc->should_linger = 1;
- if (hc->contentlength > 0
+ if (hc->contentlength != -1
&& SIZEOF_UNCONSUMED_BYTES() < hc->contentlength) {
hc->read_body_into_mem = 1;
return 0;
@@ -644,7 +647,7 @@
/* disable kl, if no content-length was seen or Connection: was set */
if (TG(seen_cl) == 0 || TG(seen_cn) == 1) {
- TG(hc)->do_keep_alive = TG(hc)->keep_alive = 0;
+ TG(hc)->do_keep_alive = 0;
}
if (TG(sbuf).c != 0) {
@@ -695,7 +698,9 @@
void thttpd_set_dont_close(void)
{
TSRMLS_FETCH();
+#ifndef PREMIUM_THTTPD
TG(hc)->file_address = (char *) 1;
+#endif
}