X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=82b13bf0d04f5a316968bb18577378a2d47f8c47;hb=69fd741a9dd52b132ea733638ae3839971ef5baf;hp=365eaab2e6de30c361f92d07c5130eaf9c4ff3cc;hpb=da1b95a8ded80fb5dc07e93a3a7538d39b59740e;p=tlsproxy%2Ftlsproxy.git 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 }