/* Read request line (CONNECT ..) and headers (they are discarded). */
result = read_http_request(client_fd, buffer, sizeof(buffer));
- if (result == -1) {
+ if (-1 == result) {
/* Read error. */
return;
- } else if (result == -2) {
+ } else if (-2 == result) {
/* EOF */
send_close_bad_request(client_fd);
return;
/* Read response line from proxy server. */
result = read_http_request(server_fd, buffer, sizeof(buffer));
- if (result == -1) {
+ if (-1 == result) {
/* Read error. */
send_close_forwarding_failure(client_fd);
return;
- } else if (result == -2) {
+ } else if (-2 == result) {
/* EOF */
fclose(server_fd);
send_close_forwarding_failure(client_fd);
V(ringbuffer_free);
/* Negative value indicates we should shut down our thread. */
- if (client_socket < 0) {
+ if (0 > client_socket) {
break;
}