Commit Graph

183 Commits

Author SHA1 Message Date
Sascha Schumann
09f463ddae Add sapi_get_fd() and implement it for the Apache/thttpd SAPIs. 2002-11-26 05:15:55 +00:00
Sascha Schumann
a8136b4dba Defend against pipelined requests on persistent connections as used by
IRCG. These could cause thttpd to start a second request in the same
connection context, and thereby causing real damage.

Mozilla 1.0.1 is buggy in that context: When HTTP/1.1 pipelining is
enabled (defaults to off), it will send any number of requests over
a persistent connection (which is fine), even after it has received
a "Connection: close" header field in a subsequent response header.
This blatantly violates RFC 2616, section 8.1.2. Because it cannot
receive any response on the dead connection, the download manager
pops up and tries to download a file (which never arrives).

Also, we don't try to send a 400 message anymore, if the connection
dies.
2002-11-10 15:21:13 +00:00
Sascha Schumann
f2f443f066 s/PHP_API/PHP_API_VERSION/ 2002-11-08 13:29:32 +00:00
Sascha Schumann
8d25447f30 let this source file compile with php 4.2.x 2002-11-07 11:56:02 +00:00
Sascha Schumann
eb0141913c Add two missing entries 2002-11-07 11:38:03 +00:00
Sascha Schumann
10a861f93c - use TCP_DEFER_ACCEPT
- don't timeout connections which are managed by IRCG
- don't generate invalid HTTP replies, if the client did not send a
  request line yet
2002-11-06 17:31:03 +00:00
Sascha Schumann
082d9c4936 Simplify handler dispatching mechanism 2002-11-01 11:51:35 +00:00
Sascha Schumann
1a7a5b3982 Add missing return statement. 2002-11-01 11:44:50 +00:00
Sascha Schumann
1d2eb7c485 update 2002-11-01 11:41:08 +00:00
Sascha Schumann
7d504b230c improve host header checking, only affects systems which have virtual
hosting enabled
2002-11-01 11:40:26 +00:00
Sascha Schumann
55879b3543 first step towards asynchronous content body processing 2002-10-30 19:09:49 +00:00
Sascha Schumann
ed15104099 s/-// 2002-10-26 22:27:45 +00:00
Sascha Schumann
40b93fa16d add phppat/phpspat configuration file support and
fix some indention
2002-10-26 22:22:34 +00:00
Sascha Schumann
e077e0debe update and extend 2002-10-26 22:22:07 +00:00
Sascha Schumann
7a0850a344 Fix build and .phps support 2002-10-26 21:06:10 +00:00
Sascha Schumann
01bdc2e369 experimental .phps support 2002-10-26 20:55:41 +00:00
Sascha Schumann
c46ed2114e not sure what this async_send is doing in here, so relieve it from its duty. 2002-10-26 20:45:35 +00:00
Sascha Schumann
7b3bea0b41 Donate "Fast Accept Loop" from Premium thttpd which speeds up processing
new connections when the connection table contains lots of entries.
2002-10-26 19:41:27 +00:00
Sascha Schumann
467fea036a Donate "Periodic Connection Expiring" from Premium thttpd, because
it is simple and gives a +40% improvement in terms of requests/s
when serving static files.
2002-10-26 18:14:45 +00:00
Sascha Schumann
b9135d74e9 some system headers (irix) define sa_len
prefix sa_len with x
2002-10-26 15:47:22 +00:00
Sascha Schumann
0a80a78670 thttpd initializes contentlength to -1, so we need to transfer that to 0
for SAPI/PHP.  Otherwise, SAPI will try to read (unsigned long) -1 bytes
from the connection.
2002-10-25 01:10:50 +00:00
Sascha Schumann
47a1421d89 Redo the patch on Linux, the cygwin diff seems to be a bit broken. 2002-10-13 11:54:08 +00:00
Sascha Schumann
356f7503fa PHP + thttpd (+IRCG) build using CYGWIN now 2002-10-13 11:50:16 +00:00
Sascha Schumann
4f61b16768 Remove set .x 2002-10-13 11:28:34 +00:00
Sascha Schumann
240cdb743e Use if block rather than an or expression 2002-10-13 11:28:06 +00:00
Sascha Schumann
1f18eaadee Force /nocache/ entities to be delivered completely, even if a
broken proxy ignores our anti-cache headers and sends an IMS request.
2002-09-23 15:41:44 +00:00
Sascha Schumann
625e7b202b Use generic getnameinfo for address-to-name translation, if available.
This adds support for IPv6 addresses.
2002-09-23 00:49:12 +00:00
Sascha Schumann
c74f96333f Immediately unmap /nocache/ entries, so that the mmc cache does not get
polluted too much.
2002-09-21 17:23:15 +00:00
Zeev Suraski
76312b4508 another startup initialization fix - only ISAPI and CGI SAPI's tested,
minor compile buglets might occur in other SAPIs, but should be trivial
to fix...
2002-09-18 21:57:42 +00:00
Sascha Schumann
8fd3f14ab1 Fix segfault due to unchecked null pointer 2002-07-26 16:16:12 +00:00
Sascha Schumann
1326c95b29 refine 2002-07-16 16:24:15 +00:00
Sascha Schumann
fa3d840cd1 integrate the public keep-alive patch
the patch did not handle pipeling at all, so that some code had to be added
from Premium thttpd

persistent connections are supported, if a script sets the Content-Length
header
2002-07-14 18:01:08 +00:00
Sascha Schumann
b4c28fba7f thttpd blocks in rare circumstances where it cannot write out a small HTTP
response (happened at customer sites).  The response is now written out
using the standard state machine.

the buffer which is handed to thttpd by php is now simply dealt with as if
it were a thttpd generated response (avoids code duplication).
2002-07-14 13:48:46 +00:00
Sascha Schumann
402cc031cd make the sapi module hand off a buffer to thttpd for final data delivery,
instead of blocking the whole process
2002-07-14 13:10:34 +00:00
Sascha Schumann
d7edeee55f Improve readability of the header send function 2002-05-17 21:22:30 +00:00
Sascha Schumann
a643a467e3 Add a note regarding which version we support 2002-03-11 12:28:16 +00:00
Sascha Schumann
9d9d39a0de Please welcome the new build system.
If you encounter any problems, please make sure to email sas@php.net
directly.

An introduction can be found on

http://schumann.cx/buildv5.txt
2002-03-07 14:20:02 +00:00
Sascha Schumann
5c2d995f0b Provide access to ini settings.
Properly block the thread, if IO is not ready on a fd.
2001-12-13 11:15:56 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Sascha Schumann
92a6f2c344 Sent proper encodings for gzip/compress files, otherwise IE won't
display them.

Refer to section 3.5, RFC 2616 -- these are IANA registered.

Patch submitted to author.
2001-12-10 14:09:08 +00:00
Sascha Schumann
ef72a765bf Add a nocache feature: If documents are stored under /nocache/,
appropiate HTTP headers will be sent which prevent client/proxy caching.
2001-12-10 13:31:41 +00:00
foobar
f43b57190c Added missing cvs ids and unified configure messages. 2001-11-30 19:01:32 +00:00
Sascha Schumann
1f6f91035e Get rid of post_off-hack which was only suitable for POST data
which fit into the small thttpd read buffer.  Do a small recv
after content-length bytes have been read to accomodate non-conforming
user-agents.
2001-10-27 12:08:10 +00:00
Sascha Schumann
a3368ababa Improved handling of posts 2001-10-27 11:27:39 +00:00
Sascha Schumann
49b44d537f Make the information available whether we are using HTTP/1.1 2001-10-09 15:15:55 +00:00
Sascha Schumann
3db3d65d2e typo fix by zoot@zotikos.com 2001-10-02 14:54:46 +00:00
Sascha Schumann
6db3f409d8 Add QUERY_STRING, HTTP_HOST, HTTP_ACCEPT_LANGUAGE to the script
environment.

Also support setting the INI path from the outside.
2001-09-30 18:23:28 +00:00
Jeroen van Wolffelaar
eb38ca844b Undo Z_ subst for sapi and ext/yaz 2001-09-27 20:01:23 +00:00
Jeroen van Wolffelaar
c033288573 Back-substitute for Z_* macro's. If it breaks some extension (the script isn't optimal, it parses for example var->zval.value incorrect) please let me know. 2001-09-25 21:58:48 +00:00
Sascha Schumann
2547f86060 Use $(LINK) for libraries, but $(LINK_CLEAN) for creating programs.
Also pass only $(CFLAGS_CLEAN) into thttpd's Makefile.
2001-09-10 17:15:03 +00:00
Sascha Schumann
0ccda62835 use an absolute path for symlinking the php library archive 2001-08-14 09:37:25 +00:00
Sascha Schumann
98304ba6a0 Use a symlink instead of copying the +6MB library archive during install 2001-08-13 22:34:25 +00:00
Sascha Schumann
96aa97f8b4 Don't display egrep result 2001-08-13 22:17:18 +00:00
Sascha Schumann
f42acb0cd6 whoops, forgot to apply cgi/poll patch before diff'ing 2001-08-13 22:01:55 +00:00
Sascha Schumann
7efc4d8b54 Add check for thttpd-2.21b. We support nothing else for now, because
this version is rock-stable using the combined set of patches.
2001-08-13 21:57:31 +00:00
Sascha Schumann
75c22e9a4a improved thttpd-2.21b patch.. I got tired of applying my patches for
these bugs.

fixes poll(2) issue
fixes hanging cgi issue
fixes off-by-one in scanning input buffers in case of EAGAIN/EWOULDBLOCK
fixes potential bug in managing write buffers
add "index.php" to default files to look for
2001-08-13 21:55:21 +00:00
Sascha Schumann
64c4456cca A CRLF at the end of a line is not so wrong. 2001-08-07 08:35:54 +00:00
Sascha Schumann
61618d4a03 The module usually did not send out Content-Type: text/html.
No major browser seems to care, Opera does though.
2001-08-07 08:34:02 +00:00
Sascha Schumann
8aef193056 more tsrm cleanup 2001-08-05 15:29:47 +00:00
Sascha Schumann
0af7ad15f5 further tsrm cleanup 2001-08-05 14:17:55 +00:00
Sebastian Bergmann
7168c31482 Even more TSRM cleanup. 2001-08-05 13:26:54 +00:00
Sascha Schumann
7263485576 tsrm-related cleanup 2001-08-05 10:32:48 +00:00
Sebastian Bergmann
a70ecedb33 Remove more duplicate TSRMLS_FETCH() calls. 2001-08-05 05:35:06 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Sascha Schumann
7c43206fb8 Remove unneeded variables 2001-07-26 18:10:38 +00:00
Sascha Schumann
36c2353046 Remove accidentially committed line 2001-07-23 02:39:59 +00:00
Sascha Schumann
e6d153f6c4 Support for handling multiple concurrent requests. 2001-06-23 16:27:56 +00:00
Sascha Schumann
e843e8c5f0 Move PHP_TARGET_RDYNAMIC check to global acinclude.m4 and use it
in thttpd's config.m4.
2001-06-15 12:53:20 +00:00
Sascha Schumann
afdaee9e47 Nuke more quotes 2001-05-12 11:09:05 +00:00
Sascha Schumann
e337f07ecd Replace slow strlcpy with a quick memcpy. 2001-05-03 09:04:15 +00:00
Andi Gutmans
8975186810 - Another strncpy() -> strlcpy() change 2001-05-02 22:53:41 +00:00
Sascha Schumann
6602b48071 Fix optimization -- we did not send out custom Response Status Lines. 2001-04-25 06:42:24 +00:00
Sascha Schumann
ff423ef9d9 remove Only.* lines from patch 2001-04-22 14:33:57 +00:00
Sascha Schumann
0fc2ca64bf bytes in the conn structure was renamed to bytes_sent. 2001-04-22 14:22:40 +00:00
Sascha Schumann
38e55b3249 Update patch to thttpd-2.21 2001-04-22 14:00:53 +00:00
Wilfredo Sanchez
cb71c4c2d0 Separate CPPFLAGS from CFLAGS. 2001-04-03 23:30:49 +00:00
foobar
8a26918ed1 Renamed the AC_ prefixed macros defined in acinclude.m4 to PHP_* prefixes.
# Heads up people! I tested this before committing but you never know..
2001-03-27 20:35:04 +00:00
Sascha Schumann
5708ddf171 Replace memcpy and sprintf with smart_strs. 2001-03-13 17:14:47 +00:00
Sascha Schumann
de6c69f716 Combine all HTTP headers into a single writev 2001-03-02 17:01:52 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
4a32816f9e If we cannot send the header, we don't need to continue with the page. 2001-02-21 20:25:53 +00:00
Sascha Schumann
2403578e35 Include <sys/uio.h>. Apparently, the header cleanup in glibc 2.2.2
caused that file to be included by accident.
2001-02-19 10:28:08 +00:00
Sascha Schumann
8c92cdd897 Save 50% of the syscalls when writing the HTTP header. 2001-02-18 19:03:36 +00:00
Sascha Schumann
ae92ebb92b Especially on FreeBSD it seems to be common that send(2) does not
do a decent job.  We handle that better now.
2001-01-10 13:51:58 +00:00
Sascha Schumann
de847f60ba Propagate the response code/HTTP status code back to thttpd for logging. 2001-01-09 09:01:33 +00:00
Sascha Schumann
7dd166e8c0 Account the number of sent bytes properly 2001-01-09 08:45:05 +00:00
Zeev Suraski
bd0ac7fe14 Many patches. I hope I remember them all:
- Make sapi_module available to external modules (PHPAPI)
- Make the php.ini path reported in phpinfo() always point to
  real full path of the php.ini file
- Optimized the ISAPI module not to read unnecessary server
  variables and read necessary variables at most once.
2001-01-02 22:49:31 +00:00
Sascha Schumann
7e28784de3 Fix indentation of configure output 2000-12-06 17:34:58 +00:00
Hartmut Holzgraefe
1f6878e912 2nd step towards auto-credits 2000-11-20 10:33:33 +00:00
Sascha Schumann
4bb564ad2b Clear idle_read_timer 2000-11-15 23:37:50 +00:00
Sascha Schumann
39f8c9807e Update patch and add persistent connection handling 2000-11-13 13:33:12 +00:00
Sascha Schumann
3fbfbf1f45 Add thttpd-dependent interface for maintaining persistent connections on
an iterative web-server. This will be used by the IRCG extension.
2000-11-13 13:23:56 +00:00
Sascha Schumann
8658cace16 Add note about serialized requests and their impact 2000-11-13 12:39:15 +00:00
Sascha Schumann
6a149caaed Fix aborted connection handling and stop modifying thttpd data 2000-11-12 21:10:09 +00:00
Sascha Schumann
27a8480028 Add/unify aborted connection handling 2000-10-29 16:01:02 +00:00
Sascha Schumann
6ff371d9f7 Leave initializing of auth_(user|password) to php_handle_auth_data(). 2000-10-27 10:31:10 +00:00
Sascha Schumann
e6dd64e96e Use php_handle_auth_data 2000-10-27 10:19:06 +00:00
Sascha Schumann
0fd6a7ed18 Provide basic auth info to scripts.
Protect shutdown handler from being called multiple times.
2000-10-11 19:40:56 +00:00
Zeev Suraski
91c808ecc4 Restore the headers_only test to the centralized SAPI startup. If necessary, it can
be overriden in the activate() callback.
2000-09-08 14:43:57 +00:00