]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Add missing fflush().
authorSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 10:19:54 +0000 (12:19 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 28 Jul 2013 10:19:54 +0000 (12:19 +0200)
Shouldn't be necessary but better play it safe.

src/connection.c

index 365eaab2e6de30c361f92d07c5130eaf9c4ff3cc..82b13bf0d04f5a316968bb18577378a2d47f8c47 100644 (file)
@@ -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
 }