From 69fd741a9dd52b132ea733638ae3839971ef5baf Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 28 Jul 2013 12:19:54 +0200 Subject: [PATCH] Add missing fflush(). Shouldn't be necessary but better play it safe. --- src/connection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connection.c b/src/connection.c index 365eaab..82b13bf 100644 --- a/src/connection.c +++ b/src/connection.c @@ -164,6 +164,7 @@ void handle_connection(int client_socket) { if (global_proxy_host != NULL && global_proxy_port != NULL) { fprintf(server_fd, "CONNECT %s:%s HTTP/1.0\r\n", host, port); fprintf(server_fd, "\r\n"); + fflush(server_fd); /* Read response line from proxy server. */ result = read_http_request(server_fd, buffer, sizeof(buffer)); @@ -524,6 +525,7 @@ static void send_bad_request(FILE *client_fd) { fprintf(client_fd, HTTP_RESPONSE_FORMAT, RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_MSG); + fflush(client_fd); #undef RESPONSE_ERROR #undef RESPONSE_MSG } @@ -533,6 +535,7 @@ static void send_forwarding_failure(FILE *client_fd) { fprintf(client_fd, HTTP_RESPONSE_FORMAT, RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_MSG); + fflush(client_fd); #undef RESPONSE_ERROR #undef RESPONSE_MSG } -- 2.45.2