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);
* 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));