summaryrefslogtreecommitdiff
path: root/sapi/thttpd/thttpd.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-05-12 01:02:08 +0000
committerSascha Schumann <sas@php.net>2003-05-12 01:02:08 +0000
commit40dd3617eb53a5d2a8deeaf4adda019dac6ba737 (patch)
treef2cc6541523e0b3e865aadac2b5b3241d9ca5afe /sapi/thttpd/thttpd.c
parent8c5eac260f518636e6ac877475702d94d14d17f4 (diff)
downloadphp-git-40dd3617eb53a5d2a8deeaf4adda019dac6ba737.tar.gz
add premium thttpd support
Diffstat (limited to 'sapi/thttpd/thttpd.c')
-rw-r--r--sapi/thttpd/thttpd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index fd6edc6ae3..96741daa9a 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -49,6 +49,9 @@ typedef struct {
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 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC)
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 @@ static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC)
/* 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 @@ int thttpd_get_fd(void)
void thttpd_set_dont_close(void)
{
TSRMLS_FETCH();
+#ifndef PREMIUM_THTTPD
TG(hc)->file_address = (char *) 1;
+#endif
}