ASF Bugzilla – Attachment 21243 Details for
Bug 37770
proxy: error reading status line from remote server (null)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
backend connection race condition fix (untested)
race_condition_fix.diff (text/plain), 2.88 KB, created by
Aleksey Midenkov
on 2007-12-07 07:31:36 UTC
(
hide
)
Description:
backend connection race condition fix (untested)
Filename:
MIME Type:
Creator:
Aleksey Midenkov
Created:
2007-12-07 07:31:36 UTC
Size:
2.88 KB
patch
obsolete
>Index: mod_proxy_http.c >=================================================================== >--- mod_proxy_http.c (revision 602123) >+++ mod_proxy_http.c (working copy) >@@ -1764,6 +1764,7 @@ static int proxy_http_handler(request_re > const char *u; > proxy_conn_rec *backend = NULL; > int is_ssl = 0; >+ int retry_count = 2; > > /* Note: Memory pool allocation. > * A downstream keepalive connection is always connected to the existence >@@ -1840,32 +1841,35 @@ static int proxy_http_handler(request_re > sizeof(server_portstr))) != OK) > goto cleanup; > >- /* Step Two: Make the Connection */ >- if (ap_proxy_connect_backend(proxy_function, backend, worker, r->server)) { >- if (r->proxyreq == PROXYREQ_PROXY) >- status = HTTP_NOT_FOUND; >- else >- status = HTTP_SERVICE_UNAVAILABLE; >- goto cleanup; >- } >+ while (retry_count--) { >+ /* Step Two: Make the Connection */ >+ if (ap_proxy_connect_backend(proxy_function, backend, worker, r->server)) { >+ if (r->proxyreq == PROXYREQ_PROXY) >+ status = HTTP_NOT_FOUND; >+ else >+ status = HTTP_SERVICE_UNAVAILABLE; >+ break; >+ } > >- /* Step Three: Create conn_rec */ >- if (!backend->connection) { >- if ((status = ap_proxy_connection_create(proxy_function, backend, >- c, r->server)) != OK) >- goto cleanup; >- } >+ /* Step Three: Create conn_rec */ >+ if (!backend->connection) { >+ if ((status = ap_proxy_connection_create(proxy_function, backend, >+ c, r->server)) != OK) >+ break; >+ } > >- /* Step Four: Send the Request */ >- if ((status = ap_proxy_http_request(p, r, backend, backend->connection, >- conf, uri, url, server_portstr)) != OK) >- goto cleanup; >+ /* Step Four: Send the Request */ >+ if ((status = ap_proxy_http_request(p, r, backend, backend->connection, >+ conf, uri, url, server_portstr)) != OK) >+ break; > >- /* Step Five: Receive the Response */ >- if ((status = ap_proxy_http_process_response(p, r, backend, >- backend->connection, >- conf, server_portstr)) != OK) >- goto cleanup; >+ /* Step Five: Receive the Response */ >+ if ((status = ap_proxy_http_process_response(p, r, backend, >+ backend->connection, >+ conf, server_portstr)) != APR_EOF >+ && status != APR_ECONNRESET) >+ break; >+ } > > /* Step Six: Clean Up */ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 37770
: 21243 |
22341