X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=e4b0b29f1b1575dcefb32518c58eb9ef43f3357e;hb=0b7b01d255126abef7b882c894412a85ad2bdecc;hp=0a69f78b228e1b4e64af911bdd4fe8ace64f1fbf;hpb=ceebf9e917885f33396b93504943d7b8e63e782b;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index 0a69f78..e4b0b29 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,7 +1,7 @@ /* * Handle connections. * - * Copyright (C) 2011 Simon Ruderich + * Copyright (C) 2011-2012 Simon Ruderich * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -357,7 +357,7 @@ static int initialize_tls_session_client(int peer_socket, /* The "invalid" hostname is special. If it's used we send an invalid * certificate to let the client know something is wrong. */ - use_invalid_cert = 0 == strcmp(hostname, "invalid"); + use_invalid_cert = (0 == strcmp(hostname, "invalid")); if (0 != proxy_certificate_path(hostname, path, sizeof(path))) { LOG(LOG_ERROR, @@ -512,7 +512,7 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) { return -2; } - while (NULL != fgets(buffer, MAX_REQUEST_LINE, client_fd)) { + while (NULL != fgets(buffer, sizeof(buffer), client_fd)) { /* End of header. */ if (0 == strcmp(buffer, "\n") || 0 == strcmp(buffer, "\r\n")) { break;