* Save the key we generate during our first run of cache_generate_key_default
on each request in the request_config. During consecutive runs of
cache_generate_key_default during processing the request we restore it
from there as we might not be able to generate the same key again as
the ingredients used to compose the key might have changed and we constantly
must use a key that could be generated during the quick handler phase.
PR: 41475
Submitted by: rpluem
Reviewed by: rpluem, jerenkrantz, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@539112 13f79535-47bb-0310-9956-ffa450edef68
* Add CacheIgnoreQueryString directive to cache requests with a query string
even if no expiration time is specified. Futhermore the query string will not
be used for key generation such that requests to the same URI path, but with
different query strings are mapped to the same cache entity. Turning this
setting to ON violates RFC 2616/13.9 and thus it is turned off by default.
PR: 41484
Submitted by: Fredrik Widlund <fredrik.widlund qbrick.com>
Reviewed by: rpluem, jerenkrantz, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@539111 13f79535-47bb-0310-9956-ffa450edef68
* Remove all filters that are before the cache_out filter. This ensures
that we kick off the filter stack with our cache_out filter being the
first in the chain. This make sense because we want to restore things
in the same manner as we saved them.
There may be filters before our cache_out filter, because
1. We call ap_set_content_type during cache_select. This causes
Content-Type specific filters to be added.
2. We call the insert_filter hook. This causes filters e.g. like
the ones set with SetOutputFilter to be added.
PR: 40090
Submitted by: rpluem
Reviewed by: rpluem, wrowe, jerenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@538868 13f79535-47bb-0310-9956-ffa450edef68
Add alternate is_socket_connected by using APR functions.
Submitted by: mturk
Reviewed by: jim
Merge r535354 from trunk:
Abstract out (kinda) MSG_PEEK. This way when we
actually update APR and apr_socket_recvfrom()
to know about APR_MSG_OOB, APR_MSG_PEEK, etc...
this code won't need to be adjusted. Also,
make nicer for 2.2 backport.
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@536291 13f79535-47bb-0310-9956-ffa450edef68
* Use the query string stored in r->parsed_uri.query instead of r->args
as r->args could have been changed (e.g. via mod_rewrite) after the quick
handler hook. This causes resources to be stored under a key, where they
cannot be fetched again in the quick handler.
PR: 40805
Submitted by: rpluem
Reviewed by: rpluem, jim, sctemme
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@535903 13f79535-47bb-0310-9956-ffa450edef68
HTTP proxy ProxyErrorOverride: Leave 1xx and 3xx responses alone. Only
processing of error responses (4xx, 5xx) will be altered.
PR: 39245
This is based on a patch submitted by Bart van der Schans <schans hippo.nl>
and tweaked slightly by me based on discussions on dev@ since April 2006.
I think rpleum was the first to mention the 1xx issue.
Submitted by: trawick
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@534068 13f79535-47bb-0310-9956-ffa450edef68
* mod_ssl: Move thread locking upcall initialization before
hardware library initialization, so hardware library can use
these upcalls when run in a threaded MPM. Fixes PR 20951.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@534062 13f79535-47bb-0310-9956-ffa450edef68
* Handle request bodies larger than 2 GB by converting the Content-Length
header string of the request correctly to apr_off_t.
PR: 40883
Submitted by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@509665 13f79535-47bb-0310-9956-ffa450edef68
(Studio 2005, 'free' Express or full edition) command line builds.
Backports 495126, adjusted for debugging/debug path change between
trunk and 2.2 branch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@495130 13f79535-47bb-0310-9956-ffa450edef68
Where any response is sent, return OK from the handler. Where there
is no response (but a status code) return the code. This patch adds
a great number of debugging emits for failed ap_pass_brigade calls,
to help diagnose failure cases, and disambiguates OK from APR_SUCCESS.
PR: 40470
Submitted by: wrowe, Matt Eaton <asf divinehawk.com>
Backports: 492333
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@493275 13f79535-47bb-0310-9956-ffa450edef68
* Isolate the unlock return vals
* Log when the lock fails.
* Failure to unlock is very nasty, so log it to help with troubleshooting.
Submitted by: jim
Reviewed by: jim, rpluem, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@488822 13f79535-47bb-0310-9956-ffa450edef68
r426791, r426793, r426795, r416165, r426799, r475403, r475406, r475915,
r475920, r475922, r476600, r437668 from trunk, which makes mod_deflate.c the
same as r483597 from trunk:
All comments to these changes for the sake of completeness:
* Fix wrong FLUSH bucket handling in deflate_out_filter: Actually the internal
structures of libz never got flushed as ctx->stream.avail_in is always zero
here. As the EOS and the FLUSH bucket case use the same code for flushing
libz's internal buffers move this code to the new function flush_zlib_buffer.
* Fix potential memory leaks in deflate_out_filter if bailing out due to an
error (either in the lower filter chain or during a libz operation). We need
to call deflateEnd as it is very likely that this filter is never called
again to ensures that libz's internal structures get cleaned properly.
* Remove ourselves from the filter chain if we failed to init libz, as we
pass data down the filter chain uncompressed afterwards.
* In preparation of the changes of the inflate out filter:
- rename flush_zlib_buffer to flush_libz_buffer (this name seems
better)
- add a parameter to tell flush_libz_buffer whether it should
deflate or inflate as this function should be also used for the
inflate out filter.
* This shortcut is too short. It is not up to the filters to decide
whether filters down the chain can do something useful with this empty
brigade.
* Initialize zRC to avoid a compiler warning.
* Rather use a pool cleanup function than calling deflateEnd before every
return from function to ensure that libz's internals get cleaned up.
* Add parameter crc to flush_libz_buffer in order to call the libz's crc32
function on the output buffer if needed. This is actually needed by the
later rework of the inflate out filter.
* Use a define for the number of validation bytes (CRC and length) after the
compressed data
* We can ignore Z_BUF_ERROR in flush_libz_buffer because:
When we call libz_func we can assume that
- avail_in is zero (due to the surrounding code that calls
flush_libz_buffer)
- avail_out is non zero due to the fact that we just emptied
the output buffer and stored it into a brigade
So the only reason for Z_BUF_ERROR is that the internal libz
buffers are now empty and thus we called libz_func one time
too often. This does not hurt. It simply says that we are done.
* some optimizations taken from the inflate out filter
* Remove bogus code that chokes on flush buckets
* Rework inflate out filter and give it a similar workflow as the deflate out
filter. This fixes the following bugs in the inflate out filter:
- Incorrect handling of flush buckets.
- Excessive memory usage for large compressed content (because we now
already sent parts down the chain and do not process the whole brigade
first before sending something down the chain).
- Handle the case correctly where the validation bytes at the end of
the compressed data stream are distributed across different buckets /
brigades.
- Fix a memory leak due to not cleaning up the internal structures of
libz in some error cases.
* Ensure that we do not try to inflate validation data or garbage data. None
of this is zlib's business.
* Ensure that we do not perform our final operations twice if a second EOS
falls down the chain by accident. Otherwise we are likely to run in a
SEGFAULT. So remove ourselves from the chain.
* Actually append new data to the validation buffer and do not overwrite old
data already there by setting the correct offset for the target buffer.
* Also log the presence of garbage data at the end of the stream if all
validation data is available in the first round.
* Housekeeping: keep track of size even in the edge-case where validation
bytes trickle in over multiple buckets.
PR: 39854
Reviewed by: rpluem, niq, jerenkrantz, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@488817 13f79535-47bb-0310-9956-ffa450edef68
So I'm sitting in Rich's talk and think to myself, it's kind
of stupid that DumpIO always logs at Debug, esp when
you consider that it's likely you'll be doing so
in conjunction with SSL... One Big Log is understating
it! :)
Add DumpIOLogLevel to allow one to change the level...
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@486656 13f79535-47bb-0310-9956-ffa450edef68
(1) Key connection pools to virtualhosts (niq, minfrin; reviewed us + wrowe)
(2) share per-request database handles across subrequests (chrisd; reviewed
niq + rpluem). Including fixing compiler warning (rpluem).
More to come on mod_dbd
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@485053 13f79535-47bb-0310-9956-ffa450edef68
Better detection and clean up of ldap connection that have been
terminated by the ldap server. PR#40878
Submitted by: Rob Baily <rbaily servicebench com>
Reviewed by: bnicholes
Submitted by: bnicholes
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@484981 13f79535-47bb-0310-9956-ffa450edef68
mod_authnz_ldap: Add an AuthLDAPRemoteUserAttribute directive. If
set, REMOTE_USER will be set to this attribute, rather than the
username supplied by the user. Useful for example when you want users
to log in using an email address, but need to supply a userid instead
to the backend.
Submitted by: minfrin
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@484638 13f79535-47bb-0310-9956-ffa450edef68
PR 40470 points out that we no longer handle ate == headlen, where
there is a headers-only response from the isapi app to the server.
This patch restores the previous behavior of pending those headers
until some amount of body response is ready to be sent to the client.
Backports: 483613
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@483614 13f79535-47bb-0310-9956-ffa450edef68
* Add the following environment variables to expose the information
* about
the route, the sticky session and the worker used during a request to
other modules:
BALANCER_SESSION_STICKY
BALANCER_SESSION_ROUTE
BALANCER_NAME
BALANCER_WORKER_NAME
BALANCER_WORKER_ROUTE
PR: 39806
Submitted by: Brian <brectanu gmail.com>
Reviewed by: rpluem
fix validation error
* Set the new environment variable BALANCER_ROUTE_CHANGED if a worker with a
route different from the one supplied by the client had been chosen or if
the client supplied no routing information for a balancer with sticky
sessions.
* mod_proxy_balancer: Document BALANCER_ROUTE_CHANGED environment variable.
Submitted by: Brian Rectanus <brectanu gmail.com>
Reviewed by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@472114 13f79535-47bb-0310-9956-ffa450edef68
* Extract stickysession information correctly in the case that it is given
as parameter like in the following example:
www.someplace.com/somewhere/?jsessionid=gggfgdufdfoef.server¶meter=value
So far we were only able to handle stickysession information encoded in the
following form:
www.someplace.com/somewhere/;jsessionid=gggfgdufdfoef.server?parameter=value
PR: 40400
Submitted by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@472100 13f79535-47bb-0310-9956-ffa450edef68
otherwise mod_cache will always try to cache the URL. This bug
might lead to numerous rename() errors on win32 if the URL was
previously cached.
+1: minfrin, rpluem, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@463496 13f79535-47bb-0310-9956-ffa450edef68