nghttpx: Log user-agent as "-" if it is empty

This commit is contained in:
Tatsuhiro Tsujikawa 2014-07-05 19:48:14 +09:00
parent 9841f778a9
commit 367e764ca3
1 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,9 @@ void upstream_accesslog(const std::string& client_ip, unsigned int status_code,
major = downstream->get_request_major();
minor = downstream->get_request_minor();
user_agent = downstream->get_request_user_agent().c_str();
if(!user_agent[0]) {
user_agent = "-";
}
response_bodylen = downstream->get_response_bodylen();
}