Skip to content

Commit

Permalink
Always use the cleanup. Do not close the socket directly.
Browse files Browse the repository at this point in the history
Submitted by: mturk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104603 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
wrowe committed Aug 11, 2004
1 parent c4268db commit 6a3321b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions modules/proxy/proxy_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
len = ap_getline(buffer, sizeof(buffer), rp, 0);
}
if (len <= 0) {
apr_socket_close(backend->sock);
backend->sock = NULL;
// backend->connection = NULL;
ap_proxy_http_cleanup(NULL, r, backend);
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"proxy: error reading status line from remote "
"server %s", backend->hostname);
Expand All @@ -819,9 +817,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
* if the status line was > 8192 bytes
*/
else if ((buffer[5] != '1') || (len >= sizeof(buffer)-1)) {
apr_socket_close(backend->sock);
// backend->connection = NULL;
backend->sock = NULL;
ap_proxy_http_cleanup(NULL, r, backend);
return ap_proxyerror(r, HTTP_BAD_GATEWAY,
apr_pstrcat(p, "Corrupt status line returned by remote "
"server: ", buffer, NULL));
Expand Down

0 comments on commit 6a3321b

Please sign in to comment.