with this and a request line that goes on forever, I now get:
[Wed Oct 31 17:45:45 2001] [error] [client 127.0.0.1] request failed:
URI too long
...in the error log, and a 414 in the access log.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91715 13f79535-47bb-0310-9956-ffa450edef68
looks like the line may never end.
This lets ap_getline determine whether there's excessive bytes or not,
depending on the size of its caller's buffers. If the buffer can accomodate
more bytes, ap_getline will continue to read.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91713 13f79535-47bb-0310-9956-ffa450edef68
The core input filter would happily consume all the data you gave it
in a header line, looking for that one LF. This patch limits that
"getline" functionality to HUGE_STRING_LEN (8192 bytes).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91711 13f79535-47bb-0310-9956-ffa450edef68
was that we forgot to check whether ctx->bb was empty, so when we pulled the
first bucket, it would be the sentinel, and we'd segfault trying to apr_bucket_read
the sentinel.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91641 13f79535-47bb-0310-9956-ffa450edef68
memcpy'ed the base into the merged per-dir config.
This certainly cleans up that function though, and I hope increases
it's legibility.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91624 13f79535-47bb-0310-9956-ffa450edef68
server. This change adds an optional hook, which allows modules
to gain control while the request is created if the proxy module
is loaded. The purpose of this hook is to allow modules to add
input and/or output filters to the request to the origin. While
I was at it, I made the core use this hook, so that proxy request
creation uses some of the code from the core. This can still be
greatly improved, but this is a good start.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91486 13f79535-47bb-0310-9956-ffa450edef68
of our brigade - which are in isolation okay. In this situation, they
must be removed by the call to APR_BRIGADE_NORMALIZE.
The way we partition the buckets means that we will never remove the
zero-length bucket from the head - causing an infinite loop. We read only
a single bucket now - previously partition with the blocking reads would
read multiple buckets - but it forced having a defined length which we
agreed was bogus.
Therefore, if we have a zero-length bucket at the head, we would then try
to partition and split at the zero-point of the brigade. That combination
doesn't actually remove the zero-length bucket - it is still there - causing
an infinite loop because we'll never go past the zero-length bucket.
This call was originally present in core_input_filter. I think it might
be better to fix partition/split/etc to eliminate a zero-length bucket
and skip it. But, I'm not 100% sure that needs to happen.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91412 13f79535-47bb-0310-9956-ffa450edef68
If the status code is anything other than SUCCESS for PEEK, it isn't
good. Just return the value.
(I thought it should be this, but I wasn't 100% sure. Peer review == good.)
Submitted by: Will Rowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91404 13f79535-47bb-0310-9956-ffa450edef68
Return with APR_EOF if we get EAGAIN.
(Whomever is calling this with PEEK should really be able to handle EOS
bucket rather than relying on error codes.)
Thanks to Greg Ames for pointing out this fubar.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91403 13f79535-47bb-0310-9956-ffa450edef68
(blocking or not).
apr_brigade_partition would do reading multiple times and that's
not really what we want (so I think).
This may speed up POST requests that were waiting for all of the
data to arrive before returning anything in blocking mode.
Reviewed by: Greg Stein, Ryan Bloom
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91322 13f79535-47bb-0310-9956-ffa450edef68
finite number of bytes (i.e. *readbytes > 0).
ap_brigade_partition does a blocking read. So, what we should do is
apr_bucket_read on the socket for non-blocking. If we get less than
what they asked for, that's okay and we should just return that amount.
If they were non-blocking, we should always be non-blocking.
Ryan, Greg, and others can figure out if ap_brigade_partition should
be tweaked to handle AP_NONBLOCK_READ natively. I'm of a mixed mind,
but this addresses the short term need.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91312 13f79535-47bb-0310-9956-ffa450edef68
is now a required directive, which tells Apache what port to
listen on. The ServerName directive has also been extended
to accept an optional port. If the port is specified to the
ServerName, the server will report that port whenever it
reports the port that it is listening on. This change was
made to ease configuration errors that stem from having a Port
directive, and a Listen directive. In that situation, the server
would only listen to the port specified by the Listen command,
which caused a lot of confusion to users.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91293 13f79535-47bb-0310-9956-ffa450edef68
- Clean up scopes and namings of certain variables
- Add comments about potentially bogus modes
- Consolidate a FOREACH loop into a single brigade_length call
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91191 13f79535-47bb-0310-9956-ffa450edef68
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
strings to numbers in places where the methods are known at compile
time.
(Justin fixed the va_end() call to be correct.)
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Justin Erenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91078 13f79535-47bb-0310-9956-ffa450edef68
roll build_command_line/build_argv_list into a unified, overrideable
ap_cgi_build_command optional function.
Eliminates a ton of Win32 cruft from core.c for registry parsing.
Win32 (through the default handler, and newest changes to the
apr_proc_create fn) continues to serve .bat/.exe files. This is in
preparation for adding modules/arch/win32/mod_win32 for scripts.
Please review the mod_cgi.c behavior very carefully.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91058 13f79535-47bb-0310-9956-ffa450edef68
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
us going again for a while.
We are currently rejecting some internal file_sub_req()'s in the
translate phase. I don't like this hack because of risks it potentially
exposes, but for today, if we have a filename - and we are a subrequest,
then let it fly without further mapping. This allows us to serve up
the default "/" request (run through mod_dir->mod_negotiation->mod_mime)
without a 400 error. The right solution is to set up some traps and
escapes for the subreq mechanism, possibly with a subreq translate hook,
and drop the URI entirely for these cases.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90847 13f79535-47bb-0310-9956-ffa450edef68
out on the old Set{Input|Output}Filter onefilter twofilter syntax
(prior to this patch, only the last filter in a space seperated list
would be configured.)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90813 13f79535-47bb-0310-9956-ffa450edef68
tiny apr_pstrdup() calls and your machine crashes) when you
have a filter chain
ap_getword() returns an empty string, not a NULL string,
when there are no more words
fix a segfault when you don't have a filter chain
ap_getword() does not check for a NULL string to search
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90810 13f79535-47bb-0310-9956-ffa450edef68
must be semicolon delimited (if more than one filter is given.)
The Set{Input|Output}Filter directive now overrides a parent
container's directive (e.g. SetInputFilter in <Directory /web/foo>
will override any SetInputFilter directive in <Directory /web>.)
This new syntax is more consistent with Add{Input|Output}Filter
directives defined in mod_mime. Also cures a bug in prior releases
where the Set{Input|Output}Filter directive would corrupt the
global configuration if the multiple directives were nested.
[William Rowe]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90799 13f79535-47bb-0310-9956-ffa450edef68
introduce the ForceType and SetHandler [absolute references] directly
into the very top of the fixups phase. This means these will always
override _any_ mime module, not just mod_mime. Ergo, other mime modules
can continue to set charset, encodings, etc. Since these are globals,
they belong in the core.
This highlights a very serious drawback to the type_checker hook. By
using run first, a module that identifies _partial_ information (maybe
just the content type) won't pass the query on to other modules, like
mod_mime, that might further define the encoding or charset. The
type_checker hook should clearly become a run-all, and the modules should
decline if they see someone ahead of them answered a question they were
going to try to figure.
Which means - if type_checker becomes RUN_ALL - this new override hook
fn should become a type_checker again - and RUN_REALLY_FIRST, and let
other modules _choose_ not to override this election. (We can run it
again at the end, for a recount ;) Votes?
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90797 13f79535-47bb-0310-9956-ffa450edef68
(and now AddInputFilter and AddOutputFilter by extension) so this seems
entirely appropriate in the core as well. Options FileInfo is required
to change the processing behavior of files.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90760 13f79535-47bb-0310-9956-ffa450edef68
keepalive requests. We were allocating a brigade out of the
connection pool; the number of these brigades allocated
per connection was theoretically unlimited.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90736 13f79535-47bb-0310-9956-ffa450edef68
ap_directory_walk() phase. Modules that want to use special
walk logic should refer to the mod_proxy map_to_location example,
with it's proxy_walk and proxysection implementation. This makes
either directory_walk flavor much more legible, since that phase
only runs against real <Directory > blocks.
On a technical note, this patch also forces the Directory to be
canonical (unless it is "/" or a regex.) It also allows us to
be more explicit when declaring <Directory > block errors.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90684 13f79535-47bb-0310-9956-ffa450edef68
the directory_walk and file_walk for non-file requests. TRACE
shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.
A seperate patch to mod_proxy is required to short circuit both the
TRACE and directory_walk/file_walk stuff. That patch is next.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90665 13f79535-47bb-0310-9956-ffa450edef68
out the last patch before I rearranged this to be _readable_.
Next step for everyone's sanity, provide <Proxy > directives ;)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90646 13f79535-47bb-0310-9956-ffa450edef68
This patch does one thing, it changes the root path "/" to reflect an
element count of Zero (0). directory_walk will always accept the zero
element (which sorts first, thankfully) on it's first go around.
So, Unix will accept "/" when it's parsing it's first element "/".
Dos/Win32 will accept "/" and "C:/" when they parse their first element,
"C:/". The root sorted first, so it behaves as users expect.
The syntax "//" or "//machine" will be depreciated for now, the user
needs to set up the extact "//machine/share/" that they want served
on Win32.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90644 13f79535-47bb-0310-9956-ffa450edef68
URI does not go above the DocumentRoot (as defined by the OS, not by
the URI specification), and give us the true name.
When we are done, note the name is canonical for directory_walk.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90593 13f79535-47bb-0310-9956-ffa450edef68
Therefore we will canonicalize it when it doesn't match filename.
The next optimization should take the path common to canonical_filename
and filename, and start merging filename from there for canonicalization.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90591 13f79535-47bb-0310-9956-ffa450edef68
MPMs use the same functions for all common MPM directives. This
should make it easier to catch all bugs in these directives once.
Everybody should check their favorite MPM to ensure that it still
compiles, and that these directives work. This is a big patch, and
although it looks good, and things compiled for me, that is no
garauntee that it will work on all platforms. :-)
Submitted by: Cody Sherr <csherr@covalent.net>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90132 13f79535-47bb-0310-9956-ffa450edef68