X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=7a6c0825a214ea456ae33f332c6da634d86c5771;hb=da3b5fdb4d8c70bea3bc4d2a9b5e4eab737864eb;hp=2b0f5d55c8ec3ea30cf499c2adaedde60d0a9169;hpb=759d95a00bcd233ba186a3086db1a1d85af2e7af;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index 2b0f5d5..7a6c082 100644 --- a/src/connection.c +++ b/src/connection.c @@ -149,7 +149,7 @@ void handle_connection(int client_socket) { goto out; } - LOG(DEBUG1, "target: %s:%s (HTTP 1.%d)", host, port, version_minor); + LOG(DEBUG2, "target: %s:%s (HTTP 1.%d)", host, port, version_minor); /* Connect to proxy server or directly to server. */ if (global_proxy_host != NULL && global_proxy_port != NULL) { @@ -571,6 +571,8 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) { if (ferror(client_fd)) { LOG_PERROR(WARNING, "read_http_request(): fgets()"); return -1; + } else if (feof(client_fd)) { + return -2; } if (global_http_digest_authorization != NULL && !found_proxy_authorization) { @@ -626,7 +628,7 @@ static void transfer_data(int client, int server) { fds[1].events = POLLIN | POLLPRI | POLLHUP | POLLERR; fds[1].revents = 0; - LOG(DEBUG1, "transfer_data(): %d -> %d", client, server); + LOG(DEBUG2, "transfer_data(): %d -> %d", client, server); for (;;) { int result = poll(fds, 2 /* fd count */, -1 /* no timeout */); @@ -711,7 +713,7 @@ static void transfer_data_tls(int client, int server, if (gnutls_record_get_max_size(server_session) < buffer_size) { buffer_size = gnutls_record_get_max_size(server_session); } - LOG(DEBUG1, "transfer_data_tls(): suggested buffer size: %ld", + LOG(DEBUG2, "transfer_data_tls(): suggested buffer size: %ld", (long int)buffer_size); for (;;) {