X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jcc.c;h=03b2431be60571c0d0b3d57cb5faf0876d6886cd;hb=b64613e1426a856490e86e67052f094fc8b09b75;hp=cc37def13756410fa57ad0d69f4c4b2780a3fa49;hpb=e693e665a5012fba131bf207821e31164f27d72b;p=privoxy.git diff --git a/jcc.c b/jcc.c index cc37def1..03b2431b 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.254 2009/06/11 11:44:25 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.256 2009/06/11 11:49:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -236,15 +236,6 @@ static const char MISSING_DESTINATION_RESPONSE[] = "Connection: close\r\n\r\n" "Bad request. Privoxy was unable to extract the destination.\r\n"; -/* XXX: should be a template */ -static const char NO_SERVER_DATA_RESPONSE[] = - "HTTP/1.0 502 Server or forwarder response empty\r\n" - "Proxy-Agent: Privoxy " VERSION "\r\n" - "Content-Type: text/plain\r\n" - "Connection: close\r\n\r\n" - "Empty server or forwarder response.\r\n" - "The connection has been closed but Privoxy didn't receive any data.\r\n"; - /* XXX: should be a template */ static const char INVALID_SERVER_HEADERS_RESPONSE[] = "HTTP/1.0 502 Server or forwarder response invalid\r\n" @@ -666,6 +657,9 @@ static const char *crunch_reason(const struct http_response *rsp) case RSP_REASON_CONNECTION_TIMEOUT: reason = "Connection timeout"; break; + case RSP_REASON_NO_SERVER_DATA: + reason = "No server data received"; + break; default: reason = "No reason recorded"; break; @@ -2099,7 +2093,7 @@ static void chat(struct client_state *csp) { log_error(LOG_LEVEL_ERROR, "Empty server or forwarder response."); log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd); - write_socket(csp->cfd, NO_SERVER_DATA_RESPONSE, strlen(NO_SERVER_DATA_RESPONSE)); + send_crunch_response(csp, error_response(csp, "no-server-data")); free_http_request(http); mark_server_socket_tainted(csp); return;