Commit bbf6c185 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

shrpx: Log format change

Added macros which log messages from the following components are
prefixed with their component name + object pointer address:

ListenHandler: LISTEN
ThreadEventReceiver: THREAD_RECV
Upstream: UPSTREAM
Downstream: DOWNSTREAM
DownstreamConnection: DCONN
SpdySession: DSPDY
parent 4d0db62f
......@@ -43,7 +43,7 @@ void upstream_readcb(bufferevent *bev, void *arg)
ClientHandler *handler = reinterpret_cast<ClientHandler*>(arg);
int rv = handler->on_read();
if(rv != 0) {
LOG(WARNING) << "<upstream> Read operation (application level) failure";
CLOG(WARNING, handler) << "Read operation (application level) failure";
delete handler;
}
}
......@@ -65,7 +65,7 @@ void upstream_writecb(bufferevent *bev, void *arg)
Upstream *upstream = handler->get_upstream();
int rv = upstream->on_write();
if(rv != 0) {
LOG(WARNING) << "<upstream> Write operation (application level) failure";
CLOG(WARNING, handler) << "Write operation (application level) failure";
delete handler;
}
}
......@@ -79,20 +79,21 @@ void upstream_eventcb(bufferevent *bev, short events, void *arg)
bool finish = false;
if(events & BEV_EVENT_EOF) {
if(ENABLE_LOG) {
LOG(INFO) << "Upstream EOF";
CLOG(INFO, handler) << "EOF";
}
finish = true;
}
if(events & BEV_EVENT_ERROR) {
if(ENABLE_LOG) {
LOG(INFO) << "Upstream network error: "
<< evutil_socket_error_to_string(EVUTIL_SOCKET_ERROR());
CLOG(INFO, handler) << "Network error: "
<< evutil_socket_error_to_string
(EVUTIL_SOCKET_ERROR());
}
finish = true;
}
if(events & BEV_EVENT_TIMEOUT) {
if(ENABLE_LOG) {
LOG(INFO) << "Upstream time out";
CLOG(INFO, handler) << "Time out";
}
finish = true;
}
......@@ -101,13 +102,13 @@ void upstream_eventcb(bufferevent *bev, short events, void *arg)
} else {
if(events & BEV_EVENT_CONNECTED) {
if(ENABLE_LOG) {
LOG(INFO) << "Upstream connected. handler " << handler;
CLOG(INFO, handler) << "SSL/TLS handleshake completed";
}
handler->set_bev_cb(upstream_readcb, upstream_writecb, upstream_eventcb);
handler->validate_next_proto();
if(ENABLE_LOG) {
if(SSL_session_reused(handler->get_ssl())) {
LOG(INFO) << "SSL/TLS session reused";
CLOG(INFO, handler) << "SSL/TLS session reused";
}
}
// At this point, input buffer is already filled with some
......@@ -145,7 +146,7 @@ ClientHandler::ClientHandler(bufferevent *bev, int fd, SSL *ssl,
ClientHandler::~ClientHandler()
{
if(ENABLE_LOG) {
LOG(INFO) << "Deleting ClientHandler " << this;
CLOG(INFO, this) << "Deleting";
}
if(ssl_) {
SSL_shutdown(ssl_);
......@@ -163,7 +164,7 @@ ClientHandler::~ClientHandler()
delete *i;
}
if(ENABLE_LOG) {
LOG(INFO) << "Deleted";
CLOG(INFO, this) << "Deleted";
}
}
......@@ -203,7 +204,7 @@ int ClientHandler::validate_next_proto()
if(next_proto) {
if(ENABLE_LOG) {
std::string proto(next_proto, next_proto+next_proto_len);
LOG(INFO) << "Upstream negotiated next protocol: " << proto;
CLOG(INFO, this) << "The negotiated next protocol: " << proto;
}
uint16_t version = spdylay_npn_get_version(next_proto, next_proto_len);
if(version) {
......@@ -213,11 +214,11 @@ int ClientHandler::validate_next_proto()
}
} else {
if(ENABLE_LOG) {
LOG(INFO) << "No proto negotiated.";
CLOG(INFO, this) << "No proto negotiated.";
}
}
if(ENABLE_LOG) {
LOG(INFO) << "Use HTTP/1.1";
CLOG(INFO, this) << "Use HTTP/1.1";
}
HttpsUpstream *https_upstream = new HttpsUpstream(this);
upstream_ = https_upstream;
......@@ -252,7 +253,7 @@ void ClientHandler::set_should_close_after_write(bool f)
void ClientHandler::pool_downstream_connection(DownstreamConnection *dconn)
{
if(ENABLE_LOG) {
LOG(INFO) << "Pooling downstream connection " << dconn;
CLOG(INFO, this) << "Pooling downstream connection DCONN:" << dconn;
}
dconn_pool_.insert(dconn);
}
......@@ -260,8 +261,8 @@ void ClientHandler::pool_downstream_connection(DownstreamConnection *dconn)
void ClientHandler::remove_downstream_connection(DownstreamConnection *dconn)
{
if(ENABLE_LOG) {
LOG(INFO) << "Removing downstream connection " << dconn
<< " from pool";
CLOG(INFO, this) << "Removing downstream connection DCONN:" << dconn
<< " from pool";
}
dconn_pool_.erase(dconn);
}
......@@ -270,7 +271,8 @@ DownstreamConnection* ClientHandler::get_downstream_connection()
{
if(dconn_pool_.empty()) {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream connection pool is empty. Create new one";
CLOG(INFO, this) << "Downstream connection pool is empty."
<< " Create new one";
}
if(get_config()->client_mode) {
return new SpdyDownstreamConnection(this);
......@@ -281,8 +283,8 @@ DownstreamConnection* ClientHandler::get_downstream_connection()
DownstreamConnection *dconn = *dconn_pool_.begin();
dconn_pool_.erase(dconn);
if(ENABLE_LOG) {
LOG(INFO) << "Reuse downstream connection " << dconn
<< " from pool";
CLOG(INFO, this) << "Reuse downstream connection DCONN:" << dconn
<< " from pool";
}
return dconn;
}
......
......@@ -64,7 +64,7 @@ Downstream::Downstream(Upstream *upstream, int stream_id, int priority)
Downstream::~Downstream()
{
if(ENABLE_LOG) {
LOG(INFO) << "Deleting downstream " << this;
DLOG(INFO, this) << "Deleting";
}
if(response_body_buf_) {
// Passing NULL to evbuffer_free() causes segmentation fault.
......@@ -74,7 +74,7 @@ Downstream::~Downstream()
delete dconn_;
}
if(ENABLE_LOG) {
LOG(INFO) << "Deleted";
DLOG(INFO, this) << "Deleted";
}
}
......@@ -300,7 +300,7 @@ int Downstream::push_upload_data_chunk(const uint8_t *data, size_t datalen)
// Assumes that request headers have already been pushed to output
// buffer using push_request_headers().
if(!dconn_) {
LOG(WARNING) << "dconn_ is NULL";
DLOG(WARNING, this) << "dconn_ is NULL";
return 0;
}
return dconn_->push_upload_data_chunk(data, datalen);
......
......@@ -67,8 +67,7 @@ HttpDownstreamConnection::~HttpDownstreamConnection()
int HttpDownstreamConnection::attach_downstream(Downstream *downstream)
{
if(ENABLE_LOG) {
LOG(INFO) << "Attaching downstream connection " << this << " to "
<< "downstream " << downstream;
DCLOG(INFO, this) << "Attaching to DOWNSTREAM:" << downstream;
}
Upstream *upstream = downstream->get_upstream();
if(!bev_) {
......@@ -87,7 +86,7 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream)
return SHRPX_ERR_NETWORK;
}
if(ENABLE_LOG) {
LOG(INFO) << "Connecting to downstream server " << this;
DCLOG(INFO, this) << "Connecting to downstream server";
}
}
downstream->set_downstream_connection(this);
......@@ -183,8 +182,8 @@ int HttpDownstreamConnection::push_request_headers()
hdrs += "\r\n";
if(ENABLE_LOG) {
LOG(INFO) << "Downstream request headers id="
<< downstream_->get_stream_id() << "\n" << hdrs;
DCLOG(INFO, this) << "HTTP request headers. stream_id="
<< downstream_->get_stream_id() << "\n" << hdrs;
}
evbuffer *output = bufferevent_get_output(bev_);
int rv;
......@@ -220,20 +219,20 @@ int HttpDownstreamConnection::push_upload_data_chunk
res += rv;
rv = evbuffer_add(output, chunk_size_hex, rv);
if(rv == -1) {
LOG(FATAL) << "evbuffer_add() failed";
DCLOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
}
rv = evbuffer_add(output, data, datalen);
if(rv == -1) {
LOG(FATAL) << "evbuffer_add() failed";
DCLOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
res += rv;
if(chunked) {
rv = evbuffer_add(output, "\r\n", 2);
if(rv == -1) {
LOG(FATAL) << "evbuffer_add() failed";
DCLOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
res += 2;
......@@ -246,7 +245,7 @@ int HttpDownstreamConnection::end_upload_data()
if(downstream_->get_chunked_request()) {
evbuffer *output = bufferevent_get_output(bev_);
if(evbuffer_add(output, "0\r\n\r\n", 5) != 0) {
LOG(FATAL) << "evbuffer_add() failed";
DCLOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
}
......@@ -263,21 +262,21 @@ void idle_eventcb(bufferevent *bev, short events, void *arg)
// Downstream was detached before connection established?
// This may be safe to be left.
if(ENABLE_LOG) {
LOG(INFO) << "Idle downstream connected?" << dconn;
DCLOG(INFO, dconn) << "Idle connection connected?";
}
return;
}
if(events & BEV_EVENT_EOF) {
if(ENABLE_LOG) {
LOG(INFO) << "Idle downstream connection EOF " << dconn;
DCLOG(INFO, dconn) << "Idle connection EOF";
}
} else if(events & BEV_EVENT_TIMEOUT) {
if(ENABLE_LOG) {
LOG(INFO) << "Idle downstream connection timeout " << dconn;
DCLOG(INFO, dconn) << "Idle connection timeout";
}
} else if(events & BEV_EVENT_ERROR) {
if(ENABLE_LOG) {
LOG(INFO) << "Idle downstream connection error " << dconn;
DCLOG(INFO, dconn) << "Idle connection network error";
}
}
ClientHandler *client_handler = dconn->get_client_handler();
......@@ -289,8 +288,7 @@ void idle_eventcb(bufferevent *bev, short events, void *arg)
void HttpDownstreamConnection::detach_downstream(Downstream *downstream)
{
if(ENABLE_LOG) {
LOG(INFO) << "Detaching downstream connection " << this << " from "
<< "downstream " << downstream;
DCLOG(INFO, this) << "Detaching from DOWNSTREAM:" << downstream;
}
downstream->set_downstream_connection(0);
downstream_ = 0;
......@@ -434,9 +432,9 @@ int HttpDownstreamConnection::on_read()
return 0;
} else {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream HTTP parser failure: "
<< "(" << http_errno_name(htperr) << ") "
<< http_errno_description(htperr);
DCLOG(INFO, this) << "HTTP parser failure: "
<< "(" << http_errno_name(htperr) << ") "
<< http_errno_description(htperr);
}
return SHRPX_ERR_HTTP_PARSE;
}
......
......@@ -74,7 +74,7 @@ int htp_msg_begin(http_parser *htp)
HttpsUpstream *upstream;
upstream = reinterpret_cast<HttpsUpstream*>(htp->data);
if(ENABLE_LOG) {
LOG(INFO) << "Upstream http request start " << upstream;
ULOG(INFO, upstream) << "HTTP request started";
}
upstream->reset_current_header_length();
Downstream *downstream = new Downstream(upstream, 0, 0);
......@@ -131,7 +131,7 @@ int htp_hdrs_completecb(http_parser *htp)
HttpsUpstream *upstream;
upstream = reinterpret_cast<HttpsUpstream*>(htp->data);
if(ENABLE_LOG) {
LOG(INFO) << "Upstream http request headers complete " << upstream;
ULOG(INFO, upstream) << "HTTP request headers completed";
}
Downstream *downstream = upstream->get_downstream();
......@@ -151,7 +151,7 @@ int htp_hdrs_completecb(http_parser *htp)
for(size_t i = 0; i < headers.size(); ++i) {
ss << headers[i].first << ": " << headers[i].second << "\n";
}
LOG(INFO) << "Upstream http request headers\n" << ss.str();
ULOG(INFO, upstream) << "HTTP request headers\n" << ss.str();
}
if(get_config()->client_proxy &&
......@@ -176,7 +176,7 @@ int htp_hdrs_completecb(http_parser *htp)
static const char reply_100[] = "HTTP/1.1 100 Continue\r\n\r\n";
if(bufferevent_write(upstream->get_client_handler()->get_bev(),
reply_100, sizeof(reply_100)-1) != 0) {
LOG(FATAL) << "bufferevent_write() faild";
ULOG(FATAL, upstream) << "bufferevent_write() faild";
return -1;
}
}
......@@ -218,11 +218,11 @@ namespace {
int htp_msg_completecb(http_parser *htp)
{
int rv;
if(ENABLE_LOG) {
LOG(INFO) << "Upstream http request complete";
}
HttpsUpstream *upstream;
upstream = reinterpret_cast<HttpsUpstream*>(htp->data);
if(ENABLE_LOG) {
ULOG(INFO, upstream) << "HTTP request completed";
}
Downstream *downstream = upstream->get_downstream();
downstream->set_request_state(Downstream::MSG_COMPLETE);
rv = downstream->end_upload_data();
......@@ -294,8 +294,9 @@ int HttpsUpstream::on_read()
if(downstream) {
if(downstream->get_request_state() == Downstream::INITIAL &&
current_header_length_ > SHRPX_HTTPS_MAX_HEADER_LENGTH) {
LOG(WARNING) << "Request Header too long:" << current_header_length_
<< " bytes";
ULOG(WARNING, this) << "Request Header too long:"
<< current_header_length_
<< " bytes";
get_client_handler()->set_should_close_after_write(true);
pause_read(SHRPX_MSG_BLOCK);
if(error_reply(400) != 0) {
......@@ -303,16 +304,16 @@ int HttpsUpstream::on_read()
}
} else if(downstream->get_output_buffer_full()) {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream output buffer is full";
ULOG(INFO, this) << "Downstream output buffer is full";
}
pause_read(SHRPX_NO_BUFFER);
}
}
} else {
if(ENABLE_LOG) {
LOG(INFO) << "Upstream http parse failure: "
<< "(" << http_errno_name(htperr) << ") "
<< http_errno_description(htperr);
ULOG(INFO, this) << "HTTP parse failure: "
<< "(" << http_errno_name(htperr) << ") "
<< http_errno_description(htperr);
}
get_client_handler()->set_should_close_after_write(true);
pause_read(SHRPX_MSG_BLOCK);
......@@ -451,18 +452,17 @@ void https_downstream_eventcb(bufferevent *bev, short events, void *ptr)
upstream = static_cast<HttpsUpstream*>(downstream->get_upstream());
if(events & BEV_EVENT_CONNECTED) {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream connection established. downstream "
<< downstream;
DCLOG(INFO, dconn) << "Connection established";
}
} else if(events & BEV_EVENT_EOF) {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream EOF. stream_id="
<< downstream->get_stream_id();
DCLOG(INFO, dconn) << "EOF";
}
if(downstream->get_response_state() == Downstream::HEADER_COMPLETE) {
// Server may indicate the end of the request by EOF
if(ENABLE_LOG) {
LOG(INFO) << "Downstream body was ended by EOF";
DCLOG(INFO, dconn) << "The end of the response body was indicated by "
<< "EOF";
}
upstream->on_downstream_body_complete(downstream);
downstream->set_response_state(Downstream::MSG_COMPLETE);
......@@ -481,7 +481,7 @@ void https_downstream_eventcb(bufferevent *bev, short events, void *ptr)
} else {
// error
if(ENABLE_LOG) {
LOG(INFO) << "Treated as downstream error";
DCLOG(INFO, dconn) << "Treated as error";
}
if(upstream->error_reply(502) != 0) {
delete upstream->get_client_handler();
......@@ -494,7 +494,11 @@ void https_downstream_eventcb(bufferevent *bev, short events, void *ptr)
}
} else if(events & (BEV_EVENT_ERROR | BEV_EVENT_TIMEOUT)) {
if(ENABLE_LOG) {
LOG(INFO) << "Downstream error/timeout. " << downstream;
if(events & BEV_EVENT_ERROR) {
DCLOG(INFO, dconn) << "Network error";
} else {
DCLOG(INFO, dconn) << "Timeout";
}
}
if(downstream->get_response_state() == Downstream::INITIAL) {
int status;
......@@ -532,7 +536,7 @@ int HttpsUpstream::error_reply(int status_code)
evbuffer *output = bufferevent_get_output(handler_->get_bev());
if(evbuffer_add(output, header.c_str(), header.size()) != 0 ||
evbuffer_add(output, html.c_str(), html.size()) != 0) {
LOG(FATAL) << "evbuffer_add() failed";
ULOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
Downstream *downstream = get_downstream();
......@@ -577,7 +581,7 @@ Downstream* HttpsUpstream::get_downstream() const
int HttpsUpstream::on_downstream_header_complete(Downstream *downstream)
{
if(ENABLE_LOG) {
LOG(INFO) << "Downstream on_downstream_header_complete";
DLOG(INFO, downstream) << "HTTP response header completed";
}
std::string via_value;
char temp[16];
......@@ -627,11 +631,11 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream)
hdrs += "\r\n";
hdrs += "\r\n";
if(ENABLE_LOG) {
LOG(INFO) << "Upstream http response headers\n" << hdrs;
ULOG(INFO, this) << "HTTP response headers\n" << hdrs;
}
evbuffer *output = bufferevent_get_output(handler_->get_bev());
if(evbuffer_add(output, hdrs.c_str(), hdrs.size()) != 0) {
LOG(FATAL) << "evbuffer_add() failed";
ULOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
return 0;
......@@ -647,7 +651,7 @@ int HttpsUpstream::on_downstream_body(Downstream *downstream,
rv = snprintf(chunk_size_hex, sizeof(chunk_size_hex), "%X\r\n",
static_cast<unsigned int>(len));
if(evbuffer_add(output, chunk_size_hex, rv) != 0) {
LOG(FATAL) << "evbuffer_add() failed";
ULOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
}
......@@ -663,12 +667,12 @@ int HttpsUpstream::on_downstream_body_complete(Downstream *downstream)
if(downstream->get_chunked_response()) {
evbuffer *output = bufferevent_get_output(handler_->get_bev());
if(evbuffer_add(output, "0\r\n\r\n", 5) != 0) {
LOG(FATAL) << "evbuffer_add() failed";
ULOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
}
if(ENABLE_LOG) {
LOG(INFO) << "Downstream on_downstream_body_complete";
DLOG(INFO, downstream) << "HTTP response completed";
}
if(downstream->get_request_connection_close() ||
downstream->get_response_connection_close()) {
......
......@@ -66,13 +66,13 @@ void ListenHandler::create_worker_thread(size_t num)
WorkerInfo *info = &workers_[num_worker_];
rv = socketpair(AF_UNIX, SOCK_STREAM, 0, info->sv);
if(rv == -1) {
LOG(ERROR) << "socketpair() failed: " << strerror(errno);
LLOG(ERROR, this) << "socketpair() failed: " << strerror(errno);
continue;
}
info->ssl_ctx = ssl_ctx_;
rv = pthread_create(&thread, &attr, start_threaded_worker, info);
if(rv != 0) {
LOG(ERROR) << "pthread_create() failed: " << strerror(rv);
LLOG(ERROR, this) << "pthread_create() failed: " << strerror(rv);
for(size_t j = 0; j < 2; ++j) {
close(info->sv[j]);
}
......@@ -82,7 +82,7 @@ void ListenHandler::create_worker_thread(size_t num)
BEV_OPT_DEFER_CALLBACKS);
info->bev = bev;
if(ENABLE_LOG) {
LOG(INFO) << "Created thread#" << num_worker_;
LLOG(INFO, this) << "Created thread #" << num_worker_;
}
++num_worker_;
}
......@@ -92,7 +92,7 @@ int ListenHandler::accept_connection(evutil_socket_t fd,
sockaddr *addr, int addrlen)
{
if(ENABLE_LOG) {
LOG(INFO) << "<listener> Accepted connection. fd=" << fd;
LLOG(INFO, this) << "Accepted connection. fd=" << fd;
}
if(num_worker_ == 0) {
ClientHandler* client =
......
......@@ -35,6 +35,37 @@ namespace shrpx {
#define LOG(SEVERITY) Log(SEVERITY, __FILE__, __LINE__)
// Listener log
#define LLOG(SEVERITY, LISTEN) \
(Log(SEVERITY, __FILE__, __LINE__) << "[LISTEN:" << LISTEN \
<< "] ")
// ThreadEventReceiver log
#define TLOG(SEVERITY, THREAD_RECV) \
(Log(SEVERITY, __FILE__, __LINE__) << "[THREAD_RECV:" << THREAD_RECV \
<< "] ")
// ClientHandler log
#define CLOG(SEVERITY, CLIENT_HANDLER) \
(Log(SEVERITY, __FILE__, __LINE__) << "[CLIENT_HANDLER:" << CLIENT_HANDLER \
<< "] ")
// Upstream log
#define ULOG(SEVERITY, UPSTREAM) \
(Log(SEVERITY, __FILE__, __LINE__) << "[UPSTREAM:" << UPSTREAM << "] ")
// Downstream log
#define DLOG(SEVERITY, DOWNSTREAM) \
(Log(SEVERITY, __FILE__, __LINE__) << "[DOWNSTREAM:" << DOWNSTREAM << "] ")
// Downstream connection log
#define DCLOG(SEVERITY, DCONN) \
(Log(SEVERITY, __FILE__, __LINE__) << "[DCONN:" << DCONN << "] ")
// Downstream SPDY session log
#define SSLOG(SEVERITY, SPDY) \
(Log(SEVERITY, __FILE__, __LINE__) << "[DSPDY:" << SPDY << "] ")
enum SeverityLevel {
INFO, WARNING, ERROR, FATAL
};
......
......@@ -90,8 +90,7 @@ int SpdyDownstreamConnection::init_request_body_buf()
int SpdyDownstreamConnection::attach_downstream(Downstream *downstream)
{
if(ENABLE_LOG) {
LOG(INFO) << "Attaching downstream connection " << this << " to "
<< "downstream " << downstream;
DCLOG(INFO, this) << "Attaching to DOWNSTREAM:" << downstream;
}
if(init_request_body_buf() == -1) {
return -1;
......@@ -109,8 +108,7 @@ int SpdyDownstreamConnection::attach_downstream(Downstream *downstream)
void SpdyDownstreamConnection::detach_downstream(Downstream *downstream)
{
if(ENABLE_LOG) {
LOG(INFO) << "Detaching spdy downstream connection " << this << " from "
<< "downstream " << downstream;
DCLOG(INFO, this) << "Detaching from DOWNSTREAM:" << downstream;
}
downstream->set_downstream_connection(0);
downstream_ = 0;
......@@ -298,9 +296,7 @@ int SpdyDownstreamConnection::push_request_headers()
for(size_t i = 0; nv[i]; i += 2) {
ss << nv[i] << ": " << nv[i+1] << "\n";
}
LOG(INFO) << "Downstream spdy request headers id="
<< downstream_->get_stream_id() << "\n"
<< ss.str();
DCLOG(INFO, this) << "HTTP request headers\n" << ss.str();
}
if(downstream_->get_request_method() == "CONNECT" ||
......@@ -315,7 +311,7 @@ int SpdyDownstreamConnection::push_request_headers()
}
delete [] nv;
if(rv != 0) {
LOG(FATAL) << "spdylay_submit_request() failed";
DCLOG(FATAL, this) << "spdylay_submit_request() failed";
return -1;
}
spdy_->notify();
......@@ -327,7 +323,7 @@ int SpdyDownstreamConnection::push_upload_data_chunk(const uint8_t *data,
{
int rv = evbuffer_add(request_body_buf_, data, datalen);
if(rv != 0) {
LOG(FATAL) << "evbuffer_add() failed";
DCLOG(FATAL, this) << "evbuffer_add() failed";
return -1;
}
if(downstream_->get_downstream_stream_id() != -1) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,8 +48,8 @@ void ThreadEventReceiver::on_read(bufferevent *bev)
WorkerEvent wev;
evbuffer_remove(input, &wev, sizeof(WorkerEvent));
if(ENABLE_LOG) {
LOG(INFO) << "WorkerEvent: client_fd=" << wev.client_fd
<< ", addrlen=" << wev.client_addrlen;
TLOG(INFO, this) << "WorkerEvent: client_fd=" << wev.client_fd
<< ", addrlen=" << wev.client_addrlen;
}
event_base *evbase = bufferevent_get_base(bev);
ClientHandler *client_handler;
......@@ -60,11 +60,11 @@ void ThreadEventReceiver::on_read(bufferevent *bev)
if(client_handler) {
client_handler->set_spdy_session(spdy_);
if(ENABLE_LOG) {
LOG(INFO) << "ClientHandler " << client_handler << " created";
TLOG(INFO, this) << "CLIENT_HANDLER:" << client_handler << " created";
}
} else {
if(ENABLE_LOG) {
LOG(ERROR) << "ClientHandler creation failed";
TLOG(ERROR, this) << "ClientHandler creation failed";
}
close(wev.client_fd);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment