[Privoxy-commits] [privoxy] 07/16: If the MS IIS5 hack fails, only send the error response if we're buffering content
User Git
git at git.privoxy.org
Mon Dec 22 11:30:13 CET 2025
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository privoxy.
commit a6382834f2f414943860b1bace54d04b2c7a04f2
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Tue Dec 16 18:11:28 2025 +0100
If the MS IIS5 hack fails, only send the error response if we're buffering content
Previously the error response was also sent if the client already
received the HTTP headers from the server.
---
jcc.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/jcc.c b/jcc.c
index 3c6ef400..8ea8c9d1 100644
--- a/jcc.c
+++ b/jcc.c
@@ -4200,22 +4200,25 @@ static void handle_established_connection(struct client_state *csp)
"Applying the MS IIS5 hack didn't help.");
log_error(LOG_LEVEL_CLF,
"%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd);
-#ifdef FEATURE_HTTPS_INSPECTION
- /*
- * Sending data with standard or secured connection (HTTP/HTTPS)
- */
- if (client_use_ssl(csp))
+ if (buffer_and_filter_content)
{
- ssl_send_data_delayed(&(csp->ssl_client_attr),
- (const unsigned char *)INVALID_SERVER_HEADERS_RESPONSE,
- strlen(INVALID_SERVER_HEADERS_RESPONSE),
- get_write_delay(csp));
- }
- else
+#ifdef FEATURE_HTTPS_INSPECTION
+ /*
+ * Sending data with standard or secured connection (HTTP/HTTPS)
+ */
+ if (client_use_ssl(csp))
+ {
+ ssl_send_data_delayed(&(csp->ssl_client_attr),
+ (const unsigned char *)INVALID_SERVER_HEADERS_RESPONSE,
+ strlen(INVALID_SERVER_HEADERS_RESPONSE),
+ get_write_delay(csp));
+ }
+ else
#endif /* def FEATURE_HTTPS_INSPECTION */
- {
- write_socket_delayed(csp->cfd, INVALID_SERVER_HEADERS_RESPONSE,
- strlen(INVALID_SERVER_HEADERS_RESPONSE), write_delay);
+ {
+ write_socket_delayed(csp->cfd, INVALID_SERVER_HEADERS_RESPONSE,
+ strlen(INVALID_SERVER_HEADERS_RESPONSE), write_delay);
+ }
}
mark_server_socket_tainted(csp);
#ifdef FEATURE_HTTPS_INSPECTION
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Privoxy-commits
mailing list