Commit Graph

536 Commits

Author SHA1 Message Date
448c82bfd5 Simplify; this code is executed one per request processed, saving
an immeasurably small quantum of CPU of a server under load.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753223 13f79535-47bb-0310-9956-ffa450edef68
2016-07-18 13:41:26 +00:00
256e5cbdad Add 451... Needed to adjust RESPONSE_CODES which
was not in the provided patch
BUGZ# 58985

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730723 13f79535-47bb-0310-9956-ffa450edef68
2016-02-16 17:33:31 +00:00
25e83d29f4 Use 'ap_array_str_contains' to simplify code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1720996 13f79535-47bb-0310-9956-ffa450edef68
2015-12-20 08:34:59 +00:00
33d6aaf455 http, mod_ssl: Introduce and return the 421 (Misdirected Request) status code
for clients requesting a hostname on a reused connection whose SNI (from the
TLS handshake) does not match.
PR 5802.

This allows HTTP/2 clients to fall back to a new connection as per:
https://tools.ietf.org/html/rfc7540#section-9.1.2

Proposed by: Stefan Eissing <stefan eissing.org>
Reviewed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1685069 13f79535-47bb-0310-9956-ffa450edef68
2015-06-12 11:33:22 +00:00
09c4bc62d0 http: Add support for RFC2324/RFC7168.
Sample implementation: http://people.apache.org/~minfrin/mod_teapot.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1670594 13f79535-47bb-0310-9956-ffa450edef68
2015-04-01 10:03:56 +00:00
bcf652f6fc * Fix If-Match handling:
- We need to fail if we do NOT match.
  - ETag comparison only makes sense if we have an ETag

PR: 57358
Submitted by: Kunihiko Sakamoto <ksakamoto google.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1646282 13f79535-47bb-0310-9956-ffa450edef68
2014-12-17 15:39:15 +00:00
3b365793c1 fix logic in ap_method_list_(add|remove) in order:
- to correctly reset bits
       - not to modify the 'method_mask' bitfield unnecessarily

Also remove a useless 'register' in the declaration of a variable.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610813 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 19:09:06 +00:00
6f8dfb8ed9 Include any error notes set by modules in the canned error
response for 403 errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1609938 13f79535-47bb-0310-9956-ffa450edef68
2014-07-12 14:52:08 +00:00
6194962c46 core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
with weak validation combined with If-Range and Range headers. Break
out explicit conditional header checks to be useable elsewhere in the
server. Ensure weak validation RFC compliance in the byteranges filter.
Ensure RFC validation compliance when serving cached entities. PR 16142


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 13:42:31 +00:00
997e0f6d33 core: Add the ability to do explicit matching on weak and strong ETags
as per RFC2616 Section 13.3.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479528 13f79535-47bb-0310-9956-ffa450edef68
2013-05-06 11:41:10 +00:00
8c960a8c15 Various code clean up
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52893 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361801 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:14:00 +00:00
bfbbc819d5 Add missing HTTP status codes taken from
http://www.iana.org/assignments/http-status-codes/http-status-codes.xml 

The new codes are now known and some canned error
strings are provided. The web server does not yet actually
produce them in responses or reacts on getting them
from an origin server when acting as a proxy or gateway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361784 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 20:22:03 +00:00
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
c45e14b246 refactor to pull setting of Accept-Ranges header into http_protocol.c which
had been copied to other handlers.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166663 13f79535-47bb-0310-9956-ffa450edef68
2011-09-08 12:56:08 +00:00
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
e614b24dae Reverted r1040177 due to Joe's objection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1041905 13f79535-47bb-0310-9956-ffa450edef68
2010-12-03 16:56:57 +00:00
0ec3771d37 Supress compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040177 13f79535-47bb-0310-9956-ffa450edef68
2010-11-29 16:37:49 +00:00
21195ea61f Phrasing changes recommended by Jack Dozier. Bug #50145
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026792 13f79535-47bb-0310-9956-ffa450edef68
2010-10-24 13:24:31 +00:00
10916d6d51 Take a slightly less "you broke it!!" tone in the default 500 Internal
Server Error default error message. (Bug #50145)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026473 13f79535-47bb-0310-9956-ffa450edef68
2010-10-22 20:03:22 +00:00
ec0051094a Move AddOutputFilterByType implementation from core to mod_filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966869 13f79535-47bb-0310-9956-ffa450edef68
2010-07-22 21:54:39 +00:00
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
33b33d1987 Don't keepalive when we send a non-100 response while Client is expecting 100
and may be feeding us continuation data.
PR 47087


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@888310 13f79535-47bb-0310-9956-ffa450edef68
2009-12-08 10:22:56 +00:00
19831adabc * Add missing , to make it compile again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814114 13f79535-47bb-0310-9956-ffa450edef68
2009-09-12 07:59:31 +00:00
6a92828171 Catch the somewhat absurd combination of a 417 error where no Expect header
was present.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@814048 13f79535-47bb-0310-9956-ffa450edef68
2009-09-11 21:55:46 +00:00
b949658d4d axe ancient platform checks
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759682 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 13:59:07 +00:00
35cb986356 Improve canned 504 error message in the light of r729586 and covener's comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@732504 13f79535-47bb-0310-9956-ffa450edef68
2009-01-07 21:28:36 +00:00
51df5d37cb Make %k work as it should. No regression noted in perl
test framework.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@720250 13f79535-47bb-0310-9956-ffa450edef68
2008-11-24 18:33:09 +00:00
a927ddd766 * Fix compiler warning (missing sentinel in function call).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693224 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 19:50:40 +00:00
bdb2ae4326 Relax checks on HTTP Response status line from a backend.
PR#44995 - Rainer Jung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693108 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 14:20:11 +00:00
71da0a5106 * modules/http/http_protocol.c (is_mpm_running): Fix warning with
gcc -Wall.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645497 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 13:14:37 +00:00
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
064a1ffbff Remove calls to ap_graceful_stop_signalled, and replace by using ap_mpm_query
to determine if the MPM is trying to stop the process.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645434 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 09:53:58 +00:00
037475eaf9 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)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@603346 13f79535-47bb-0310-9956-ffa450edef68
2007-12-11 20:08:12 +00:00
e95d52f53f 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>




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600645 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 19:45:48 +00:00
22d8e0d8ba 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@594839 13f79535-47bb-0310-9956-ffa450edef68
2007-11-14 11:53:30 +00:00
649da913ef * Revert r561352 as this breaks authentication completely.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@580297 13f79535-47bb-0310-9956-ffa450edef68
2007-09-28 11:03:29 +00:00
63cd255945 this appears to be a "mv" rather than a "swap", so we should be able to
simplify & shave off a couple of cycles. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@561352 13f79535-47bb-0310-9956-ffa450edef68
2007-07-31 14:54:46 +00:00
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
50376d16bd Thiago Zaninotti reported to security@apache.org on 20060410 a possible
cross-site scripting flaw because the Expect header error message isn't
escaped.  We couldn't find a way that this could be used by an attacker
however, as they can't influence the Expect header a victim will send to a
target site.  Thiago agreed and we're therefore not treating this as a
security flaw, but it is a bug that ought to get fixed.  I'll add to 
STATUS for 1.3/2.0/2.2 shortly for acks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@394965 13f79535-47bb-0310-9956-ffa450edef68
2006-04-18 15:30:13 +00:00
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
d90cbe8650 Plug AllowTrace extended|on|off into proxy and http core.
It still is not 'correct' until REQUEST_CHUNKED_PASS is reimplemented
  and passes some chunk headers, since we aren't echoing the entire
  request.  But it gets me further on testing 1.3 -> 2.0 -> 2.1 -> 2.0 -> 1.3
  proxy behaviors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@208787 13f79535-47bb-0310-9956-ffa450edef68
2005-07-01 19:59:59 +00:00
7ae218a5bf Support the suppress-error-charset setting, as with Apache 1.3.x.
With Apache 1.3.x, it is a bit simpler as the request does
not go through ap_make_content_type().

Modules can set custom error responses but not be able to
set the charset, so they have to code the charset in the
html.  Thus, it is useful to preserve 1.3.x behavior exactly.

PR: 26467


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170354 13f79535-47bb-0310-9956-ffa450edef68
2005-05-16 10:41:42 +00:00
af9ae7c2d7 Remove ap_method_list_do and ap_method_list_vdo as previously mentioned dev@httpd.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@164536 13f79535-47bb-0310-9956-ffa450edef68
2005-04-25 05:19:18 +00:00
9e2046178c More tweaks primarily driven by caching.
* modules/http/http_protocol.c

  (ap_meets_conditions): Allow If-None-Modified and If-Modified-Since
   to interact as described in RFC2616, sections 14.26 and 13.3.4.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153270 13f79535-47bb-0310-9956-ffa450edef68
2005-02-10 15:41:23 +00:00
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
78c1d9dc3e undo changes made in 111386 due to veto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111432 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 21:09:26 +00:00
fe1bfd7775 add response code 226 constant (HTTP_IM_USED) and status
line ("226 IM Used").  PR 31128.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111386 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 14:16:16 +00:00
439221058c Initial pass at refactoring some files to eliminate our 150K C source behemoths.
* Makefile.in: Change order of dependencies to bring in exports.o first so that
  we have every symbol 'used' before the linker starts processing.
* build/rules.mk.in: Add a 'program-install' target which just copies httpd.

* server/Makefile.in, modules/http/config2.m4: Add in new file targets.

* NWGNUmakefile, libhttpd.dsp: Blind updates for Netware and Win32.  (I tried.)

* server/core.c: Move core_input_filter, net_time_filter, and core_output_filter  and all supporting functions to...
* server/core_filters.c (copied): ...here.

* modules/http/http_protocol.c: Move functions from here to there...namely:
* modules/http/byterange_filter.c (copied): Relocate ap_byterange_filter() and
  friends.
* modules/http/chunk_filter.c (copied): Relocate chunk_filter().
* modules/http/http_etag.c (copied): Relocate ap_set_etag and ap_make_etag().
* modules/http/http_filters.c (copied): Relocate ap_http_filter(),
  ap_http_header_filter(), ap_discard_request_body(), ap_setup_client_block(),
  ap_should_client_block(), and ap_get_client_block().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106692 13f79535-47bb-0310-9956-ffa450edef68
2004-11-27 08:07:44 +00:00