From: Simon Ruderich Date: Sun, 28 Jul 2013 10:19:54 +0000 (+0200) Subject: Add missing fflush(). X-Git-Url: https://ruderich.org/simon/gitweb/?p=tlsproxy%2Ftlsproxy.git;a=commitdiff_plain;h=69fd741a9dd52b132ea733638ae3839971ef5baf Add missing fflush(). Shouldn't be necessary but better play it safe. --- 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 }