1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

269 Commits

Author SHA1 Message Date
Jeff Trawick
90231d37d6 when the connection drops, c->aborted is set but generally
ap_pass_brigade returns APR_SUCCESS

content-length needs to be alert to c->aborted so that it
doesn't keep trying to pass brigades down (otherwise, you get
errors writing to the network over and over and over and ...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97363 13f79535-47bb-0310-9956-ffa450edef68
2002-10-31 11:39:36 +00:00
Jeff Trawick
e8402764fa Ensure that output already available is flushed to the network
when the content-length filter realizes that no new output will
be available for a while.  This helps some streaming CGIs as
well as some other dynamically-generated content.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97054 13f79535-47bb-0310-9956-ffa450edef68
2002-10-02 13:41:45 +00:00
Greg Stein
491919f718 Minor simplification... The can_send_content_length variable is
redundant with ctx->data_sent.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96971 13f79535-47bb-0310-9956-ffa450edef68
2002-09-25 01:51:13 +00:00
Jim Jagielski
6453fb2a05 The protocol version (eg: HTTP/1.1) in the request line parsing
is now case insensitive. Before, 'http/1.1' would silently be forced
to HTTP/1.0


PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96857 13f79535-47bb-0310-9956-ffa450edef68
2002-09-17 01:14:57 +00:00
Brian Pane
2c3170ce19 Changed the content-length filter to allow streaming delivery
of content to clients

With this new code, the C-L filter will compute a content-length
if there's an EOS in the first brigade passed to it.  For normal
static file requests, the response header will still include a C-L.
If there's no EOS in the first brigade passed to the C-L filter,
the filter will give up on setting the C-L header, in favor of
passing the data on to the next filter in a timely manner.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96557 13f79535-47bb-0310-9956-ffa450edef68
2002-08-28 18:37:48 +00:00
Greg Ames
65b5ceef11 fix weird things that happen with canned error messages due to using two
different request_recs after an ErrorDocument internal redirect failure.
examples: wrong Content-Type, garbled output from ebcdic servers due to
double charset translation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96364 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 14:27:39 +00:00
Jeff Trawick
9437341232 add notes about a portability problem -- formatting apr_time_t
in hex


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96094 13f79535-47bb-0310-9956-ffa450edef68
2002-07-17 13:50:26 +00:00
Greg Ames
fc5a1debc7 fix folding when the continuation charater is a blank
Reported by:	one of Jeff T's regression test cases


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95975 13f79535-47bb-0310-9956-ffa450edef68
2002-07-08 17:36:41 +00:00
Jeff Trawick
f410fb3f9e silence an unhelpful gcc warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95971 13f79535-47bb-0310-9956-ffa450edef68
2002-07-08 12:58:16 +00:00
Brian Pane
5a02911204 Eliminated the use of AP_MODE_SPECULATIVE brigade reads to check
for request header continuation lines.  Instead, ap_get_mime_headers_core()
now sets aside each line of input until it sees the next line.  If the
next line starts with a tab, it is appended to the previous one; otherwise,
the previous line is added to the request headers table.

This reduces the number of temporary buckets that must be created
and destroyed to read in a request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95964 13f79535-47bb-0310-9956-ffa450edef68
2002-07-06 01:53:37 +00:00
Brian Pane
708e1d6117 Re-use the same temp brigade to read all lines of a request header,
to avoid the overhead of brigade creation and deletion.  (This produced
a 5% reduction in the total CPU usage of a minimalist httpd configuration:
<JHEPKCEMGPKFFDHHDDKDMELFEKAA.bill@wstoddard.com>)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95956 13f79535-47bb-0310-9956-ffa450edef68
2002-07-04 17:05:25 +00:00
Cliff Woolley
73222b7255 Fix C-L filter non-blocking-mode brokenness. It was failing to ever
read from pipe/socket buckets again if it got APR_EAGAIN from them
due to its use of APR_BRIGADE_FOREACH.

Submitted by: the gang on IRC


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95946 13f79535-47bb-0310-9956-ffa450edef68
2002-07-02 23:51:21 +00:00
Brian Pane
5cc9b76282 Optimization for ap_rgetline_core(): When "folding" mode is enabled,
clear and re-use the temporary brigade rather than destroying it
and creating a new one


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95920 13f79535-47bb-0310-9956-ffa450edef68
2002-07-01 05:05:51 +00:00
Justin Erenkrantz
001b387bcd Change conn_rec->keepalive to an enumerated value of
AP_CONN_UNKNOWN
AP_CONN_CLOSE
AP_CONN_KEEPALIVE

This also fixes a problem where ap_discard_request_body would not discard
the body when keepalive was 0.  This actually meant the keepalive status
was unknown *not* closed, but no one ever remembered that.

This problem was seen with mod_dav sending error responses (as reported by
Karl Fogel).

Suggested by:	Greg "this isn't the '80s" Stein
Reviewed by:	Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95891 13f79535-47bb-0310-9956-ffa450edef68
2002-06-26 19:45:07 +00:00
Jeff Trawick
b9850574f2 ap_finalize_sub_req_protocol() shouldn't send an EOS bucket if
one was already sent.

mod_ext_filter performs some one-time processing when it sees EOS.
When it saw EOS more than once and a subsequent attempt to close a
file failed, it issued the log message described in PR 9644.

PR:      9644


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95595 13f79535-47bb-0310-9956-ffa450edef68
2002-06-10 18:51:38 +00:00
Ryan Bloom
a90a9ba2be Call ap_discard_request_body from ap_finalize_request. Remove the call
from all other modules that do not use it to determine the response for
the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95576 13f79535-47bb-0310-9956-ffa450edef68
2002-06-07 22:31:34 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Brian Pane
0f622df169 Start with a larger buffer size in ap_rgetline_core() to avoid
having to grow the buffer so often


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95053 13f79535-47bb-0310-9956-ffa450edef68
2002-05-13 06:45:07 +00:00
Brian Pane
94c67d067d Optimization: modified the power-of-two allocator in ap_rgetline_core()
so that it converges on the new buffer size in a single iteration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95052 13f79535-47bb-0310-9956-ffa450edef68
2002-05-13 06:16:31 +00:00
Brian Pane
7dd968bb3e Fixed missing null-termination of ap_make_content_type() patterns list
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95047 13f79535-47bb-0310-9956-ffa450edef68
2002-05-12 16:55:41 +00:00
Brian Pane
3cf16ad4c7 Optimization: Replaced apr_strcat() with apr_strcatv() in
ap_make_content_type()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95041 13f79535-47bb-0310-9956-ffa450edef68
2002-05-12 00:57:33 +00:00
Brian Pane
7e2c4f3a54 Performance fix: replaced the strcasecmp calls in ap_make_content_type()
with apr_strmatch()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95026 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 06:47:13 +00:00
Cliff Woolley
f37d50cd71 cleanup old-school backward uses of APR_BRIGADE_CONCAT to use
APR_BRIGADE_PREPEND instead, plus optimize away a bunch of repetitive
brigade destructions/creations by hanging onto ctx->saved even after
we empty it out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94952 13f79535-47bb-0310-9956-ffa450edef68
2002-05-06 09:11:50 +00:00
Justin Erenkrantz
f8ead96f43 Simplify this little chunk of code since r is set to f->r earlier.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94831 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 06:24:53 +00:00
Justin Erenkrantz
6f208d31a7 Adds support for reading trailers on input by exporting get_mime_headers
to ap_get_mime_headers and calling it in the appropriate place in
ap_http_filter.

showstoppers--;


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94667 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 05:43:09 +00:00
William A. Rowe Jr
e5200732d3 Correct partitioning of filter handles between core and http, and
export the handle pointers on Win32.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94468 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 20:55:00 +00:00
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
William A. Rowe Jr
5c1259758f Seems like this is the end of the compiler emits on Win32, once again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93987 13f79535-47bb-0310-9956-ffa450edef68
2002-03-17 23:18:10 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Sander Striker
99bbb31b45 Style Police comming through...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93842 13f79535-47bb-0310-9956-ffa450edef68
2002-03-11 13:57:25 +00:00
Greg Ames
e311cbc704 ap_rgetline_core: fix a bug with folding observed while testing ebcdic.
Garbage characters sometimes appeared after a legitimate folded header.
We weren't allocating an extra byte for the trailing null, or copying it,
when called from get_mime_headers (folding is in use, and ap_rgetline is
responsible for allocating memory).  No need to worry about a trailing
LF - it's already been nuked.

I checked the partial line code to see if it had a similar bug.  It looked
like it did, and that the code which trims the back end of the line would
run multiple times and whack innocent bytes.  However, gdb showed that this
section of code appears to be dead due to input filter chain changes.

also, removed an assignment to a dead variable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93804 13f79535-47bb-0310-9956-ffa450edef68
2002-03-08 20:24:07 +00:00
Greg Ames
1831fc04ee ap_rgetline: fix folding and partial line handling on ebcdic boxes. The
normal case worked OK, but due to the recursion and multiple exit points,
input bytes could go thru charset translation multiple times or not at all.

Suggested by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93776 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 22:08:46 +00:00
Ryan Bloom
116497445f Remove the prev pointer from the filter chain. This removes
the complexity of trying to set the filter chain correctly, with the
side-effect of forcing us to walk the entire chain whenever we add
a filter.  Since the filter chains are small, the decrease in
complexity is worth it.
Reviewed by:	Allan Edwards


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93745 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 02:09:30 +00:00
Ryan Bloom
596d79f14b This fixes most of the header bug that was committed last night. The server
is seg faulting on pipelined requests currently, but I want to get people
back to a running server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93686 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:04:03 +00:00
Ryan Bloom
9ac46ee310 Fix the mod_dir/mod_negotiation bug, where redirects and sub requests
were not getting the correct filters.  This is done by creating a location
in the request rec that holds protocol level filters.  Protocol level
filters survive for one request, from the time the request is received
from the user to the time the response is sent.  r->output_filters now
stores the request level filters, which are only valid for the lifetime
of one request_rec.

This patch works, but it is not complete.  The second half of the problem
is that add_any_filter doesn't check where it puts the filters that it
adds, so it is possible for filters to be put on this wrong list, and
for filters to be lost completely during request processing.  That half
of the fix will be coming in the next day or so.

Submitted by:	Will Rowe, Justin Erenkrantz, Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93682 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 02:15:52 +00:00
Allan K. Edwards
a547ba6880 ownership of the brigade is passed in the ap_pass_brigade call
so make sure that it doesn't get left lying around. This tickled
a bug with mod_deflate and resulted in a bucket being compressed
more than once.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93610 13f79535-47bb-0310-9956-ffa450edef68
2002-02-27 21:16:19 +00:00
Justin Erenkrantz
097ccb920f Just toss these debug messages since so many people use httpd with
LogLevel 'debug' and complain if they see anything that says "error"
in it.  This case isn't even interesting unless you are hard-core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93422 13f79535-47bb-0310-9956-ffa450edef68
2002-02-15 01:17:53 +00:00
Greg Ames
e67dd71c19 update CHANGES for an input side seg fault fix.
also, get rid of a mainframe term that somehow leaked into a comment which
might confuse people.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93334 13f79535-47bb-0310-9956-ffa450edef68
2002-02-08 14:47:10 +00:00
Greg Ames
1c1ce97f3c ensure that ap_rgetline allocates storage for the request line each time it is
called.

This fixes a number of segfaults on daedalus where the first line is
empty (i.e. \r\n followed by a bunch of garbage)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93332 13f79535-47bb-0310-9956-ffa450edef68
2002-02-08 02:25:42 +00:00
Justin Erenkrantz
581ada359b We totally disregard the fact that notice is level 5 and always print
that.  Yuck.  Make these error message DEBUG level then.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93295 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 16:56:52 +00:00
Jeff Trawick
0d0add84b0 don't try to place a header field in error-notes if ap_rgetline()
returned something like APR_EOF, since len is not set in this
case and we can go off the end of storage

make sure we set r->status to something when we bail out due
to an error; otherwise, the request goes forward with meaningless
headers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93294 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 16:19:03 +00:00
Justin Erenkrantz
68f36d57cd Tone down the logging levels for these two messages from ERROR to NOTICE.
It's something to note, but it isn't an error worthy of logging by default.
(Also always log any status values in read_request_line() - incl. timeouts.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93271 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 02:29:54 +00:00
Justin Erenkrantz
4ffeb3ca6e If the MIME-continuation line returns nothing, then we should return not
segfault.

(A minor change to Jeff's patch is that we ignore the EBCDIC code path.)

Submitted by:	Jeff Trawick
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93269 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 02:20:13 +00:00
Ian Holsman
2d386ab438 make it compile on win32
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93094 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 04:37:29 +00:00
Justin Erenkrantz
f153bf8a14 Simplify the exit paths of ap_rgetline by creating a second brigade for
use when we do AP_MODE_SPECULATIVE.  This allows us to delete the
brigades earlier.

(In practice, it really doesn't matter if we delete the brigade or not
since it will be destroyed when it's pool is destroyed, but we'll try
to be nice.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93092 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 02:06:09 +00:00
Brian Pane
efbab2c104 optimized away one more filter name lookup during request processing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93052 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 19:24:20 +00:00
Brian Pane
60919177e8 Fixed a read from a deleted brigade in the new version of
ap_rgetline()...

In the "folding" case, there was an ap_get_brigade() call after
the brigade had been destroyed.  I noticed this while debugging
a memory leak that showed up while testing the httpd with ab.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93044 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 07:30:02 +00:00
Jeff Trawick
4423c0c6de ap_rgetline(): completely ignore an empty bucket... previously the logic
generally worked but with a memory debug build it could
               crash since some memory debuggers don't like an alloc of
               zero bytes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93037 13f79535-47bb-0310-9956-ffa450edef68
2002-01-26 23:01:31 +00:00
Justin Erenkrantz
fb29f09f00 Eliminate needless variable that wasn't initialized anyway.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93023 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 05:39:21 +00:00
Justin Erenkrantz
be95061013 Add another status code to ignore in the error_log.
(I'm really tempted to ditch this log line altogether.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93021 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 02:38:52 +00:00