From 1719d0062cede21490fadea9922b68bfb3482cc7 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Mon, 21 Apr 2003 01:09:33 +0000 Subject: [PATCH] MFH --- sapi/thttpd/thttpd_patch | 70 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/sapi/thttpd/thttpd_patch b/sapi/thttpd/thttpd_patch index fd7d0accc7..82cd6025ea 100644 --- a/sapi/thttpd/thttpd_patch +++ b/sapi/thttpd/thttpd_patch @@ -1404,17 +1404,9 @@ diff -ur thttpd-2.21b/mmc.h thttpd-2.21b-cool/mmc.h /* Done with an mmap()ed area that was returned by mmc_map(). ** If you have a stat buffer on the file, pass it in, otherwise pass 0. -diff -ur thttpd-2.21b/php_makefile thttpd-2.21b-cool/php_makefile ---- thttpd-2.21b/php_makefile Wed Apr 16 14:53:42 2003 -+++ thttpd-2.21b-cool/php_makefile Wed Apr 16 09:24:09 2003 -@@ -1,3 +1,3 @@ - PHP_LIBS = -L. -lphp4 -lcrypt -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -lcrypt - PHP_LDFLAGS = -rdynamic --PHP_CFLAGS = -DPHP_ATOM_INC -I/home/sas/opt-th/php/include -I/home/sas/opt-th/php/main -I/home/sas/src/php4 -I/home/sas/opt-th/thttpd-2.21b -I/home/sas/opt-th/php/Zend -I/home/sas/src/php4/main -I/home/sas/src/php4/Zend -I/home/sas/src/php4/TSRM -I/home/sas/opt-th/php/TSRM -O0 -g -I/home/sas/opt-th/php/TSRM -+PHP_CFLAGS = -DPHP_ATOM_INC -I/home/sas/opt-th/php/include -I/home/sas/opt-th/php/main -I/home/sas/src/php4 -I/home/sas/opt-th/thttpd-2.21b -I/home/sas/opt-th/php/Zend -I/home/sas/src/php4/main -I/home/sas/src/php4/Zend -I/home/sas/src/php4/TSRM -I/home/sas/opt-th/php/TSRM -O2 -march=i586 -I/home/sas/opt-th/php/TSRM diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c --- thttpd-2.21b/thttpd.c Wed Apr 16 15:42:14 2003 -+++ thttpd-2.21b-cool/thttpd.c Wed Apr 16 10:31:16 2003 ++++ thttpd-2.21b-cool/thttpd.c Mon Apr 21 03:06:13 2003 @@ -53,6 +53,10 @@ #endif #include @@ -1630,7 +1622,15 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c while ( ( ! terminate ) || numconnects > 0 ) { /* Do the fd watch. */ -@@ -565,16 +610,10 @@ +@@ -530,6 +575,7 @@ + exit( 1 ); + } + (void) gettimeofday( &tv, (struct timezone*) 0 ); ++ httpd_time_now = tv.tv_sec; + if ( num_ready == 0 ) + { + /* No fd's are ready - run the timers. */ +@@ -565,16 +611,10 @@ c = (connecttab*) fdwatch_get_client_data( ridx ); if ( c == (connecttab*) 0 ) continue; @@ -1651,7 +1651,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c } tmr_run( &tv ); -@@ -627,6 +666,8 @@ +@@ -627,6 +667,8 @@ #else /* CGI_PATTERN */ cgi_pattern = (char*) 0; #endif /* CGI_PATTERN */ @@ -1660,7 +1660,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c url_pattern = (char*) 0; no_empty_referers = 0; local_pattern = (char*) 0; -@@ -833,6 +874,16 @@ +@@ -833,6 +875,16 @@ value_required( name, value ); cgi_pattern = e_strdup( value ); } @@ -1677,7 +1677,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c else if ( strcasecmp( name, "urlpat" ) == 0 ) { value_required( name, value ); -@@ -1196,8 +1247,10 @@ +@@ -1196,8 +1248,10 @@ logstats( &tv ); for ( cnum = 0; cnum < maxconnects; ++cnum ) { @@ -1689,7 +1689,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c if ( connects[cnum].hc != (httpd_conn*) 0 ) { httpd_destroy_conn( connects[cnum].hc ); -@@ -1214,6 +1267,7 @@ +@@ -1214,6 +1268,7 @@ } mmc_destroy(); tmr_destroy(); @@ -1697,7 +1697,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c free( (void*) connects ); if ( throttles != (throttletab*) 0 ) free( (void*) throttles ); -@@ -1234,7 +1288,7 @@ +@@ -1234,7 +1289,7 @@ for (;;) { /* Is there room in the connection table? */ @@ -1706,7 +1706,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c { /* Out of connection slots. Run the timers, then the ** existing connections, and maybe we'll free up a slot -@@ -1245,10 +1299,10 @@ +@@ -1245,10 +1300,10 @@ return 0; } /* Find a free connection entry. */ @@ -1721,7 +1721,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Make the httpd_conn if necessary. */ if ( c->hc == (httpd_conn*) 0 ) { -@@ -1267,24 +1321,18 @@ +@@ -1267,24 +1322,18 @@ { case GC_FAIL: case GC_NO_MORE: @@ -1749,7 +1749,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Set the connection file descriptor to no-delay mode. */ httpd_set_ndelay( c->hc->conn_fd ); -@@ -1297,12 +1345,79 @@ +@@ -1297,12 +1346,79 @@ } } @@ -1830,7 +1830,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c httpd_conn* hc = c->hc; /* Is there room in our buffer to read more bytes? */ -@@ -1311,7 +1426,7 @@ +@@ -1311,7 +1427,7 @@ if ( hc->read_size > 5000 ) { httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); @@ -1839,7 +1839,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c return; } httpd_realloc_str( -@@ -1327,14 +1442,53 @@ +@@ -1327,14 +1443,53 @@ ** EWOULDBLOCK; however, this apparently can happen if a packet gets ** garbled. */ @@ -1898,7 +1898,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Do we have a complete request yet? */ switch ( httpd_got_request( hc ) ) { -@@ -1342,14 +1496,14 @@ +@@ -1342,14 +1497,14 @@ return; case GR_BAD_REQUEST: httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" ); @@ -1915,7 +1915,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c return; } -@@ -1358,18 +1512,28 @@ +@@ -1358,18 +1513,28 @@ { httpd_send_err( hc, 503, httpd_err503title, "", httpd_err503form, hc->encodedurl ); @@ -1946,7 +1946,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Fill in bytes_to_send. */ if ( hc->got_range ) { -@@ -1384,37 +1548,25 @@ +@@ -1384,37 +1549,25 @@ { /* No file address means someone else is handling it. */ c->bytes_sent = hc->bytes_sent; @@ -1992,7 +1992,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c static void handle_send( connecttab* c, struct timeval* tvP ) { -@@ -1443,6 +1595,9 @@ +@@ -1443,6 +1596,9 @@ iv[1].iov_base = &(hc->file_address[c->bytes_sent]); iv[1].iov_len = MIN( c->bytes_to_send - c->bytes_sent, c->limit ); sz = writev( hc->conn_fd, iv, 2 ); @@ -2002,7 +2002,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c } if ( sz == 0 || -@@ -1486,12 +1641,12 @@ +@@ -1486,12 +1642,12 @@ */ if ( errno != EPIPE && errno != EINVAL && errno != ECONNRESET ) syslog( LOG_ERR, "write - %m sending %.80s", hc->encodedurl ); @@ -2017,7 +2017,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Was this a headers + file writev()? */ if ( hc->responselen > 0 ) { -@@ -1500,7 +1655,7 @@ +@@ -1500,7 +1656,7 @@ { /* Yes; move the unwritten part to the front of the buffer. */ int newlen = hc->responselen - sz; @@ -2026,7 +2026,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c hc->responselen = newlen; sz = 0; } -@@ -1519,7 +1674,7 @@ +@@ -1519,7 +1675,7 @@ if ( c->bytes_sent >= c->bytes_to_send ) { /* This conection is finished! */ @@ -2035,7 +2035,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c return; } -@@ -1560,6 +1715,9 @@ +@@ -1560,6 +1716,9 @@ char buf[1024]; int r; @@ -2045,7 +2045,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* In lingering-close mode we just read and ignore bytes. An error ** or EOF ends things, otherwise we go until a timeout. */ -@@ -1569,6 +1727,61 @@ +@@ -1569,6 +1728,61 @@ } @@ -2107,7 +2107,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c static int check_throttles( connecttab* c ) { -@@ -1635,23 +1848,18 @@ +@@ -1635,23 +1849,18 @@ static void @@ -2137,7 +2137,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c if ( c->wakeup_timer != (Timer*) 0 ) { tmr_cancel( c->wakeup_timer ); -@@ -1669,13 +1877,36 @@ +@@ -1669,13 +1878,36 @@ ** circumstances that make a lingering close necessary. If the flag ** isn't set we do the real close now. */ @@ -2176,7 +2176,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c client_data.p = c; c->linger_timer = tmr_create( tvP, linger_clear_connection, client_data, LINGER_TIME * 1000L, 0 ); -@@ -1684,9 +1915,19 @@ +@@ -1684,9 +1916,19 @@ syslog( LOG_CRIT, "tmr_create(linger_clear_connection) failed" ); exit( 1 ); } @@ -2197,7 +2197,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c } -@@ -1702,45 +1943,12 @@ +@@ -1702,45 +1944,12 @@ tmr_cancel( c->linger_timer ); c->linger_timer = 0; } @@ -2244,7 +2244,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c static void wakeup_connection( ClientData client_data, struct timeval* nowP ) -@@ -1783,6 +1991,43 @@ +@@ -1783,6 +1992,43 @@ } #endif /* STATS_TIME */ @@ -2288,7 +2288,7 @@ diff -ur thttpd-2.21b/thttpd.c thttpd-2.21b-cool/thttpd.c /* Generate debugging statistics syslog messages for all packages. */ static void -@@ -1826,3 +2071,41 @@ +@@ -1826,3 +2072,41 @@ stats_connections = stats_bytes = 0L; stats_simultaneous = 0; } -- 2.40.0