X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=3254982b32b22f6dc2b2bf0c8dfcdece12fcc7cb;hb=f7b1d8eb6ee068e7562553c00cd9998300ee5311;hp=aa42bfd2bffb60b9e8011b03a11c28bbbaf7013a;hpb=c51f4531e09a0fcf27aa9f3b5150fbadcf4f1a79;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index aa42bfd..3254982 100644 --- a/src/connection.c +++ b/src/connection.c @@ -144,7 +144,7 @@ void handle_connection(int client_socket) { } if (parse_request(buffer, host, port, &version_minor) != 0) { - LOG(WARNING, "bad request: %s", buffer); + LOG(WARNING, "bad request: >%s<", buffer); send_bad_request(client_fd_write); goto out; } @@ -542,14 +542,14 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) { while (fgets(buffer, sizeof(buffer), client_fd) != NULL) { const char *authentication = "Proxy-Authorization: Basic "; - if (http_digest_authorization != NULL + if (global_http_digest_authorization != NULL && !strncmp(buffer, authentication, strlen(authentication))) { found_proxy_authorization = 1; /* Check if the passphrase matches. */ strtok(buffer, "\r\n"); if (strcmp(buffer + strlen(authentication), - http_digest_authorization)) { + global_http_digest_authorization)) { return -3; } } @@ -564,7 +564,7 @@ static int read_http_request(FILE *client_fd, char *request, size_t length) { return -1; } - if (http_digest_authorization != NULL && !found_proxy_authorization) { + if (global_http_digest_authorization != NULL && !found_proxy_authorization) { return -3; }