CGI: return 504 (Gateway timeout) rather than 500 when a script
times out before returning status line/headers.
PR 42190
Improve canned 504 error message in the light of r729586 and covener's comment.
Submitted by: niq
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@733757 13f79535-47bb-0310-9956-ffa450edef68
* Avoid sending no answer at all if a custom error page causes an
AP_FILTER_ERROR.
* allow ap_invoke_handler() to pass-through AP_FILTER_ERROR as if it were
a reserved status code (OK/DECLINED/SUSPENDED). Prevents ap_die() from seeing a
500 error when the http header filter has already taken care of the proper
error response
* To be safe, consume the entire brigade after processing an error bucket in
the HTTP output filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@722642 13f79535-47bb-0310-9956-ffa450edef68
* mod_proxy_http.c
Ensure that the EOC bucket is inserted BEFORE an EOS bucket in bb as
some resource filters like mod_deflate pass everything up to the EOS
down the chain immediately and sent the remainder of the brigade later
(or even never). But in this case the ap_http_header_filter does not
get out of our way soon enough.
http_filters.c
Remove all data buckets that are in a brigade after an EOC bucket
was seen, as an EOC bucket tells us that no (further) resource
and protocol data should go out to the client. OTOH meta buckets
are still welcome as they might trigger needed actions down in
the chain (e.g. in network filters like SSL).
Remark 1: It is needed to dump ALL data buckets in the brigade
since an filter in between might have inserted data
buckets BEFORE the EOC bucket sent by the original
sender and we do NOT want this data to be sent.
Remark 2: Dumping all data buckets here does not necessarily mean
that no further data is send to the client as:
1. Network filters like SSL can still be triggered via
meta buckets to talk with the client e.g. for a
clean shutdown.
2. There could be still data that was buffered before
down in the chain that gets flushed by a FLUSH or an
EOS bucket.
PR: 37770
Submitted by: rpluem
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660936 13f79535-47bb-0310-9956-ffa450edef68
The response to the TRACE method is partially garbled on an EBCDIC platform.
Send the request line and trailing CRLF in ASCII.
Submitted by: David Jones <oscaremma gmail.com>
Reviewed and tested by: gregames
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660728 13f79535-47bb-0310-9956-ffa450edef68
* In the case that we fail to read the response line from the backend and if
we are a reverse proxy request shutdown the connection WITHOUT ANY response
to trigger a retry by the client if allowed (as for idempotent requests).
BUT currently we should not do this if the request is the first request on
a keepalive connection as browsers like seamonkey only display an empty page
in this case and do not do a retry.
Related to PR 37770
Submitted by: rpluem
Reviewed by: rpluem, jim, fielding
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@657443 13f79535-47bb-0310-9956-ffa450edef68
* Fix cases with non blocking reads from the ap_http_filter input filter where
chunk size lines or empty lines after a chunk are read incomplete. This can
lead to a corruption inside the dechunking algorithm.
This patch has an issue with larger chunk-extensions which need to get thrown
away since we ignore them anyway.
PR: 19954, 41056
Tested by: niq
* Optimize solution from r609394 and remove chunk-extensions restriction that
was in r609394.
* Optimize alignment.
Submitted by: rpluem
Reviewed by: rpluem, jim, niq
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@610119 13f79535-47bb-0310-9956-ffa450edef68
http_protocol: Escape request method in 405 error reporting.
This has no security impact since the browser cannot be tricked
into sending arbitrary method strings.
(words from jorton)
Submitted by: trawick
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@604192 13f79535-47bb-0310-9956-ffa450edef68
* Apply patch for PR 41056 (19954) to fix chunk
filter. Now flushes work better.
* Protect against any sort of non-block read that
would block. If ap_get_brigade() shows that, return
EAGAIN.
* Further refinement for PR41056 / PR 19954 (mostly-fixed in r480135.)
We assume that a successful read but an empty brigade
is NOT cause for EAGAIN. Testing may or may not
confirm this assumption, in which case that test
may be required as well.
* If no data is available at this point of time we need to switch into the
BODY_CHUNK_PART state like we do several lines later in the code in the
same situation.
* Case statements should go on their own line. (No functional change.)
* modules/http/http_filters.c
(ap_http_filter): Put case on its own line.
* Add missing Changelog entry for PR41056 / PR 19954. This was fixed in r480135.
PR: 41056 / 19954
Submitted by: jfclere, jim
Reviewed by: rpluem, jim, jerenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602679 13f79535-47bb-0310-9956-ffa450edef68
Generate etags consistently across 32-bit and 64-bit platforms:
* modules/http/http_etag.c (etag_uint64_to_hex): Renamed from
etag_ulong_to_hex; take an apr_uint64_t argument.
(ap_make_etag): Adjust to use new function and macro names.
Pass arguments directly to etag_uint64_to_hex without casting
down to unsigned long.
* modules/http/http_etag.c (etag_uint64_to_hex): Fix maximum shift
size, thanks to Ruediger.
PR: 40064
Submitted by: jorton
Reviewed by: rpluem, jim, niq
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602503 13f79535-47bb-0310-9956-ffa450edef68
http_protocol: Escape request method in 413 error reporting.
Determined to be not generally exploitable, but a flaw in any case.
PR: 44014
Submitted by: Victor Stinner <victor.stinner inl.fr>
Submitted by: wrowe
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@602473 13f79535-47bb-0310-9956-ffa450edef68
core: Avoid some unexpected connection closes by telling the client
that the connection is not persistent if the MPM process handling
the request is already exiting when the response header is built.
Submitted by: trawick
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@596677 13f79535-47bb-0310-9956-ffa450edef68
Return METHOD_NOT_ALLOWED, not FORBIDDEN, to a TRACE request when
TraceEnable is Off. This agrees with our documentation, and with
our Allow: header in response to OPTIONS.
Submitted by: niq
Reviewed by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@576514 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
*) The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description().
Reviewed by: rpluem, jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@446606 13f79535-47bb-0310-9956-ffa450edef68
* Add optional 'scheme://' prefix to ServerName directive. For
'https', mod_http returns "https" for the ap_hook_http_scheme and
DEFAULT_HTTPS_PORT for ap_hook_default_port. This fixes Redirect
responses to requests for directories without a trailing slash
when httpd runs behind a proxy or offload device that processes
SSL. It also enables support for Subversion in that
configuration. This change is completely backwards compatible
and passes the perl-framework. Minor mmn bump because I add a
field to server_rec.
* Document r399947, addition of optional scheme:// to ServerName directive
PR: 33398
Submitted by: sctemme
Reviewed by: sctemme, rpluem, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@425051 13f79535-47bb-0310-9956-ffa450edef68
of switching linkers from the x86 (default linker) to x64 or other
possible target platforms. (Also this commit cleans up lingering
/GX switches from the 'BASE' options that are supposed to be unused.)
Backports: 397407
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@397649 13f79535-47bb-0310-9956-ffa450edef68
win32 builders, eliminate platform-specific use of 'awk' to create
our .rc resources. (Deliberately waited until a clean 2.2.2 was
pulled from the branch.) The end goal is to make building simpler
for our 'free' VisualStudio 2005 Express users, to encourage more
end users to explore the source code. Eliminating thousands of
lines of build-script is a nice side effect.
Backports: 395418
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@396974 13f79535-47bb-0310-9956-ffa450edef68
Reviewed by all active win32 contributors, and committed as an arch
maintenance fix. This permits Win32 VisualStudio 2005 users to build
httpd without extranious 'deprectated option' emits.
Reviewed by: wrowe, colm
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@395961 13f79535-47bb-0310-9956-ffa450edef68
* Fix ap_http_chunk_filter to create correct chunks in the case that a
flush bucket is pre- and postfixed by data buckets in the brigade.
Submitted by: Ruediger Pluem
Reviewed by: Justin Erenkrantz, Joe Orton, Jim Jagielski
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@357456 13f79535-47bb-0310-9956-ffa450edef68