shrpx: Log when SPDY stream is closed
This commit is contained in:
parent
7f481e42b0
commit
c78e0ca055
|
@ -74,4 +74,18 @@ void upstream_spdy_stream(const std::string& client_ip, int32_t stream_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void upstream_spdy_stream_close(const std::string& client_ip,
|
||||||
|
int32_t stream_id)
|
||||||
|
{
|
||||||
|
char datestr[64];
|
||||||
|
get_datestr(datestr);
|
||||||
|
fprintf(stderr, "[%s] %s SPDY stream_id=%d closed\n",
|
||||||
|
datestr, client_ip.c_str(), stream_id);
|
||||||
|
fflush(stderr);
|
||||||
|
if(get_config()->use_syslog) {
|
||||||
|
syslog(LOG_INFO, "%s SPDY stream_id=%d closed\n",
|
||||||
|
client_ip.c_str(), stream_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace shrpx
|
} // namespace shrpx
|
||||||
|
|
|
@ -33,6 +33,8 @@ namespace shrpx {
|
||||||
|
|
||||||
void upstream_connect(const std::string& client_ip);
|
void upstream_connect(const std::string& client_ip);
|
||||||
void upstream_spdy_stream(const std::string& client_ip, int32_t stream_id);
|
void upstream_spdy_stream(const std::string& client_ip, int32_t stream_id);
|
||||||
|
void upstream_spdy_stream_close(const std::string& client_ip,
|
||||||
|
int32_t stream_id);
|
||||||
|
|
||||||
} // namespace shrpx
|
} // namespace shrpx
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,10 @@ void on_stream_close_callback
|
||||||
}
|
}
|
||||||
SpdyUpstream *upstream = reinterpret_cast<SpdyUpstream*>(user_data);
|
SpdyUpstream *upstream = reinterpret_cast<SpdyUpstream*>(user_data);
|
||||||
Downstream *downstream = upstream->find_downstream(stream_id);
|
Downstream *downstream = upstream->find_downstream(stream_id);
|
||||||
|
if(get_config()->accesslog) {
|
||||||
|
upstream_spdy_stream_close(upstream->get_client_handler()->get_ipaddr(),
|
||||||
|
stream_id);
|
||||||
|
}
|
||||||
if(downstream) {
|
if(downstream) {
|
||||||
if(downstream->get_request_state() == Downstream::CONNECT_FAIL) {
|
if(downstream->get_request_state() == Downstream::CONNECT_FAIL) {
|
||||||
upstream->remove_downstream(downstream);
|
upstream->remove_downstream(downstream);
|
||||||
|
|
Loading…
Reference in New Issue