1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

1691 Commits

Author SHA1 Message Date
Ruediger Pluem
a902bda003 * Give ap_proxy_post_request as chance to act correctly on the status code
by setting r->status temporarily to access_status. r->status might be
  different than access_status e.g. r->status could be HTTP_OK if e.g. we
  override the error page on the proxy or if the error was not generated
  by the backend itself but by the proxy e.g. a bad gateway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597352 13f79535-47bb-0310-9956-ffa450edef68
2014-05-24 20:55:52 +00:00
Ruediger Pluem
f17e7e5e10 * Correctly escape user provided data.
PR: 56532
Submitted by: Maksymilian <max cert.cx>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595305 13f79535-47bb-0310-9956-ffa450edef68
2014-05-16 18:54:19 +00:00
Yann Ylavic
f063241b1f mod_proxy_wstunnel: Fix the use of SSL connections with the "wss:" scheme.
PR55320.

Submitted by: Alex Liu <alex.leo.ca gmail.com>
Committed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594625 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 15:54:38 +00:00
Eric Covener
d758951456 Extend the socket callbacks in event to allow a timeout on the I/O callback.
When a socket callback has a timeout, an associated timer event is used to 
remove the sockets from the pollset and call a timeout function.

* This includes a noteworthy change to the main event loop. Previously,
we would call epoll, then process the timer events, then iterate through the
poll results. After this patch, the timer events are processed before the poll()
a _non-queued_ action can change the pollset conents (a users timed callback
function conversely could easily sit in a queue while the main thread continues
down into epoll)

* timer events can now have sockets associated with them, those sockets are 
removed from the pollset when the timer event fires w/o a queue to the worker.

* timer events now have a canceled flag that can be toggled without locking
the timer list. 

* Drop the severity of some wstunnel messages from DEBUG to TRACE1

* Lift the restriction on using asynchronous websockets connections but having
an idle timeout



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593857 13f79535-47bb-0310-9956-ffa450edef68
2014-05-11 20:41:45 +00:00
Jeff Trawick
094e7489e3 fix Doxygen markup error
Submitted by: jailletc36


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592632 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 21:13:12 +00:00
Jeff Trawick
65341f92bc Follow-up to r1592529:
Define default port for "scgi" schemes (as chosen by
mod_proxy_scgi) in a common location.

Suggested by: jailletc36


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592615 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 19:26:33 +00:00
Jeff Trawick
dafc97aa81 mod_proxy_scgi: Support Unix sockets.
ap_proxy_port_of_scheme(): Support default SCGI port (4000).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592529 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 14:02:48 +00:00
Jeff Trawick
a306773aa4 Clarify an existing requirement of the server_portstr parameter
to ap_proxy_determine_connection(): it must be a buffer of at
least one byte in size.

(And don't bother with using strcpy in order to zap a string.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592514 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 12:47:18 +00:00
Jeff Trawick
19b5b85316 reformat only (get rid of unnecessary block scope)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592511 13f79535-47bb-0310-9956-ffa450edef68
2014-05-05 12:40:47 +00:00
Jeff Trawick
a8b72c1517 mod_proxy_fcgi: Fix occasional high CPU when handling request bodies.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592037 13f79535-47bb-0310-9956-ffa450edef68
2014-05-02 20:46:28 +00:00
Jeff Trawick
31dab168f5 better diagnostics for failures during dispatch()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1592032 13f79535-47bb-0310-9956-ffa450edef68
2014-05-02 20:33:57 +00:00
Jeff Trawick
5dac70c7aa mod_proxy_fcgi: Support iobuffersize parameter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591508 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 22:52:41 +00:00
Jeff Trawick
cc065dba44 Axe unnecessary memset() calls and allocating an extra
byte in an I/O buffer for '\0', which hasn't been needed
since a strstr("\r\n\r\n") was removed in r371428.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591472 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 20:21:03 +00:00
Jeff Trawick
eb9b6affd5 mod_proxy_fcgi: Don't segfault when failing to connect to the backend.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1590437 13f79535-47bb-0310-9956-ffa450edef68
2014-04-27 18:10:03 +00:00
Jim Jagielski
2aa898bb2f strncmp(r->filename, "proxy:", 6) is faster than a
note. Plus, allows for checking even if not due to
rewrite.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588544 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 19:21:35 +00:00
Yann Ylavic
9ba346e885 mod_proxy: Preserve original request headers even if they differ
from the ones to be forwarded to the backend. PR 45387.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588527 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 17:38:15 +00:00
Yann Ylavic
987c973aaa mod_proxy: When ping/pong is configured for a worker, don't send or forward
"100 Continue" (interim) response to the client if it does not
           expect one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588519 13f79535-47bb-0310-9956-ffa450edef68
2014-04-18 17:17:06 +00:00
Eric Covener
2cba644ed3 whitespace changes only
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587657 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 17:56:32 +00:00
Eric Covener
7fd249108f followup to r1587036.
if backend->close is set too early, proxy_util.c will close it right 
away and then blow away the field.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587654 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 17:56:00 +00:00
Eric Covener
88bcccd4a9 s/asynch/async
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587126 13f79535-47bb-0310-9956-ffa450edef68
2014-04-14 00:13:43 +00:00
Eric Covener
4becd93579 several related mod_proxy_wstunnel changes that are tough to pull apart:
* make async websockets tunnel opt-in
* add config for how long we block a thread in asynch mode
* add config for a cap on the synchronous path
* avoid sending error responses down the upgraded tunnel



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587075 13f79535-47bb-0310-9956-ffa450edef68
2014-04-13 18:41:05 +00:00
Eric Covener
e255101079 stop leaking websockets backend connections (trunk only)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587057 13f79535-47bb-0310-9956-ffa450edef68
2014-04-13 17:26:30 +00:00
Eric Covener
4a3fe3bcf7 cleanup wstunnel error handling
Submitted By: covener, ylavic, Edward Lu
Commited By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587053 13f79535-47bb-0310-9956-ffa450edef68
2014-04-13 17:21:50 +00:00
Eric Covener
a8b534d41d actually remove mod_reqtimeout, since the util_filter functions involved
only manipulate c->input_filters no matter what we pass. We need to make
copies of c->input_filters after, not before, it skips over reqtimeout.

Note: reqtimeout doesn't really interfere today with normal operation,
but this is misleading/confusing when dealing with other
wstunnel issues.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587040 13f79535-47bb-0310-9956-ffa450edef68
2014-04-13 17:00:38 +00:00
Eric Covener
5ab33646af *) mod_proxy_wstunnel: Don't pool backend websockets connections,
because we need to handshake every time. PR 55890.
     [Eric Covener]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587036 13f79535-47bb-0310-9956-ffa450edef68
2014-04-13 16:57:34 +00:00
Jeff Trawick
5512fa1b86 mod_proxy_http: Add detach_backend hook.
The immediate use is for a SSL-related module which works
on the backend proxy connection to be able to "leak" information
into the client r for logging.

This could be useful with other proxy scheme handlers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586719 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 17:07:18 +00:00
Jeff Trawick
7775249b30 mod_proxy_fcgi: Fix sending of response without some HTTP headers
that might be set by filters.

The problem occurs when no body bytes were read while reading the
response headers, resulting in an empty brigade being sent down
the filter stack.  One particualr filter that mishandles the empty
initial brigade is mod_deflate.  It neglects to add to the response
header fields.

PR: 55558
Submitted by: Jim Riggs <jim riggs.me>
Reviewed by: trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585824 13f79535-47bb-0310-9956-ffa450edef68
2014-04-08 20:07:04 +00:00
Christophe Jaillet
e2643b38f9 Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1578760 13f79535-47bb-0310-9956-ffa450edef68
2014-03-18 06:52:08 +00:00
Christophe Jaillet
845a77beca Use 'apr_table_setn' instead of 'apr_table_set' when possible in order to save memory.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1578759 13f79535-47bb-0310-9956-ffa450edef68
2014-03-18 06:51:49 +00:00
Jeff Trawick
d50ebf12a6 fix spelling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1575958 13f79535-47bb-0310-9956-ffa450edef68
2014-03-10 14:57:14 +00:00
Jim Jagielski
cd304f4964 Allow reverse-proxy to be set via explicit handler
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1573626 13f79535-47bb-0310-9956-ffa450edef68
2014-03-03 17:28:17 +00:00
Yann Ylavic
1e9f5c99cf mod_proxy: Add comment and avoid ternary operator as condition (no functional change).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1573229 13f79535-47bb-0310-9956-ffa450edef68
2014-03-01 21:36:27 +00:00
Yann Ylavic
d29ce4b047 mod_proxy: follows up r1572630.
Don't reuse a SSL backend connection with no SNI for a request requiring SNI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572967 13f79535-47bb-0310-9956-ffa450edef68
2014-02-28 14:46:50 +00:00
Yann Ylavic
fb3ff3e754 Redo what was reverted in r1572627.
Don't reuse a SSL backend connection whose SNI differs. PR 55782.
This may happen when ProxyPreserveHost is on and the proxy-worker
handles connections to different Hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572630 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:40:01 +00:00
Yann Ylavic
0ab0ee5043 Move newly added proxy_conn_rec's uds_path field to the end of the struct like in 2.4.x.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572628 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:33:58 +00:00
Yann Ylavic
dc560db2e9 Revert r1572606 for the time being since backport would conflict with 2.4.x's proxy_conn_rec.
The uds_path field is at the end of the struct in 2.4.x but not in trunk.
Fix that first, then recommit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572627 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 15:31:58 +00:00
Yann Ylavic
93a607e6f2 Don't reuse a SSL backend connection whose SNI differs. PR 55782.
This may happen when ProxyPreserveHost is on and the proxy-worker
handles connections to different Hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572606 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 14:52:12 +00:00
Yann Ylavic
739dc00ca9 Avoid useless functions calls.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572561 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 13:39:25 +00:00
Yann Ylavic
42b77650ae Cleanup the client to backend brigade before returning an error (if any) to avoid buckets lifetime issues (backend connection's pool destroyed before request's one). PR 50335.
Suggested by rpluem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572543 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 13:05:24 +00:00
Yann Ylavic
accfcf7471 Log an error in mod_proxy_http when reading the request body fails.
Follow-up to r1538776 where incomplete bodies are detected and an error returned through the input filters.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1570598 13f79535-47bb-0310-9956-ffa450edef68
2014-02-21 15:08:32 +00:00
Eric Covener
33f7dbafce handle POLLERR/POLLHUP during poll() to avoid high CPU busy loop.
Submitted By: Joffroy Christen <joffroy.christen solvaxis com>, Eric Covener]
Committed By: covener
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1569615 13f79535-47bb-0310-9956-ffa450edef68
2014-02-19 02:42:29 +00:00
Yann Ylavic
ffdab778e2 mod_proxy_http: don't recycle backend connections known to be closed (eg. EOS by close).
This saves a useless ap_is_socket_connected() call when reused.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1568404 13f79535-47bb-0310-9956-ffa450edef68
2014-02-14 17:55:19 +00:00
Jeff Trawick
304da56908 mod_proxy_fcgi: Fix error message when an unexpected protocol version
number is received from the application.

PR: 56110


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564756 13f79535-47bb-0310-9956-ffa450edef68
2014-02-05 12:58:11 +00:00
Ruediger Pluem
82bb21ba2e * Do not parse URL in case of regular expression as they likely do not follow
the URL syntax.

PR: 56074


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1564437 13f79535-47bb-0310-9956-ffa450edef68
2014-02-04 19:36:50 +00:00
Jim Jagielski
c9acc73574 r->filename should maintain the proxy: prefix for PHP-FPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1561660 13f79535-47bb-0310-9956-ffa450edef68
2014-01-27 13:09:11 +00:00
Jim Jagielski
ee7cbbac67 handle leak. thx to Y^2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1561137 13f79535-47bb-0310-9956-ffa450edef68
2014-01-24 20:01:47 +00:00
Jim Jagielski
0662e2e64d Reflow logic... pull UDS stuff out
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560979 13f79535-47bb-0310-9956-ffa450edef68
2014-01-24 13:06:40 +00:00
Jim Jagielski
e614823e31 Tuck away UDS path in request-rec, since worker isn't
thread-safe. Protect from NULL refs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560689 13f79535-47bb-0310-9956-ffa450edef68
2014-01-23 14:09:40 +00:00
Jim Jagielski
7651045da6 Adjust url as required, following what we did to r->filename.
Save some cycles when searching...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560546 13f79535-47bb-0310-9956-ffa450edef68
2014-01-22 22:26:49 +00:00
Jim Jagielski
72df6b36bf make mod_rewrite and mod_proxy UDS work together...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560367 13f79535-47bb-0310-9956-ffa450edef68
2014-01-22 14:54:21 +00:00