1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

198 Commits

Author SHA1 Message Date
Jeff Trawick
9a1842b70c get basic HTTP proxy working on EBCDIC machines
(I would bet that there is more work to do throughout proxy, but at least
it can serve some pages now)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94811 13f79535-47bb-0310-9956-ffa450edef68
2002-04-26 12:29:38 +00:00
Graham Leggett
ab32e62ac3 Proxy was bombing out every second keepalive request, caused by a
stray CRLF before the second response's status line. Proxy now
tries to read one more line if it encounters a CRLF where it
expected a status.
PR: 10010
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94574 13f79535-47bb-0310-9956-ffa450edef68
2002-04-09 09:39:04 +00:00
Doug MacEachern
9fb5b384d7 PR:
Obtained from:
Submitted by:	Daniel Lopez <daniel@covalent.net>
Reviewed by:	dougm, rbb
add optional fixup hook to proxy


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94544 13f79535-47bb-0310-9956-ffa450edef68
2002-04-08 18:38:56 +00:00
Doug MacEachern
1138615486 fix ProxyPass when frontend is https and backend is http
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94515 13f79535-47bb-0310-9956-ffa450edef68
2002-04-07 03:37:35 +00:00
Doug MacEachern
e695ae9601 PR:
Obtained from:
Submitted by:
Reviewed by:    Ryan Bloom
remove flush bucket from ap_proxy_http_process_response.
this allows for the response content-length header to be properly
calculated/inserted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94459 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 18:08:07 +00:00
Doug MacEachern
cf7be3d0b6 PR:
Obtained from:
Submitted by:
Reviewed by:	Ryan Bloom
remove call to ap_proxy_reset_output_filters() and the function itself.
this call breaks ssl proxy when the client is using keepalives.
this function is also no longer needed with recent-ish filter changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94383 13f79535-47bb-0310-9956-ffa450edef68
2002-04-02 04:30:49 +00:00
Doug MacEachern
51ee9a749e ap_proxy_http_request needs to check the return status of ap_pass_brigade
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94333 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 06:19:14 +00:00
Doug MacEachern
f4d0e50e00 check the return value of ap_proxy_ssl_enable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94313 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 17:48:28 +00:00
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Doug MacEachern
c3e2155dca hook into mod_ssl for https support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94300 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 07:29:11 +00:00
Graham Leggett
19c0213612 Change the header merging behaviour in proxy, as some headers
(like Set-Cookie) cannot be unmerged due to stray commas in
dates.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94083 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 12:05:45 +00:00
Bill Stoddard
d5c24720dc Commit 1 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94056 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:41:55 +00:00
Bill Stoddard
470edb9dd8 First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 01:58:47 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Graham Leggett
01b5958cf7 New directive ProxyIOBufferSize. Sets the size of the buffer used
when reading from a remote HTTP server in proxy.

Modify receive/send loop in proxy_http and proxy_ftp so that
should it be necessary, the remote server socket is closed before
transmitting the last buffer (set by ProxyIOBufferSize) to the
client. This prevents the backend server from being forced to hang
around while the last few bytes are transmitted to a slow client.
Fix the case where no error checking was performed on the final
brigade in the loop.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93811 13f79535-47bb-0310-9956-ffa450edef68
2002-03-09 07:15:33 +00:00
Jeff Trawick
1151bac94b implement a common function for getting a socket and trying to connect
to the target host; use that common function for proxy HTTP and proxy
CONNECT

In that new function, fix this problem:

     Proxy HTTP and CONNECT: Keep trying other addresses from the DNS
     when we can't get a socket in the specified address family.  We may
     have gotten back an IPv6 address first and yet our system is not
     configured to allow IPv6 sockets.

An example host is www.ipv6.org.  The first address I get back is
an IPv6 address, but my machine may not be configured to allow an
AF_INET6 socket.

Before the fix: The apr_socket() failure was fatal.
After the fix:  When apr_socket() fails, we go to the next address from
                the resolver, successfully create a socket in the
                specified family (AF_INET), and all is well.

(an unrelated fix in this commit was to pass a server_rec in a broken
ap_log_error() call)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93787 13f79535-47bb-0310-9956-ffa450edef68
2002-03-08 02:03:47 +00:00
Doug MacEachern
d27bcd07fd fix typo in ap_proxy_http_canon: s/https:/https/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93784 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 23:40:03 +00:00
Graham Leggett
23bad0a329 Some browsers ignore cookies that have been merged into a
single Set-Cookie header. Set-Cookie and Set-Cookie2 headers
are now unmerged in the http proxy before being sent to the
client.
Fix a problem with proxy where each entry of a duplicated
header such as Set-Cookie would overwrite and obliterate the
previous value of the header, resulting in multiple header
values (like cookies) going missing.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93527 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 06:06:31 +00:00
Ian Holsman
0a70e420a5 send a 'bad-gateway'
when a invaild response flys in


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93519 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 20:25:15 +00:00
Ryan Bloom
862f407872 Remove the install_transport_filters hook. The same function can be
acheived with the pre_connection hook.  I have added the socket to the
pre_connection phase to make this possible.
Reviewed by:	Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93259 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 22:18:49 +00:00
Bill Stoddard
bd3d360392 Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93171 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 22:16:31 +00:00
Ian Holsman
8cf569593b add a ProxyTimeout directive
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93117 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 18:46:56 +00:00
Martin Kraemer
08ff4a86f0 In the debug log, say 'decline' instead of 'reject' when DECLINEing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93103 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 12:40:39 +00:00
Bill Stoddard
4bc1733b38 Cleanup some fallout from the recent install_transport_filters commit.
Deprecate ap_proxy_pre_http_connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93093 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 04:34:11 +00:00
Ian Holsman
c23a0b8732 new directive 'ProxyPreserveHost' which allows the incoming host line to
be sent to the proxied server.

Submitted by:	g.russell@ieee.org (1.3 version)
Reviewed by:	Ian Holsman/Graham Legget/Chuck Murcko


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93089 13f79535-47bb-0310-9956-ffa450edef68
2002-01-29 21:08:37 +00:00
Bill Stoddard
327e4989d5 Remove the create_connection hook and put the client_socket back into the
conn_rec. The create_connection_hook has a design flaw that prevents it
from making decisions based on vhost information.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93050 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 12:52:08 +00:00
Justin Erenkrantz
94d01b65aa Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length.  This is
much more consistent.  Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length.  This makes it now possible to
pass constants down without assigning them to a temporary variable first.

Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
  some circumstances


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93014 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:11:47 +00:00
Justin Erenkrantz
7d32242a14 Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.

We also no longer look at readbytes to determine the method of
filter operation.  This makes the use of filters more obvious and
allows a wider range of options for input filters modes.

To start with, the new input filter modes are:

AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)

The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ

This also allows cleanup of mod_ssl's handling in the getline case.

Reviewed by:	Ryan Bloom (concept), Greg Stein (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92928 13f79535-47bb-0310-9956-ffa450edef68
2002-01-19 07:45:18 +00:00
Jeff Trawick
10406b4ad2 Fix a couple of mod_proxy problems forwarding HTTP connections:
(1) PR #9190  It failed to connect to IPv6 hosts.
(2) It failed to connect when the first IP address returned by
    the resolver was unreachable but a secondary IP address was.

PR:    9190 (partly)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92727 13f79535-47bb-0310-9956-ffa450edef68
2002-01-04 01:47:55 +00:00
Bill Stoddard
816e3717cf Keep my comments to myself.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92725 13f79535-47bb-0310-9956-ffa450edef68
2002-01-03 20:47:30 +00:00
Bill Stoddard
dd4b6e71aa Use ap_getline() in favor of ap_proxy_string_read() in ap_proxy_http_process_response().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92723 13f79535-47bb-0310-9956-ffa450edef68
2002-01-03 20:38:04 +00:00
Bill Stoddard
bfa4490273 Fix mod_proxy seg fault when the proxied server returns
an HTTP/0.9 response or a bogus status line.

Submitted by: Adam Sussman
Reviewed by:	Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92693 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 21:03:12 +00:00
Bill Stoddard
dbdc5a2978 Prevent mod_proxy from truncating one character off the
end of the status line returned from the proxied server.
Note that buffer is NULL terminated by the call to
ap_proxy_string_read() so there is no need to terminate it
again.

Submitted by:	Adam Sussman
Reviewed by:	Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92692 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 20:53:28 +00:00
Bill Stoddard
826df1bb82 Change the call to be blocking to eliminate a loop caused when the upstream
host does not send any bytes back our way.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92691 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 20:46:22 +00:00
Ryan Bloom
57f5bf7a31 Remove an extra semi-colon.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92534 13f79535-47bb-0310-9956-ffa450edef68
2001-12-19 16:32:01 +00:00
Jeff Trawick
c85d4a7c86 get proxy in sync with the update to ap_run_create_connection
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92520 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 20:29:27 +00:00
Ian Holsman
0b318ea68b Add extra If-XXX request headers to be ignored in subrequests
Allow cache-control header to get passed to subrequests
tabs -> spaces

Submitted by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92030 13f79535-47bb-0310-9956-ffa450edef68
2001-11-18 16:59:38 +00:00
Ian Holsman
0651b89988 Only do keepalives (and keep state on the connection record) if this request
is the top-level page.

Do not pass If-XXX-Since headers to the r-proxied server on a subrequest,
and we can't handle a 30X response


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92022 13f79535-47bb-0310-9956-ffa450edef68
2001-11-17 22:04:48 +00:00
Ryan Bloom
5a49046151 Quiet a compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91953 13f79535-47bb-0310-9956-ffa450edef68
2001-11-14 21:55:58 +00:00
Ryan Bloom
8a697835fe Get the proxy module compiling again. This is a hack to get past the
current compiler errors.  Basically, the core now puts the socket
in the conn_rec->conn_config vector.  The proxy grabs that socket and
uses it where it used to use the client_socket field from the conn_rec.
Long-term, all of the direct socket communication needs to be removed,
and this should go through a filter stack.  Short-term, this gets the
proxy working again.

I have tested http and connect, but I haven't looked at the FTP proxy,
although it does compile now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91952 13f79535-47bb-0310-9956-ffa450edef68
2001-11-14 21:18:47 +00:00
Cliff Woolley
468199afcb Remove the returned-length "w" parameter from apr_bucket_heap_create()
and apr_bucket_heap_make().  It was useless, since the length is invariant
from the length passed in and from the resulting bucket's b->length.  This
takes care of a long-standing issue first brought up in February and
discussed on the dev@apr list.  (Issue #2 from the "Bucket API Cleanup
Issues" thread.)

See http://marc.theaimsgroup.com/?l=apr-dev&m=98324983126666&w=2

Reviewed by:    Ryan Bloom (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91866 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 03:23:12 +00:00
Ian Holsman
eea38d7c2e This patch changes the apr_table_elts macro so that it provides
access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.


Submitted by:	Brian Pane <BPane@pacbell.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91860 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 22:31:04 +00:00
Ian Holsman
f1c45242ca Fix so that errordocument works when a error gets returned from the
proxy.
Problem was ErrorHandler thought it was in some kind of recursion and
couldn't find the custom error document
Obtained from: Jin Hong <jinh@cnet.com>
Submitted by:
Reviewed by:   Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91757 13f79535-47bb-0310-9956-ffa450edef68
2001-11-05 23:06:55 +00:00
Aaron Bannert
1087db6a1d Fix a truncation bug in how we print the port on the Via: header.
The routine that prints the Via: header now takes a length for
the port string.

Submitted by:	Zvi Har'El <rl@math.technion.ac.il>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91682 13f79535-47bb-0310-9956-ffa450edef68
2001-10-29 15:44:03 +00:00
Justin Erenkrantz
e1438a2d7c Fix the first bucket not getting chunked properly. The reason was that
we left the TE header in the output headers, so ap_set_keepalive didn't
set r->chunked to 1.  So, ap_http_header_filter wouldn't insert CHUNK
filter appropriately.  I have no clue how it chunked anything at all
before this patch, but hey, it looks right now.

Tested with Yahoo, Apple, apache.org, and /.
/. is interesting in that it sends both Conn: Close and TE: chunked.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91463 13f79535-47bb-0310-9956-ffa450edef68
2001-10-14 20:41:00 +00:00
Justin Erenkrantz
fd1950344a Lose the magic number and use the central #define AP_IOBUFSIZE.
Hey, I've never seen it in actual use anywhere, so I didn't know.

Thanks to Roy for pointing it out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91440 13f79535-47bb-0310-9956-ffa450edef68
2001-10-12 02:00:41 +00:00
Justin Erenkrantz
22c9145d8d Teach mod_proxy to live with the new filtering scheme.
Tested with www.yahoo.com (Conn: Close), www.apache.org (CL), and
www.apple.com (TE: Chunked).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91436 13f79535-47bb-0310-9956-ffa450edef68
2001-10-11 20:03:26 +00:00
Ian Holsman
dd713bba3b dechunking filter removed.
add HTTP_IN filter after the headers have been parsed.
so that the HTTP_IN can check them ;-)
Still not 100% if this works properly, but I don't get
the chunking numbers displayed on my browser,
so it's better than what was there.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91370 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 21:49:17 +00:00
Ian Holsman
4bd8279a92 initial port of new Request-mode HTTP_IN filter to proxy.
Status: It serves a reverse-proxy page.. but SLOWLY.
VERY SLOWLY.
still looking at why, but now it serves pages instead of dumping core.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91363 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 19:25:35 +00:00
Graham Leggett
0617f1c78f Some style cleanups related to the ProxyErrorOverride function.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91171 13f79535-47bb-0310-9956-ffa450edef68
2001-09-28 10:23:32 +00:00