@@ -895,7 +895,7 @@ int HttpHandler::sendFile() {
895895 int readbytes = MIN (file->buf .len , resp->content_length );
896896 size_t nread = file->read (file->buf .base , readbytes);
897897 if (nread <= 0 ) {
898- hloge (" read file error!" );
898+ hloge (" read file: %s error!" , file-> filepath );
899899 error = ERR_READ_FILE;
900900 writer->close (true );
901901 return nread;
@@ -967,7 +967,7 @@ int HttpHandler::upgradeWebSocket() {
967967 if (iter_protocol != req->headers .end ()) {
968968 hv::StringList subprotocols = hv::split (iter_protocol->second , ' ,' );
969969 if (subprotocols.size () > 0 ) {
970- hlogw (" %s: %s => just select first protocol %s" , SEC_WEBSOCKET_PROTOCOL, iter_protocol->second .c_str (), subprotocols[0 ].c_str ());
970+ hlogw (" [ %s:%d] %s: %s => just select first protocol %s" , ip, port , SEC_WEBSOCKET_PROTOCOL, iter_protocol->second .c_str (), subprotocols[0 ].c_str ());
971971 resp->headers [SEC_WEBSOCKET_PROTOCOL] = subprotocols[0 ];
972972 }
973973 }
@@ -997,7 +997,7 @@ int HttpHandler::upgradeHTTP2() {
997997 SendHttpResponse ();
998998
999999 if (!SwitchHTTP2 ()) {
1000- hloge (" [%s:%d] unsupported HTTP2" , ip, port);
1000+ hlogw (" [%s:%d] unsupported HTTP2" , ip, port);
10011001 return SetError (ERR_INVALID_PROTOCOL);
10021002 }
10031003
@@ -1024,7 +1024,7 @@ int HttpHandler::handleForwardProxy() {
10241024 if (service && service->enable_forward_proxy ) {
10251025 return connectProxy (req->url );
10261026 } else {
1027- hlogw (" Forbidden to forward proxy %s" , req->url .c_str ());
1027+ hlogw (" [%s:%d] Forbidden to forward proxy %s" , ip, port , req->url .c_str ());
10281028 SetError (HTTP_STATUS_FORBIDDEN, HTTP_STATUS_FORBIDDEN);
10291029 }
10301030 return 0 ;
@@ -1057,7 +1057,7 @@ int HttpHandler::connectProxy(const std::string& strUrl) {
10571057 }
10581058
10591059 if (forward_proxy && !service->IsTrustProxy (url.host .c_str ())) {
1060- hlogw (" Forbidden to proxy %s" , url.host .c_str ());
1060+ hlogw (" [%s:%d] Forbidden to proxy %s" , ip, port , url.host .c_str ());
10611061 SetError (HTTP_STATUS_FORBIDDEN, HTTP_STATUS_FORBIDDEN);
10621062 return 0 ;
10631063 }
0 commit comments