nghttpx: Replace WARNING with WARN for consistency
This commit is contained in:
parent
1119701071
commit
ce71e65aee
18
src/shrpx.cc
18
src/shrpx.cc
|
@ -195,7 +195,7 @@ evconnlistener* create_evlistener(ListenHandler *handler, int family)
|
||||||
return new_evlistener(handler, fd);
|
return new_evlistener(handler, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(WARNING) << "Port was changed between old binary (" << port
|
LOG(WARN) << "Port was changed between old binary (" << port
|
||||||
<< ") and new binary (" << get_config()->port << ")";
|
<< ") and new binary (" << get_config()->port << ")";
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ evconnlistener* create_evlistener(ListenHandler *handler, int family)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!rp) {
|
if(!rp) {
|
||||||
LOG(WARNING) << "Listening " << (family == AF_INET ? "IPv4" : "IPv6")
|
LOG(WARN) << "Listening " << (family == AF_INET ? "IPv4" : "IPv6")
|
||||||
<< " socket failed";
|
<< " socket failed";
|
||||||
|
|
||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
|
@ -270,7 +270,7 @@ evconnlistener* create_evlistener(ListenHandler *handler, int family)
|
||||||
freeaddrinfo(res);
|
freeaddrinfo(res);
|
||||||
|
|
||||||
if(rv != 0) {
|
if(rv != 0) {
|
||||||
LOG(WARNING) << gai_strerror(rv);
|
LOG(WARN) << gai_strerror(rv);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ void save_pid()
|
||||||
if(chown(get_config()->pid_file.get(),
|
if(chown(get_config()->pid_file.get(),
|
||||||
get_config()->uid, get_config()->gid) == -1) {
|
get_config()->uid, get_config()->gid) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
LOG(WARNING) << "Changing owner of pid file "
|
LOG(WARN) << "Changing owner of pid file "
|
||||||
<< get_config()->pid_file.get()
|
<< get_config()->pid_file.get()
|
||||||
<< " failed: "
|
<< " failed: "
|
||||||
<< strerror(error);
|
<< strerror(error);
|
||||||
|
@ -1338,7 +1338,7 @@ int main(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
#ifdef NOTHREADS
|
#ifdef NOTHREADS
|
||||||
LOG(WARNING) << "Threading disabled at build time, no threads created.";
|
LOG(WARN) << "Threading disabled at build time, no threads created.";
|
||||||
#else
|
#else
|
||||||
cmdcfgs.emplace_back(SHRPX_OPT_WORKERS, optarg);
|
cmdcfgs.emplace_back(SHRPX_OPT_WORKERS, optarg);
|
||||||
#endif // NOTHREADS
|
#endif // NOTHREADS
|
||||||
|
@ -1664,14 +1664,14 @@ int main(int argc, char **argv)
|
||||||
fchown(worker_config->accesslog_fd,
|
fchown(worker_config->accesslog_fd,
|
||||||
get_config()->uid, get_config()->gid) == -1) {
|
get_config()->uid, get_config()->gid) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
LOG(WARNING) << "Changing owner of access log file failed: "
|
LOG(WARN) << "Changing owner of access log file failed: "
|
||||||
<< strerror(error);
|
<< strerror(error);
|
||||||
}
|
}
|
||||||
if(worker_config->errorlog_fd != -1 &&
|
if(worker_config->errorlog_fd != -1 &&
|
||||||
fchown(worker_config->errorlog_fd,
|
fchown(worker_config->errorlog_fd,
|
||||||
get_config()->uid, get_config()->gid) == -1) {
|
get_config()->uid, get_config()->gid) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
LOG(WARNING) << "Changing owner of error log file failed: "
|
LOG(WARN) << "Changing owner of error log file failed: "
|
||||||
<< strerror(error);
|
<< strerror(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1691,7 +1691,7 @@ int main(int argc, char **argv)
|
||||||
if(get_config()->uid != 0) {
|
if(get_config()->uid != 0) {
|
||||||
if(chown(path, get_config()->uid, get_config()->gid) == -1) {
|
if(chown(path, get_config()->uid, get_config()->gid) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
LOG(WARNING) << "Changing owner of http2 upstream request header file "
|
LOG(WARN) << "Changing owner of http2 upstream request header file "
|
||||||
<< path
|
<< path
|
||||||
<< " failed: "
|
<< " failed: "
|
||||||
<< strerror(error);
|
<< strerror(error);
|
||||||
|
@ -1714,7 +1714,7 @@ int main(int argc, char **argv)
|
||||||
if(get_config()->uid != 0) {
|
if(get_config()->uid != 0) {
|
||||||
if(chown(path, get_config()->uid, get_config()->gid) == -1) {
|
if(chown(path, get_config()->uid, get_config()->gid) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
LOG(WARNING) << "Changing owner of http2 upstream response header file"
|
LOG(WARN) << "Changing owner of http2 upstream response header file"
|
||||||
<< " "
|
<< " "
|
||||||
<< path
|
<< path
|
||||||
<< " failed: "
|
<< " failed: "
|
||||||
|
|
|
@ -943,7 +943,7 @@ int parse_config(const char *opt, const char *optarg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(util::strieq(opt, "conf")) {
|
if(util::strieq(opt, "conf")) {
|
||||||
LOG(WARNING) << "conf: ignored";
|
LOG(WARN) << "conf: ignored";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void ConnectBlocker::on_failure()
|
||||||
|
|
||||||
sleep_ = std::min(128, sleep_ * 2);
|
sleep_ = std::min(128, sleep_ * 2);
|
||||||
|
|
||||||
LOG(WARNING) << "connect failure, start sleeping " << sleep_;
|
LOG(WARN) << "connect failure, start sleeping " << sleep_;
|
||||||
|
|
||||||
timeval t = {sleep_, 0};
|
timeval t = {sleep_, 0};
|
||||||
|
|
||||||
|
|
|
@ -975,7 +975,7 @@ event* init_timer(event_base *evbase, event_callback_fn cb, void *arg)
|
||||||
auto timerev = evtimer_new(evbase, cb, arg);
|
auto timerev = evtimer_new(evbase, cb, arg);
|
||||||
|
|
||||||
if(timerev == nullptr) {
|
if(timerev == nullptr) {
|
||||||
LOG(WARNING) << "timer initialization failed";
|
LOG(WARN) << "timer initialization failed";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ int Http2Session::disconnect()
|
||||||
if(fd_ == -1) {
|
if(fd_ == -1) {
|
||||||
fd_ = fd;
|
fd_ = fd;
|
||||||
} else if(fd != fd_) {
|
} else if(fd != fd_) {
|
||||||
SSLOG(WARNING, this) << "fd in bev_ != fd_";
|
SSLOG(WARN, this) << "fd in bev_ != fd_";
|
||||||
shutdown(fd, SHUT_WR);
|
shutdown(fd, SHUT_WR);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ void eventcb(bufferevent *bev, short events, void *ptr)
|
||||||
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
||||||
reinterpret_cast<char*>(&val), sizeof(val)) == -1) {
|
reinterpret_cast<char*>(&val), sizeof(val)) == -1) {
|
||||||
auto error = errno;
|
auto error = errno;
|
||||||
SSLOG(WARNING, http2session)
|
SSLOG(WARN, http2session)
|
||||||
<< "Setting option TCP_NODELAY failed: errno=" << error;
|
<< "Setting option TCP_NODELAY failed: errno=" << error;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -575,7 +575,7 @@ int htp_hdrs_completecb(http_parser *htp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSLOG(WARNING, http2session) << "Tunneling failed";
|
SSLOG(WARN, http2session) << "Tunneling failed";
|
||||||
http2session->set_state(Http2Session::PROXY_FAILED);
|
http2session->set_state(Http2Session::PROXY_FAILED);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1314,7 +1314,7 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
int lib_error_code, void *user_data)
|
int lib_error_code, void *user_data)
|
||||||
{
|
{
|
||||||
auto http2session = static_cast<Http2Session*>(user_data);
|
auto http2session = static_cast<Http2Session*>(user_data);
|
||||||
SSLOG(WARNING, http2session) << "Failed to send control frame type="
|
SSLOG(WARN, http2session) << "Failed to send control frame type="
|
||||||
<< static_cast<uint32_t>(frame->hd.type)
|
<< static_cast<uint32_t>(frame->hd.type)
|
||||||
<< "lib_error_code=" << lib_error_code << ":"
|
<< "lib_error_code=" << lib_error_code << ":"
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< nghttp2_strerror(lib_error_code);
|
||||||
|
@ -1649,7 +1649,7 @@ int Http2Session::consume(int32_t stream_id, size_t len)
|
||||||
rv = nghttp2_session_consume(session_, stream_id, len);
|
rv = nghttp2_session_consume(session_, stream_id, len);
|
||||||
|
|
||||||
if(rv != 0) {
|
if(rv != 0) {
|
||||||
SSLOG(WARNING, this) << "nghttp2_session_consume() returned error: "
|
SSLOG(WARN, this) << "nghttp2_session_consume() returned error: "
|
||||||
<< nghttp2_strerror(rv);
|
<< nghttp2_strerror(rv);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -125,7 +125,7 @@ int Http2Upstream::upgrade_upstream(HttpsUpstream *http)
|
||||||
settings_payload.size(),
|
settings_payload.size(),
|
||||||
nullptr);
|
nullptr);
|
||||||
if(rv != 0) {
|
if(rv != 0) {
|
||||||
ULOG(WARNING, this) << "nghttp2_session_upgrade() returned error: "
|
ULOG(WARN, this) << "nghttp2_session_upgrade() returned error: "
|
||||||
<< nghttp2_strerror(rv);
|
<< nghttp2_strerror(rv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -603,7 +603,7 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
int lib_error_code, void *user_data)
|
int lib_error_code, void *user_data)
|
||||||
{
|
{
|
||||||
auto upstream = static_cast<Http2Upstream*>(user_data);
|
auto upstream = static_cast<Http2Upstream*>(user_data);
|
||||||
ULOG(WARNING, upstream) << "Failed to send control frame type="
|
ULOG(WARN, upstream) << "Failed to send control frame type="
|
||||||
<< static_cast<uint32_t>(frame->hd.type)
|
<< static_cast<uint32_t>(frame->hd.type)
|
||||||
<< ", lib_error_code=" << lib_error_code << ":"
|
<< ", lib_error_code=" << lib_error_code << ":"
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< nghttp2_strerror(lib_error_code);
|
||||||
|
@ -924,7 +924,7 @@ void downstream_eventcb(bufferevent *bev, short events, void *ptr)
|
||||||
int val = 1;
|
int val = 1;
|
||||||
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
||||||
reinterpret_cast<char*>(&val), sizeof(val)) == -1) {
|
reinterpret_cast<char*>(&val), sizeof(val)) == -1) {
|
||||||
DCLOG(WARNING, dconn) << "Setting option TCP_NODELAY failed: errno="
|
DCLOG(WARN, dconn) << "Setting option TCP_NODELAY failed: errno="
|
||||||
<< errno;
|
<< errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1425,7 +1425,7 @@ int Http2Upstream::consume(int32_t stream_id, size_t len)
|
||||||
rv = nghttp2_session_consume(session_, stream_id, len);
|
rv = nghttp2_session_consume(session_, stream_id, len);
|
||||||
|
|
||||||
if(rv != 0) {
|
if(rv != 0) {
|
||||||
ULOG(WARNING, this) << "nghttp2_session_consume() returned error: "
|
ULOG(WARN, this) << "nghttp2_session_consume() returned error: "
|
||||||
<< nghttp2_strerror(rv);
|
<< nghttp2_strerror(rv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ int severity_to_syslog_level(int severity)
|
||||||
return LOG_INFO;
|
return LOG_INFO;
|
||||||
case(NOTICE):
|
case(NOTICE):
|
||||||
return LOG_NOTICE;
|
return LOG_NOTICE;
|
||||||
case(WARNING):
|
case(WARN):
|
||||||
return LOG_WARNING;
|
return LOG_WARNING;
|
||||||
case(ERROR):
|
case(ERROR):
|
||||||
return LOG_ERR;
|
return LOG_ERR;
|
||||||
|
|
|
@ -71,7 +71,7 @@ class Downstream;
|
||||||
(Log(SEVERITY, __FILE__, __LINE__) << "[DHTTP2:" << HTTP2 << "] ")
|
(Log(SEVERITY, __FILE__, __LINE__) << "[DHTTP2:" << HTTP2 << "] ")
|
||||||
|
|
||||||
enum SeverityLevel {
|
enum SeverityLevel {
|
||||||
INFO, NOTICE, WARNING, ERROR, FATAL
|
INFO, NOTICE, WARN, ERROR, FATAL
|
||||||
};
|
};
|
||||||
|
|
||||||
class Log {
|
class Log {
|
||||||
|
|
|
@ -384,7 +384,7 @@ void on_ctrl_not_send_callback(spdylay_session *session,
|
||||||
int error_code, void *user_data)
|
int error_code, void *user_data)
|
||||||
{
|
{
|
||||||
auto upstream = static_cast<SpdyUpstream*>(user_data);
|
auto upstream = static_cast<SpdyUpstream*>(user_data);
|
||||||
ULOG(WARNING, upstream) << "Failed to send control frame type=" << type
|
ULOG(WARN, upstream) << "Failed to send control frame type=" << type
|
||||||
<< ", error_code=" << error_code << ":"
|
<< ", error_code=" << error_code << ":"
|
||||||
<< spdylay_strerror(error_code);
|
<< spdylay_strerror(error_code);
|
||||||
if(type == SPDYLAY_SYN_REPLY) {
|
if(type == SPDYLAY_SYN_REPLY) {
|
||||||
|
@ -658,7 +658,7 @@ void spdy_downstream_eventcb(bufferevent *bev, short events, void *ptr)
|
||||||
int val = 1;
|
int val = 1;
|
||||||
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
if(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
||||||
reinterpret_cast<char *>(&val), sizeof(val)) == -1) {
|
reinterpret_cast<char *>(&val), sizeof(val)) == -1) {
|
||||||
DCLOG(WARNING, dconn) << "Setting option TCP_NODELAY failed: errno="
|
DCLOG(WARN, dconn) << "Setting option TCP_NODELAY failed: errno="
|
||||||
<< errno;
|
<< errno;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1134,7 +1134,7 @@ int SpdyUpstream::consume(int32_t stream_id, size_t len)
|
||||||
rv = spdylay_session_consume(session_, stream_id, len);
|
rv = spdylay_session_consume(session_, stream_id, len);
|
||||||
|
|
||||||
if(rv != 0) {
|
if(rv != 0) {
|
||||||
ULOG(WARNING, this) << "spdylay_session_consume() returned error: "
|
ULOG(WARN, this) << "spdylay_session_consume() returned error: "
|
||||||
<< spdylay_strerror(rv);
|
<< spdylay_strerror(rv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,7 +405,7 @@ SSL_CTX* create_ssl_client_context()
|
||||||
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
|
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
|
||||||
|
|
||||||
if(SSL_CTX_set_default_verify_paths(ssl_ctx) != 1) {
|
if(SSL_CTX_set_default_verify_paths(ssl_ctx) != 1) {
|
||||||
LOG(WARNING) << "Could not load system trusted ca certificates: "
|
LOG(WARN) << "Could not load system trusted ca certificates: "
|
||||||
<< ERR_error_string(ERR_get_error(), nullptr);
|
<< ERR_error_string(ERR_get_error(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,8 +481,7 @@ ClientHandler* accept_connection
|
||||||
rv = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
rv = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
||||||
reinterpret_cast<char *>(&val), sizeof(val));
|
reinterpret_cast<char *>(&val), sizeof(val));
|
||||||
if(rv == -1) {
|
if(rv == -1) {
|
||||||
LOG(WARNING) << "Setting option TCP_NODELAY failed: errno="
|
LOG(WARN) << "Setting option TCP_NODELAY failed: errno=" << errno;
|
||||||
<< errno;
|
|
||||||
}
|
}
|
||||||
SSL *ssl = nullptr;
|
SSL *ssl = nullptr;
|
||||||
bufferevent *bev;
|
bufferevent *bev;
|
||||||
|
@ -634,7 +633,7 @@ void get_altnames(X509 *cert,
|
||||||
}
|
}
|
||||||
X509_NAME *subjectname = X509_get_subject_name(cert);
|
X509_NAME *subjectname = X509_get_subject_name(cert);
|
||||||
if(!subjectname) {
|
if(!subjectname) {
|
||||||
LOG(WARNING) << "Could not get X509 name object from the certificate.";
|
LOG(WARN) << "Could not get X509 name object from the certificate.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int lastpos = -1;
|
int lastpos = -1;
|
||||||
|
|
Loading…
Reference in New Issue