}
/* Check response of proxy server. */
- if (strncmp(buffer, "HTTP/1.0 200", 12) != 0) {
+ if (strncmp(buffer, "HTTP/1.0 200", 12)) {
LOG(LOG_WARNING, "bad proxy response: %s", buffer);
send_forwarding_failure(client_fd);
goto out;
/* 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 = (strcmp(hostname, "invalid") == 0);
+ use_invalid_cert = (!strcmp(hostname, "invalid"));
if (proxy_certificate_path(hostname, path, sizeof(path)) != 0) {
LOG(LOG_ERROR,
while (fgets(buffer, sizeof(buffer), client_fd) != NULL) {
/* End of header. */
- if (strcmp(buffer, "\n") == 0 || strcmp(buffer, "\r\n") == 0) {
+ if (!strcmp(buffer, "\n") || !strcmp(buffer, "\r\n")) {
break;
}
}
char *position;
/* scanf() doesn't check spaces. */
- if (strncmp(request, "CONNECT ", 8) != 0) {
+ if (strncmp(request, "CONNECT ", 8)) {
return -1;
}
/* Check request and extract data, "host:port" is not yet separated. */
fclose(file);
/* Check if the server certificate matches our stored certificate. */
- if (strcmp(stored_cert, server_cert) != 0) {
+ if (strcmp(stored_cert, server_cert)) {
LOG(LOG_ERROR,
"verify_tls_connection(): server certificate changed!",
path, strerror(errno));