1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-26 19:01:35 +03:00
Commit Graph

461 Commits

Author SHA1 Message Date
William A. Rowe Jr
de65e8cd0e Provide apr_pool_t arg to register_hooks, since anything they do in that
step -must- be done with a pool that will not outlive the cmd pool, from
  which they may have been dynamically loaded.

  This needs further review, it's committed only as a stopgap for those
  who's builds I broke, sorry.  Review tbc late this evening.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87699 13f79535-47bb-0310-9956-ffa450edef68
2001-01-17 22:04:45 +00:00
William A. Rowe Jr
40655f8641 Provide apr_pool_t arg to register_hooks, since anything they do in that
step -must- be done with a pool that will not outlive the cmd pool, from
  which they may have been dynamically loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87697 13f79535-47bb-0310-9956-ffa450edef68
2001-01-17 15:52:12 +00:00
Jeff Trawick
ad75d6e533 Fix a segfault in ap_http_filter(). I hit the segfault while
discarding the body of a request, but it could affect other paths.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87684 13f79535-47bb-0310-9956-ffa450edef68
2001-01-15 15:40:17 +00:00
Doug MacEachern
40391fb9f2 adjust remaining modules to use the new handler hook method (Alan Edwards)
bring back the old handler prototype by reusing r->handler (dougm)
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87617 13f79535-47bb-0310-9956-ffa450edef68
2001-01-08 23:55:12 +00:00
Ben Laurie
45f620672d Make handlers use hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87604 13f79535-47bb-0310-9956-ffa450edef68
2001-01-07 19:55:59 +00:00
Allan K. Edwards
0be0106405 add pool parameter to ap_is_directory and ap_is_rdirectory
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87593 13f79535-47bb-0310-9956-ffa450edef68
2001-01-05 20:44:44 +00:00
Jeff Trawick
8ae90fca38 EBCDIC: Fix some byterange protocol data translation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87571 13f79535-47bb-0310-9956-ffa450edef68
2001-01-02 19:22:09 +00:00
Ryan Bloom
bc1891795e Modify a couple of calls to ap_log_error with a NULL server to use
ap_log_perror, and pass a pool.  The keeps us from seg faulting if the
error log hasn't been opened yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87565 13f79535-47bb-0310-9956-ffa450edef68
2001-01-02 01:34:05 +00:00
Ryan Bloom
ebbd77a687 We never use MMAP_SEGMENT_SIZE, and we are better off determining if we
have MMAP, by just checking with APR, instead of using an Apache
definition which doesn't really control anything anymore.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87563 13f79535-47bb-0310-9956-ffa450edef68
2001-01-01 00:34:25 +00:00
Jeff Trawick
b38b38dc22 ap_content_length_filter(): if ap_save_brigade() fails, tell the caller
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87549 13f79535-47bb-0310-9956-ffa450edef68
2000-12-29 13:59:19 +00:00
Ryan Bloom
74383a7cae Because we can't get APR_EAGAIN from sendfile if we have a timeout, we
can simplify this test now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87545 13f79535-47bb-0310-9956-ffa450edef68
2000-12-28 23:27:20 +00:00
Jeff Trawick
d21e75657c On EBCDIC machines, fix up the charset of the header terminator.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87542 13f79535-47bb-0310-9956-ffa450edef68
2000-12-28 22:23:34 +00:00
Ryan Bloom
d1df8342b5 Ignore CRLF (or LF) when PEEK'ing at data on the socket. The general
problem is that some browsers send an extra line at the end of a POST
request.  We use the PEEK method to determine if there is any data left
on the socket, if there is then we delay sending the response until we
have enough data to make it worthwhile.  If the browser sends an extra
blank line, we don't want to delay the response at all.  The only time
we use the PEEK method is to check for a second request, so this is safe
to do.

This also solves Joe Orton's problem of specifying a Content- Length
of 1 for a blank line, and having the server wait to send back a response.
The problem is that Linux (all Unix really) sends two characters \r\n for
a blank line, so specifying a C-L of 1 means that the server still sees
a \n when it PEEKs that the socket data.  That \n can be safely ignored
however.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87540 13f79535-47bb-0310-9956-ffa450edef68
2000-12-28 01:14:22 +00:00
Ryan Bloom
39a2364a52 If we get EAGAIN returned from apr_sendfile, then we need to loop back and
call it again.  This change allows us to serve large files (such as
apache_2.0a9.tar.gz) using Apache 2.0 on FreeBSD.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87514 13f79535-47bb-0310-9956-ffa450edef68
2000-12-22 23:43:16 +00:00
William A. Rowe Jr
72a1fee16c OPTIONS request crashed server, this fixes it
Submitted by:	Joe Orton
Reviewed by:	W Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87504 13f79535-47bb-0310-9956-ffa450edef68
2000-12-21 21:09:56 +00:00
William A. Rowe Jr
8a5e3208d9 Last of the Win32 goodness I've noticed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87503 13f79535-47bb-0310-9956-ffa450edef68
2000-12-21 21:07:18 +00:00
Allan K. Edwards
e3cf0931a3 prevent crash when connection closed before complete request received
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87478 13f79535-47bb-0310-9956-ffa450edef68
2000-12-21 01:44:28 +00:00
Greg Ames
8b80bbc18b Send HTTP status line in ascii from ebcdic boxes...makes browsers much happier.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87467 13f79535-47bb-0310-9956-ffa450edef68
2000-12-20 23:13:01 +00:00
Jeff Trawick
50cca38301 Remove an IPv4 dependency in do_double_reverse() by calling
apr_getaddrinfo() instead of gethostbyname().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87402 13f79535-47bb-0310-9956-ffa450edef68
2000-12-18 20:31:17 +00:00
Jeff Trawick
fbeea294ef Stop using apr_get_hostname(). It doesn't support IPv6 and it
is redundant.  apr_getnameinfo() provides the same function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87396 13f79535-47bb-0310-9956-ffa450edef68
2000-12-18 16:49:09 +00:00
Ryan Bloom
072741059e Make the server return HTTP_RANGE_NOT_SATISFIABLE if the all of the
requested ranges begin after the end of the response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87390 13f79535-47bb-0310-9956-ffa450edef68
2000-12-17 20:58:30 +00:00
Ryan Bloom
b34037db5e Get byterange requests working with data that is generated by a handler
that does not add a content-length.  For example, mod_autoindex doesn't
set a content-length, but the byterange filter requires one.  We fix this
by computing the content-length in the byterange filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87389 13f79535-47bb-0310-9956-ffa450edef68
2000-12-17 18:04:14 +00:00
Jeff Trawick
b1e8b050e9 The local_addr and remote_addr fields in the conn_rec are now
apr_sockaddr_t * instead of sockaddr_in.  This is a small step
towards IPv6 support.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87342 13f79535-47bb-0310-9956-ffa450edef68
2000-12-14 18:47:30 +00:00
Ryan Bloom
02ce223e3a Get Apache filters and Apr-util buckets using the same values for
blocking and non-blocking reads.  This allows us to use the mode parameter
passed to a filter to read from the bucket correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87256 13f79535-47bb-0310-9956-ffa450edef68
2000-12-08 01:26:31 +00:00
Ryan Bloom
cc58804018 Remove an incorrect comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87239 13f79535-47bb-0310-9956-ffa450edef68
2000-12-07 00:17:52 +00:00
Ryan Bloom
b2d2ce84b2 Add a couple of files that I missed earlier today.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87196 13f79535-47bb-0310-9956-ffa450edef68
2000-12-05 03:51:41 +00:00
Ryan Bloom
c512685df5 Ignore all the files that are generated during a build
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87195 13f79535-47bb-0310-9956-ffa450edef68
2000-12-05 03:48:26 +00:00
Jeff Trawick
d870b177bd Fix some lvalue casts so that we can compile with xlc on AIX.
Submitted by:	"Victor J. Orlikowski" <v.j.orlikowski@gte.net>
Reviewed by:	Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87104 13f79535-47bb-0310-9956-ffa450edef68
2000-11-28 18:57:31 +00:00
Jeff Trawick
9fca860fbd fix an apr_size_t/apr_ssize_t discrepancy
Submitted by:	Victor J. Orlikowski


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87097 13f79535-47bb-0310-9956-ffa450edef68
2000-11-28 00:17:38 +00:00
Greg Stein
ead2dae94c *) Compensate for recent changes in the APR headers. Specifically, some
files need to specifically include stdio.h, or a particular apr_*.h
   header.

*) Adjust callers of apr_create_process() to deal with the extra "const"

*) Add "const" to args of ap_os_create_privileged_process()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87080 13f79535-47bb-0310-9956-ffa450edef68
2000-11-26 04:47:43 +00:00
Ryan Bloom
02f60b7ea4 Allow modules to specify the first module for a sub-request. This allows
modules to not have to muck with the output_filter after it creates the
sub-request.  Without this change, modules that create a sub-request have
to manually edit the output_filters, and therefore skip the sub-request
output_filter.  If they skip the sub-request output_filter, then we end
up sending multiple EOS buckets to the core_output_filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87065 13f79535-47bb-0310-9956-ffa450edef68
2000-11-22 19:38:07 +00:00
Ryan Bloom
a90554d578 Next pass at the content-length filter. Not perfect quite yet, but
getting closer
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87058 13f79535-47bb-0310-9956-ffa450edef68
2000-11-22 00:40:20 +00:00
Ryan Bloom
798d259441 Modify the content-length filter to change the criteria used to determine
if/when we compute the content-length.  There are just a few cases now:

        1) We already have all the data
        2) We don't have all the data and:
                2a)  This is a 1.1 request but we can't chunk
                2b)  The is a keep-alive request
	    In the future, we probably want to modify this to not
	    be a keep-alive request.

This filter always buffers 9K of data.  The reason is simple, the core will
buffer 9K at a time anyway, and there is a chance that we may get the end
of the request before we hit 9K.  This increases our chances of being able
to send a c-l.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87055 13f79535-47bb-0310-9956-ffa450edef68
2000-11-21 20:17:20 +00:00
Jeff Trawick
d4df2029ae updates to changed interfaces to apr_set_port(), apr_get_port(),
apr_set_ipaddr(), and apr_get_ipaddr()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87050 13f79535-47bb-0310-9956-ffa450edef68
2000-11-21 19:10:25 +00:00
Greg Ames
6de8f5e454 Add partial write support for apr_sendfile to core_output_filter.
Big .jpg's ( >70K or so) were being truncated on Linux.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87041 13f79535-47bb-0310-9956-ffa450edef68
2000-11-20 22:39:17 +00:00
Ryan Bloom
31602dc2c0 Get SetFilter working with MIME-types again and update the docs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87035 13f79535-47bb-0310-9956-ffa450edef68
2000-11-20 18:29:55 +00:00
Ryan Bloom
1206c2c37d Update the SetFilter directive to work with Handlers instead of MIME-types.
This also updates the docs to reflect the change.
Submitted by:	Joshua Slive
Reviewed by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87028 13f79535-47bb-0310-9956-ffa450edef68
2000-11-19 18:52:21 +00:00
Ryan Bloom
a17358b280 Add a directive to mod_mime which allows people to configure a filter
stack for a given mime-type.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87026 13f79535-47bb-0310-9956-ffa450edef68
2000-11-19 16:55:11 +00:00
William A. Rowe Jr
a1346d5f95 Clean up some timeout arg warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87006 13f79535-47bb-0310-9956-ffa450edef68
2000-11-18 14:43:26 +00:00
Ryan Bloom
0955906aea Get Multi-Views working again. It wasn't working because we weren't
setting the path_info field correctly if we didn't find the specified
file.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87004 13f79535-47bb-0310-9956-ffa450edef68
2000-11-18 05:44:53 +00:00
Ryan Bloom
4be2035ab6 Fix 204 handling. This moves some logic that used to be in
ap_send_error_response to the http_header filter.  The reason for the move,
is that the header filter takes care of all header processing now.  Without
this change, we were sending garbage data to the client whenever we sent
304 responses.
Submitted by:	Brian Havard and Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87003 13f79535-47bb-0310-9956-ffa450edef68
2000-11-18 04:53:23 +00:00
Bill Stoddard
92abe95d63 Make function definition agree with the declaration, which fixes a compile break on
Windows.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86991 13f79535-47bb-0310-9956-ffa450edef68
2000-11-17 13:57:32 +00:00
Ryan Bloom
4baadb8ef1 This removes all BUFF's from the HTTP proxy. This code is relatively
ugly, but it does proxy pages.  This even fixes the content-type bug
that I introduced yesterday sometime.  As soon as BUFF is removed from
the FTP proxy, the buff.c and buff.h files need to go away.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86988 13f79535-47bb-0310-9956-ffa450edef68
2000-11-17 00:19:30 +00:00
Ryan Bloom
95e93f299d Do not send a content-length if and only if this is a HEAD request and
the content-length is 0.  The problem is that the C-L on a HEAD response
has to be the correct C-L, but if a handler returns saying the handled
the request without sending data, the core sends an EOS down the filter
stack, and we compute a 0 C-L.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86976 13f79535-47bb-0310-9956-ffa450edef68
2000-11-15 22:08:44 +00:00
Ryan Bloom
59f2a0c5dc Remove the change from earlier tonight to not send a content-length of
0.
Submitted by:	Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86956 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 06:41:37 +00:00
Ryan Bloom
7e991c23f8 Stop the default_handler from trying to deal with HEAD requests. By doing
this, the content-length filter can determine the C-L before we send the
response, and we get a better response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86955 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 06:11:24 +00:00
Ryan Bloom
b31bf6e631 Make the header filter decide if a body should be sent. This gives us a
chance to compute the proper content-length before we try to send a set
of headers.  If a handler wants to ignore the HEAD method, then it can
either just return from the handler function or pass an EOS bucket down
the filter stack.  Either method will still get the headers sent to the
client.

This change allows handlers to actually run the request like it is a GET
request.  The core itself will then ensure that no body is sent.  This
allows us to get more information about the request before sending out the
headers for the HEAD request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86954 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 06:07:40 +00:00
Ryan Bloom
66b3a62de8 If the content-length is zero, then we don't output the Content-Length
header file.  The only time that the C-L should be zero is if there is
no body.  Zero is a valid content-length, but the only time that we ever
really send it is on a HEAD request right now, and that is incorrect.
The HEAD response should have the actual content's length.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86953 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 04:52:33 +00:00
Ryan Bloom
22587a3209 Associate a pool with the pool bucket so that it serves it's intended
purpose.  This also moves the create_pool function outside of an if to
decrease complexity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86952 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 04:22:03 +00:00
Jeff Trawick
eb2e6db97a Get http_core to compile again after the last change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86949 13f79535-47bb-0310-9956-ffa450edef68
2000-11-14 02:13:41 +00:00