X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=82b13bf0d04f5a316968bb18577378a2d47f8c47;hb=8f25becb220b321f0e9bd4b766ae7085a0335466;hp=365eaab2e6de30c361f92d07c5130eaf9c4ff3cc;hpb=0a20ac33156b4978352223e461c77194f75fe814;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 }