char host[MAX_REQUEST_LINE];
char port[5 + 1];
- int version_minor; /* HTTP/1.x */
+ int version_minor; /* x in HTTP/1.x */
int result;
/* client_x509_cred is used when talking to the client (acting as a TSL
/* Read request line (CONNECT ..) and headers (they are discarded). */
result = read_http_request(client_fd, buffer, sizeof(buffer));
if (result == -1) {
- /* Read error. */
LOG(LOG_WARNING, "read_http_request(): client read error");
goto out;
} else if (result == -2) {
- /* EOF */
LOG(LOG_WARNING, "read_http_request(): client EOF");
send_bad_request(client_fd);
goto out;
/* Read response line from proxy server. */
result = read_http_request(server_fd, buffer, sizeof(buffer));
if (result == -1) {
- /* Read error. */
LOG(LOG_WARNING, "read_http_request(): proxy read error");
send_forwarding_failure(client_fd);
goto out;
} else if (result == -2) {
- /* EOF */
LOG(LOG_WARNING, "read_http_request(): proxy EOF");
send_forwarding_failure(client_fd);
goto out;
/* Make sure the server certificate is valid and known. */
if (verify_tls_connection(server_session, host) != 0) {
LOG(LOG_ERROR, "server certificate validation failed!");
- /* We send the error message over our TLS connection to the client,
+ /* We'll send the error message over our TLS connection to the client,
* but with an invalid certificate. No data is transfered from/to the
* target server. */
validation_failed = 1;
LOG_PERROR(LOG_WARNING, "read_http_request(): fgets()");
return -1;
}
-
+ /* EOF */
return -2;
}
fds[1].revents = 0;
for (;;) {
- int result = poll(fds, 2, -1 /* no timeout */);
+ int result = poll(fds, 2 /* fd count */, -1 /* no timeout */);
if (result < 0) {
LOG_PERROR(LOG_ERROR, "transfer_data(): poll()");
return;
(long int)buffer_size);
for (;;) {
- int result = poll(fds, 2, -1 /* no timeout */);
+ int result = poll(fds, 2 /* fd count */, -1 /* no timeout */);
if (result < 0) {
LOG_PERROR(LOG_ERROR, "transfer_data(): poll()");
return;