http_header(serialized.http_header()),
stream_header(serialized.stream_header()),
has_metacube_header(serialized.has_metacube_header()),
- sock(serialized.sock())
+ sock(serialized.sock()),
+ num_connection_attempts(0),
+ suppress_logging(false)
{
pending_data.resize(serialized.pending_data().size());
memcpy(&pending_data[0], serialized.pending_data().data(), serialized.pending_data().size());
} else {
stats.connect_time = time(NULL);
}
+
+ last_verbose_connection.tv_sec = -3600;
+ last_verbose_connection.tv_nsec = 0;
}
void HTTPInput::close_socket()
addrinfo *ai;
int err = getaddrinfo(host.c_str(), port.c_str(), NULL, &ai);
if (err != 0) {
- log(WARNING, "[%s] Lookup of '%s' failed (%s).",
- url.c_str(), host.c_str(), gai_strerror(err));
+ if (!suppress_logging) {
+ log(WARNING, "[%s] Lookup of '%s' failed (%s).",
+ url.c_str(), host.c_str(), gai_strerror(err));
+ }
return -1;
}
}
// Give the last one as error.
- log(WARNING, "[%s] Connect to '%s' failed (%s)",
- url.c_str(), host.c_str(), strerror(errno));
+ if (!suppress_logging) {
+ log(WARNING, "[%s] Connect to '%s' failed (%s)",
+ url.c_str(), host.c_str(), strerror(errno));
+ }
freeaddrinfo(base_ai);
return -1;
}