X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=cgi.c;h=f81443ee199173a335e9593731f716c00cea6989;hp=9e1e8e41c0ce6966930361d690722126151f0200;hb=8d2e285a16770c0de496756a143a37d40d092235;hpb=8264f40fd3bc5a641872ad20ff76d4a8dab67b62 diff --git a/cgi.c b/cgi.c index 9e1e8e41..f81443ee 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.155 2012/09/18 18:29:55 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.157 2012/11/09 10:47:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -978,6 +978,9 @@ struct http_response *error_response(struct client_state *csp, case SOCKS_5: socks_type = "socks5-"; break; + case SOCKS_5T: + socks_type = "socks5t-"; + break; default: log_error(LOG_LEVEL_FATAL, "Unknown socks type: %d.", fwd->type); } @@ -1570,7 +1573,7 @@ char *compress_buffer(char *buffer, size_t *buffer_length, int compression_level * On error, free()s rsp and returns cgi_error_memory() * *********************************************************************/ -struct http_response *finish_http_response(const struct client_state *csp, struct http_response *rsp) +struct http_response *finish_http_response(struct client_state *csp, struct http_response *rsp) { char buf[BUFFER_SIZE]; jb_err err; @@ -1620,6 +1623,11 @@ struct http_response *finish_http_response(const struct client_state *csp, struc if (!err) { snprintf(buf, sizeof(buf), "Content-Length: %d", (int)rsp->content_length); + /* + * Signal serve() that the client will be able to figure out + * the end of the response without having to close the connection. + */ + csp->flags |= CSP_FLAG_SERVER_CONTENT_LENGTH_SET; err = enlist(rsp->headers, buf); }