Shouldn't be necessary but better play it safe.
if (global_proxy_host != NULL && global_proxy_port != NULL) {
fprintf(server_fd, "CONNECT %s:%s HTTP/1.0\r\n", host, port);
fprintf(server_fd, "\r\n");
if (global_proxy_host != NULL && global_proxy_port != NULL) {
fprintf(server_fd, "CONNECT %s:%s HTTP/1.0\r\n", host, port);
fprintf(server_fd, "\r\n");
/* Read response line from proxy server. */
result = read_http_request(server_fd, buffer, sizeof(buffer));
/* Read response line from proxy server. */
result = read_http_request(server_fd, buffer, sizeof(buffer));
fprintf(client_fd, HTTP_RESPONSE_FORMAT,
RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR,
RESPONSE_MSG);
fprintf(client_fd, HTTP_RESPONSE_FORMAT,
RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR,
RESPONSE_MSG);
#undef RESPONSE_ERROR
#undef RESPONSE_MSG
}
#undef RESPONSE_ERROR
#undef RESPONSE_MSG
}
fprintf(client_fd, HTTP_RESPONSE_FORMAT,
RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR,
RESPONSE_MSG);
fprintf(client_fd, HTTP_RESPONSE_FORMAT,
RESPONSE_ERROR, RESPONSE_ERROR, RESPONSE_ERROR,
RESPONSE_MSG);
#undef RESPONSE_ERROR
#undef RESPONSE_MSG
}
#undef RESPONSE_ERROR
#undef RESPONSE_MSG
}