1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

667 Commits

Author SHA1 Message Date
Joe Orton
2ce86aa6ee * modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
Don't send an EOS after an interim response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159671 13f79535-47bb-0310-9956-ffa450edef68
2005-04-01 09:30:01 +00:00
Sander Striker
f3886551fa * modules/proxy/mod_proxy_http.c
(ap_proxy_http_process_response): Fix a comment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159534 13f79535-47bb-0310-9956-ffa450edef68
2005-03-30 23:09:32 +00:00
Sander Striker
1073345b0f * modules/proxy/mod_proxy_http.c
(ap_proxy_http_process_response): When there are only headers and no body,
   give the remainder of the output filters a chance by pushing an EOS bucket
   through the filter stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159533 13f79535-47bb-0310-9956-ffa450edef68
2005-03-30 22:58:08 +00:00
Justin Erenkrantz
8bc56b5d29 mod_proxy: Add proxy-sendextracrlf option to send an extra CRLF at the
end of the request body to work with really old HTTP servers.

* modules/proxy/mod_proxy_http.c
  (stream_reqbody_cl, spool_reqbody_cl): If proxy-sendextracrlf option is
  present, append a CRLF to the body stream that isn't counted against CL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@157478 13f79535-47bb-0310-9956-ffa450edef68
2005-03-14 22:22:58 +00:00
Joe Orton
119d90c9bc * modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response): Fix
spurious error at EOF.

PR: 33615


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@155209 13f79535-47bb-0310-9956-ffa450edef68
2005-02-24 16:52:34 +00:00
Paul Querna
09f8a5c2f8 Fix a syntax error when DEBUGGING is defined.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@154199 13f79535-47bb-0310-9956-ffa450edef68
2005-02-17 22:02:16 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00
Jeff Trawick
9ff46dd755 Remove formatting characters from ap_log_error() calls. These
were escaped as fallout from CAN-2003-0020.

Submitted by: Eric Covener <ecovener gmail.com>
Reviewed by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153105 13f79535-47bb-0310-9956-ffa450edef68
2005-02-09 19:01:43 +00:00
Sander Striker
d55cef82b3 * modules/proxy/mod_proxy_ajp.c
(proxy_ajp_handler): Log error when a backend connection could not
    be made.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152966 13f79535-47bb-0310-9956-ffa450edef68
2005-02-09 00:21:49 +00:00
Sander Striker
7b9a0e8388 * modules/proxy/proxy_util.c
(ap_proxy_pre_request): Log an error when all workers are busy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152964 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 23:57:50 +00:00
Jim Jagielski
5875d5f9cf If we rec' a bad response header line, ignore what we've
rec'd so far and force BAD_GATEWAY.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@152676 13f79535-47bb-0310-9956-ffa450edef68
2005-02-08 16:08:53 +00:00
Jim Jagielski
d1db88d8ad Better handle the case where ProxyBadHeader StartBody is
in effect and we think we've started reading in the
response body. Take advantage of the fact that the
line read is still in buffer (and document that)
to allow us to add to the bb.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151722 13f79535-47bb-0310-9956-ffa450edef68
2005-02-07 15:41:28 +00:00
Justin Erenkrantz
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
Joe Orton
7e76c37963 * modules/proxy/config.m4: Fix mod_proxy build after filename changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151329 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 07:57:10 +00:00
Justin Erenkrantz
632ec345e9 mod_proxy: Fix ProxyRemoteMatch directive.
PR: 33170
Submitted by: Rici Lake <rici ricilake.net>
Reviewed by:  Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151248 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 23:18:48 +00:00
Sander Striker
15ec543f2b Also translate Destination headers when ProxyPassReverse'd
* modules\proxy\mod_proxy_http.c

  (process_proxy_header): reverse map Destination header.

  NOTE: This is some darn nasty looking code...


* modules\proxy\ajp_header.c

  (ajp_unmarshal_response): reverse map Destination header.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151246 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 23:04:04 +00:00
Sander Striker
4162b98a0f Clean up some crumbs... The sandwich is next.
* modules\proxy\mod_proxy.c

  (alias_match): Removed unused variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151241 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 22:05:06 +00:00
Sander Striker
0f59873110 Rename proxy modules.
* modules\proxy\mod_proxy_ajp.c
* modules\proxy\mod_proxy_balancer.c
* modules\proxy\mod_proxy_connect.c
* modules\proxy\mod_proxy_ftp.c
* modules\proxy\mod_proxy_http.c

  Renamed from proxy_{ajp,balancer,connect,ftp,http}.c


* modules\proxy\mod_proxy_ajp.dsp
* modules\proxy\mod_proxy_balancer.dsp
* modules\proxy\mod_proxy_connect.dsp
* modules\proxy\mod_proxy_ftp.dsp
* modules\proxy\mod_proxy_http.dsp

  Update references to renamed files.


* modules\proxy\NWGNUproxyajp
* modules\proxy\NWGNUproxybalancer
* modules\proxy\NWGNUproxycon
* modules\proxy\NWGNUproxyftp
* modules\proxy\NWGNUproxyhtp

  Update references to renamed files.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151238 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 21:56:30 +00:00
Jim Jagielski
745572221a Remove old FIX_15207 snippets
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151212 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 19:25:38 +00:00
Jeff Trawick
749c63b3de proxy HTTP: Rework the handling of request bodies to handle
chunked input and input filters which modify content length, and
avoid spooling arbitrary-sized request bodies in memory.

This is a merge of the proxy-reqbody branch into the trunk.

Justin had the protocol issues resolved in 2.1-dev, but not the 
memory issue.  The new implementation makes an effort to
stream the request body whenever possible.

Thanks to Allan Edwards for a critical bug fix, Greg Ames
for some style corrections, Justin for a needed commentary
addition, Jan Kratochvil for testing the analogous 2.0.x patch 
with the SonyEricsson P900 phone, and reviews by all these 
folks + JimJag.

PR: 15859


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151168 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 16:03:42 +00:00
Jim Jagielski
9935c31bdd Close PR 32459, 15207. API change for PROXY_DECLARE ap_proxy_canonenc()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151153 13f79535-47bb-0310-9956-ffa450edef68
2005-02-03 13:38:24 +00:00
Mladen Turk
e6664a0bb2 Fix #32367 support for ProxyPass /foo !
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@149420 13f79535-47bb-0310-9956-ffa450edef68
2005-02-01 17:17:40 +00:00
Jim Jagielski
fe2650384d Add in a weighted byte count of all traffic (in and out) as
an alternative balancing method. We do not "adjust" the
byte count wrt scheme or method, simply by factoring
in the lbfactor value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@126304 13f79535-47bb-0310-9956-ffa450edef68
2005-01-24 18:28:16 +00:00
Joe Orton
208eb7ae61 * modules/proxy/proxy_http.c (ap_proxy_http_process_response): Handle
aborted connections correctly: abort if c->aborted is set.

* modules/proxy/proxy_ftp.c (proxy_ftp_handler): Likewise.

PR: 32443
Submitted by: Janne Hietamäki, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125612 13f79535-47bb-0310-9956-ffa450edef68
2005-01-19 11:05:57 +00:00
Jim Jagielski
bd10bb4108 Match parameter types
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124912 13f79535-47bb-0310-9956-ffa450edef68
2005-01-11 17:15:02 +00:00
Sander Striker
46ba14216d Rewrite Cookies and other headers in mod_proxy_ajp as configured with
ProxyPassReverse and ProxyPassReverseCookiePath.

* modules/proxy/proxy_ajp.c

  (ap_proxy_ajp_request): Update call to ajp_parse_header().


* modules/proxy/ajp.h

  (ajp_msg_get_string): constify argument.

  (ajp_parse_header): Add conf argument.


* modules/proxy/proxy_util.c

  (ap_proxy_location_reverse_map): Promoted from mod_proxy_http.

  (ap_proxy_cookie_reverse_map): Promoted from mod_proxy_http;
    renamed from proxy_cookie_reverse_map.


* modules/proxy/ajp_msg.c

  (ajp_msg_get_string): constify argument.


* modules/proxy/proxy_http.c

  (ap_proxy_location_reverse_map, proxy_cookie_reverse_map: Removed.

  (process_proxy_header): Update header mapping table to reference the now
    public functions.


* modules/proxy/ajp_header.c

  (ajp_unmarshal_response): And conf argument.  Reverse map cookies and
    other headers.

  (ajp_parse_header): Update call to ajp_unmarshal_response().


* modules/proxy/mod_proxy.h

  (ap_proxy_location_reverse_map, ap_proxy_cookie_reverse_map): Declare
    functions that have been promoted to be public.

  (ap_proxy_header_reverse_map_fn): Typedef for the signature of the above
    two functions (currently used in mod_proxy_http).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124901 13f79535-47bb-0310-9956-ffa450edef68
2005-01-11 08:35:46 +00:00
Sander Striker
47c6e884b2 Make the combination of mod_proxy_ajp and mod_rewrite work correctly.
* modules/proxy/proxy_ajp.c

  (ap_proxy_ajp_request): Update call to ajp_send_header().


* modules/proxy/ajp.h

  (ajp_send_header): Add a uri parameter.


* modules/proxy/ajp_header.c

  (ajp_marshal_into_msgb): Add a uri parameter and use the
   passed in uri instead of r->uri.

  (ajp_send_header): Add a uri parameter.  Update call to
   ajp_marshal_into_msgb().


* modules/mappers/mod_rewrite.c

  (is_absolute_uri): Add handling of 'ajp' and 'balancer' schemes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124584 13f79535-47bb-0310-9956-ffa450edef68
2005-01-07 22:17:48 +00:00
William A. Rowe Jr
a7b143ff4d Fix a signedness issue that revealed a serious bug, the 'i' was
reused for character indexing within this loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@124277 13f79535-47bb-0310-9956-ffa450edef68
2005-01-05 21:23:03 +00:00
Mladen Turk
6ef95d4e37 Kill the pool cleanup when closing non cachable connection.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123884 13f79535-47bb-0310-9956-ffa450edef68
2005-01-02 08:00:26 +00:00
William A. Rowe Jr
d962fcfc8b FINALLY Correct ap_http_method()! It is NOT a method, it's a SCHEME!
Bumped mmn, and ap module cookie, for this function rename.

  It's not a deprecation, as ap_http_method would be a lovely function
  name sometime in the future: to determine what the function name implies.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123882 13f79535-47bb-0310-9956-ffa450edef68
2005-01-02 05:33:44 +00:00
Mladen Turk
55230b229b Fix closing connection for non-cachable proxies.
Do not close the entire connection, just socket if
opened.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123842 13f79535-47bb-0310-9956-ffa450edef68
2005-01-01 16:04:25 +00:00
Mladen Turk
def2248738 Close the connection for generic forward and
reverse proxy workers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123840 13f79535-47bb-0310-9956-ffa450edef68
2005-01-01 15:23:51 +00:00
Mladen Turk
6d38243ac0 Simplify connection address and port resolving for non-cachable workers (gereric forward and reverse proxy).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123811 13f79535-47bb-0310-9956-ffa450edef68
2004-12-31 17:25:58 +00:00
Mladen Turk
81f6517752 Do not cache hostname and port for forward and
reverse generic proxy workers. 

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123809 13f79535-47bb-0310-9956-ffa450edef68
2004-12-31 17:01:05 +00:00
Jeff Trawick
d2c60589c6 mod_proxy: Fix a request corruption problem and a buffering problem
which sometimes prevented proxy-sendchunks from working.

strlen() couldn't be used since no space had been allocated
for trailing NUL, so occasionally the T-E header field contained
garbage and a 400 error would be returned by the origin server.

The lack of a flush bucket after the final "0\r\n\r\n" was a
showstopper for my simple tests (reverse proxy to Apache 1.3 +
custom module which read the body).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123727 13f79535-47bb-0310-9956-ffa450edef68
2004-12-30 16:31:13 +00:00
Jim Jagielski
79419db65a simplify the BalancerMember load factor weighting. Instead of
being percentages (and adjusting when the number don't add
up), loadfactors/lbfactors are now normalized values, so
values like:

   worker    a   b   c
   lbfactor  1   1   2

work as expected (ie: a gets 25%, b gets 25% and c gets 50%).
So we could also have the above as:

   worker    a   b   c
   lbfactor 25  25  50

or even

   worker    a   b   c
   lbfactor 15  15  30



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@122551 13f79535-47bb-0310-9956-ffa450edef68
2004-12-16 14:09:30 +00:00
Cliff Woolley
a89bce3fd9 "transfered" is not a word.
s/transfered/transferred/g;



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111858 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 18:58:25 +00:00
Jim Jagielski
0fb2f37f3e grammatical parameter change... "readed" -> "read"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111830 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 16:08:55 +00:00
Mladen Turk
939710c063 Make proxy address cache thread safe and available only
to pooled workers.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111827 13f79535-47bb-0310-9956-ffa450edef68
2004-12-14 15:45:19 +00:00
Jim Jagielski
cad0958648 We are an int.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111712 13f79535-47bb-0310-9956-ffa450edef68
2004-12-13 13:47:29 +00:00
Jim Jagielski
2ce0fb01c5 Seems to me that if we have a worker which is usable, we
should return that. Otherwise we have no worker (worker
is NULL) and we should return that or else the if clause
takes care of setting worker correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111711 13f79535-47bb-0310-9956-ffa450edef68
2004-12-13 13:40:25 +00:00
Mladen Turk
f08674d77b Set the connection addr from connection pool addres
since proxy_ftp does not use the determine_connection
call.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111359 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 08:07:27 +00:00
Jeff Trawick
803d2b468d mod_proxy: Respect errors reported by pre_connection hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111304 13f79535-47bb-0310-9956-ffa450edef68
2004-12-08 20:19:04 +00:00
Jeff Trawick
7eb243ba75 wrong format string was converted to APR_PID_T_FMT
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109506 13f79535-47bb-0310-9956-ffa450edef68
2004-12-02 16:37:41 +00:00
Mladen Turk
4dda290fd1 Add generic reverse proxy worker so that module-driven reverse proxying works. It is enabled by default, but IMO it should be configurable like any other worker so we can limit the number of outgoing connections.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109316 13f79535-47bb-0310-9956-ffa450edef68
2004-12-01 08:44:11 +00:00
Mladen Turk
4821674833 Build proxy_ajp too when --enable-proxy is declared.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109214 13f79535-47bb-0310-9956-ffa450edef68
2004-11-30 17:38:58 +00:00
Bradley Nicholes
804ff9ab22 Allow APR to exist and build outside of the httpd/srclib file structure
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106975 13f79535-47bb-0310-9956-ffa450edef68
2004-11-30 00:12:39 +00:00
Mladen Turk
08dfbe5e49 Use APR_PID_T_FMT instead %d for pid logging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106903 13f79535-47bb-0310-9956-ffa450edef68
2004-11-29 10:54:46 +00:00
Mladen Turk
25e6a4a500 Make sure that worker initialization is done only
once per worker, as well the initialization of shared
memory slot. Also log the child pid so that logging
makes sense.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106902 13f79535-47bb-0310-9956-ffa450edef68
2004-11-29 10:43:28 +00:00
Joe Orton
c36ecfa64f Remove the .cvsignore files.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105796 13f79535-47bb-0310-9956-ffa450edef68
2004-11-19 09:07:29 +00:00