1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

233 Commits

Author SHA1 Message Date
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
Justin Erenkrantz
429aee9eec Turn the log verbosity WAY down by not logging TIMEUP and EOF errors in
read_request_line as these are very common place with HTTP keepalive
timeouts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93019 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 02:15:09 +00:00
Justin Erenkrantz
cb0ab15d4b Somehow, I lost this condition when I changed to account for ap_rgetline.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93016 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:20:00 +00:00
Justin Erenkrantz
94d01b65aa Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length.  This is
much more consistent.  Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length.  This makes it now possible to
pass constants down without assigning them to a temporary variable first.

Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
  some circumstances


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93014 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:11:47 +00:00
Justin Erenkrantz
f885c784d2 Rewrite ap_rgetline to remove the need to have an "internal" brigade stored
in the core_module structure by using the AP_MODE_SPECULATIVE filter mode
to determine if MIME-continuation should occur.

Notes:
- ap_rgetline has a new prototype.
- ap_rgetline returns APR_ENOSPC when we are out of buffer space.

All direct callers of ap_rgetline are now adjusted to handle this new API.
ap_getline will mimic the old API for now.

Reviewed by:	Ryan Morgan


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93011 13f79535-47bb-0310-9956-ffa450edef68
2002-01-24 23:59:51 +00:00
Justin Erenkrantz
7d32242a14 Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.

We also no longer look at readbytes to determine the method of
filter operation.  This makes the use of filters more obvious and
allows a wider range of options for input filters modes.

To start with, the new input filter modes are:

AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)

The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ

This also allows cleanup of mod_ssl's handling in the getline case.

Reviewed by:	Ryan Bloom (concept), Greg Stein (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92928 13f79535-47bb-0310-9956-ffa450edef68
2002-01-19 07:45:18 +00:00
Brian Pane
5ce2fa7b99 A modification to reduce the memory usage of the server:
Reduced the initial size of the r->headers_in and r->subprocess_env
tables...this saves us 600 bytes per request, which (based on tests
I just ran) helps keep r->pool from overflowing its initial 8KB
allocation and having to alloc another 8KB block.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92843 13f79535-47bb-0310-9956-ffa450edef68
2002-01-13 21:30:14 +00:00
Bradley Nicholes
fe065c4cfd Making sure that the global variables have been initialized to avoid linker
problems at least on NetWare
Submitted by: Pavel Novy


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92711 13f79535-47bb-0310-9956-ffa450edef68
2002-01-02 23:27:57 +00:00
Brian Pane
fe8b39ceb8 Fixed a bug in ap_rgetline()
When an input line required more than one read, each subsequent
block of data was copied on top of the previous one.  So if a
request line got split into multiple packets, the data would be
corrupted.  The new code uses a power-of-two allocator to expand
the buffer and properly append the next block of data at the end
of the previous one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92558 13f79535-47bb-0310-9956-ffa450edef68
2001-12-21 04:21:15 +00:00
Brian Pane
ec71dcebd6 Skip the setting of Last-Modified in the response header on
requests or subrequests for which no response header will be
generated (a performance improvement for mod_include)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92523 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 23:57:36 +00:00
William A. Rowe Jr
0a02d0ae76 Address a signedness warning. No cleaner solutions here.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92450 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 16:41:43 +00:00
Brian Pane
a88efbd99f Fixed check for buffer overrun in ap_rgetline()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92324 13f79535-47bb-0310-9956-ffa450edef68
2001-12-05 01:34:00 +00:00
Jeff Trawick
583f14309a get rid of an unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92295 13f79535-47bb-0310-9956-ffa450edef68
2001-12-03 12:12:31 +00:00
Brian Pane
4a8c3b4a3b include/http_protocol.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92289 13f79535-47bb-0310-9956-ffa450edef68
2001-12-02 23:11:12 +00:00
Brian Pane
38eb105792 Optimization: changed some apr_pstrndup calls to apr_pstrmemdup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92282 13f79535-47bb-0310-9956-ffa450edef68
2001-12-02 09:51:19 +00:00
William A. Rowe Jr
1c0391b185 Yea, sure a message is always good. Note we can't log the exception.
Submitted by John Sterling <sterling@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92208 13f79535-47bb-0310-9956-ffa450edef68
2001-11-28 02:09:46 +00:00
Ryan Bloom
d70af2b3eb Fix the timeout logic that I broke last week. This adds a request
level filter that sets the timeout on the socket that is connected
to the client.

Thanks Greg Stein for seeing this bug.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92073 13f79535-47bb-0310-9956-ffa450edef68
2001-11-21 03:46:22 +00:00
Doug MacEachern
8c931b983f Prevent segv in ap_note_basic_auth_failure() when no AuthName is configured
PR:
Obtained from:
Submitted by:	John Sterling <sterling@covalent.net>
Reviewed by:	dougm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92072 13f79535-47bb-0310-9956-ffa450edef68
2001-11-21 03:19:13 +00:00
Ryan Bloom
0c05b625ac Begin to abstract out the underlying transport layer.
The first step is to remove the socket from the conn_rec,
the server now lives in a context that is passed to the
core's input and output filters. This forces us to be very
careful when adding calls that use the socket directly,
because the socket isn't available in most locations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
Doug MacEachern
4d8781b7c6 ap_getline() is useful to modules outside of the core..
change declaration from AP_CORE_DECLARE to AP_DECLARE so it can be used
used outside the core
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91778 13f79535-47bb-0310-9956-ffa450edef68
2001-11-07 05:41:22 +00:00
Greg Ames
e864d370bf change ap_getline to return the size of the buffer when there's no apparent end
to an input line.  This is more like the 1.3 behavior which should help the
callers recognize this condition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91714 13f79535-47bb-0310-9956-ffa450edef68
2001-10-31 21:14:23 +00:00
Jeff Trawick
a71e3b8b33 don't lose the return code from ap_fwrite() when called from buffer_output()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91649 13f79535-47bb-0310-9956-ffa450edef68
2001-10-23 20:43:57 +00:00
Justin Erenkrantz
2cb3776fae I believe it is a kosher for a filter to return EOS, but return APR_SUCCESS
via ap_get_brigade.  So, we should treat this as end-of-input.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91311 13f79535-47bb-0310-9956-ffa450edef68
2001-10-05 08:51:43 +00:00
Justin Erenkrantz
66ee5533d3 Remove the lameo create_req hack and delay the addition of the HTTP_IN
filter until after we have read the headers.  This eliminates the status
hack that was in http_protocol.c and makes it all around better.

server/protocol.c now directly adds HTTP_IN filter - should we create a
specific hook for this?  (Could we do this as a post_read_request hook?)
I'm not terribly sure, but let's move it down to the lowest possible
place in ap_read_request.  We can change this detail later as we see fit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91192 13f79535-47bb-0310-9956-ffa450edef68
2001-09-29 08:48:59 +00:00
Justin Erenkrantz
08eb7609da Input filtering rewrite. Consolidate how we handle HTTP input parsing by
rearranging and rethinking some things.  The net result is that the HTTP
filter is now a request filter and is now only responsible for HTTP things.
The core input filter is now responsible for handling all of the dirty work.

Highlights:
- Removes the dechunk filter and merges it with ap_http_filter (aka HTTP_IN).
  The dechunk filter was incorrectly handling certain cases (trailers).
- Moves ap_http_filter from a connection filter to a request filter
  to support the consolidation above (it needs header info).
- Change support code to allow the http_filter to be a
  request filter (how the request is setup initially).
- Move most of the logic from HTTP_IN to CORE_IN (core_input_filter).
  HTTP_IN is now only concerned about HTTP things.  The core filter
  is now responsible for returning data.  It is impossible to
  consolidate dechunk and http without this because HTTP_IN previously
  buffered data.  As Greg has suggested, it may make sense to write
  some brigade functions that handle input (getline).  It should be
  fairly trivial to add these.  Some of the calls in ap_http_filter
  could be switched as well.

This is the original patch as submitted to dev@httpd on Monday, Sep.
24th.  Additional comments and some minor tweaks done after that
submission are coming up next.  This should allow people who reviewed
the original patch to see what has changed and review them piecemeal.

This test passes all current tests in httpd-test.  Please perform
chicken sacrifices to verify that this hasn't blown up your favorite
input.

Reviewed by:	Greg Stein, Ryan Bloom, and Cliff Woolley (buckets)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91189 13f79535-47bb-0310-9956-ffa450edef68
2001-09-29 08:17:11 +00:00
Justin Erenkrantz
a8a56e00c5 Switch back to SIGUSR1 for graceful restarts on all platforms that
support it.  This defines a symbol called AP_SIG_GRACEFUL in
ap_config_auto.h which will have the appropriate signal value.  All
direct references to SIGWINCH have been replaced with AP_SIG_GRACEFUL.

On Linux 2.0, use SIGWINCH instead since SIGUSR1 is used by glibc
2.0's user-space threading library to control threads.  All later
versions of Linux/glibc don't have this problem.  (Not to mention the
security holes in older Linux versions which make it unsuitable for
use as a web server.)  If your platform doesn't have SIGUSR1, use the
appropriate mojo in configure to define what your graceful restart
signal should be.

In theory, a configure switch could be added to allow the admin to
specify the appropriate signal that should be used.  This is left
as an exercise to the reader for now.

The docs need to be updated.  Since the signal is now configurable,
just saying SIGUSR1 for graceful restart isn't completely true.  Also,
the apachectl functionality needs to be moved into httpd - this is
what Win32 does and it makes us consistent across platforms.

Roy issued a veto against use of SIGWINCH by default, so this should
resolve that veto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91076 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 22:13:59 +00:00
Ryan Bloom
cac07fa8d9 A very small optimization to the OLD_WRITE logic. This just makes us store
a pointer to the OLD_WRITE frec, and instead of using strcmp or strcasecmp,
we can just do a simple pointer comparison.  This optimization is also
available to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91006 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 18:38:21 +00:00
Justin Erenkrantz
4db33d47fd Fix breakage from Brian Pane's util_filter switch to hash tables.
There were some places that were expecting what you put into frec
would be what frec->name would be.  Not true anymore.

There are enough other places that were already doing the strcasecmp
that it makes more sense to just make it all strcasecmp across the
board rather than changing the UPPERCASE to lowercase.

(None of these with the exception of old_filter look to be in the
critical path anyway...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90890 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 07:59:55 +00:00
Brian Havard
3663a64d3c Make test for EAGAIN portable in content length filter. This fixes some
failures in CGIs on OS/2.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90394 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 10:56:44 +00:00
Doug MacEachern
2090fa8748 adjust to apr_uri_ rename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90361 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 16:01:05 +00:00
Ryan Bloom
923b7a1bdb We can't use a static buffer for this patch, because that wouldn't
be thread safe.
Submitted by:	Greg Marr <gregm@alum.wpi.edu>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90214 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 14:05:00 +00:00
Ryan Bloom
12aad48bed Fix ap_rvprintf to support more than 4K of data.
Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90189 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 05:04:39 +00:00
Ryan Bloom
556941bf1d Back out a patch that wasn't ready for inclusion. Thanks to OtherBill
for pointing out that this was committed when it shouldn't have been.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89990 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:40:25 +00:00
Ryan Bloom
cf2e6a1831 Remove all warnings from the input filtering stack.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89987 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 16:19:03 +00:00
Ryan Bloom
85e8fbd0e2 Add the ability to extend the methods that Apache understands
and have those methods <limit>able in the httpd.conf. It uses
the same bit mask/shifted offset as the original HTTP methods
such as M_GET or M_POST, but expands the total bits from an int to
an ap_int64_t to handle more bits for new request methods than
an int provides.
Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89869 13f79535-47bb-0310-9956-ffa450edef68
2001-08-02 04:25:20 +00:00
William A. Rowe Jr
c901f4e726 Coexist within the XHTML changes to http_protocol.c
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89780 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 04:38:02 +00:00
William A. Rowe Jr
10f9a8910c More obsessive changes to meet HTML 3.2, HTML 4.01 Transitional and
XHTML 1.0 Transitional


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89750 13f79535-47bb-0310-9956-ffa450edef68
2001-07-28 00:46:49 +00:00