]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Check for EOF while reading the HTTP request.
authorSimon Ruderich <simon@ruderich.org>
Fri, 9 Aug 2013 18:49:19 +0000 (20:49 +0200)
committerSimon Ruderich <simon@ruderich.org>
Fri, 9 Aug 2013 18:49:19 +0000 (20:49 +0200)
src/connection.c

index 2b0f5d55c8ec3ea30cf499c2adaedde60d0a9169..c91eae358e6a3b7cfa44376afba42c928e96ff6b 100644 (file)
@@ -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) {