@@ -881,7 +881,7 @@ int HttpHandler::sendFile() {
881881 int readbytes = MIN (file->buf .len , resp->content_length );
882882 size_t nread = file->read (file->buf .base , readbytes);
883883 if (nread <= 0 ) {
884- hloge (" read file error!" );
884+ hloge (" read file: %s error!" , file-> filepath );
885885 error = ERR_READ_FILE;
886886 writer->close (true );
887887 return nread;
@@ -953,7 +953,7 @@ int HttpHandler::upgradeWebSocket() {
953953 if (iter_protocol != req->headers .end ()) {
954954 hv::StringList subprotocols = hv::split (iter_protocol->second , ' ,' );
955955 if (subprotocols.size () > 0 ) {
956- hlogw (" %s: %s => just select first protocol %s" , SEC_WEBSOCKET_PROTOCOL, iter_protocol->second .c_str (), subprotocols[0 ].c_str ());
956+ hlogw (" [ %s:%d] %s: %s => just select first protocol %s" , ip, port , SEC_WEBSOCKET_PROTOCOL, iter_protocol->second .c_str (), subprotocols[0 ].c_str ());
957957 resp->headers [SEC_WEBSOCKET_PROTOCOL] = subprotocols[0 ];
958958 }
959959 }
@@ -983,7 +983,7 @@ int HttpHandler::upgradeHTTP2() {
983983 SendHttpResponse ();
984984
985985 if (!SwitchHTTP2 ()) {
986- hloge (" [%s:%d] unsupported HTTP2" , ip, port);
986+ hlogw (" [%s:%d] unsupported HTTP2" , ip, port);
987987 return SetError (ERR_INVALID_PROTOCOL);
988988 }
989989
@@ -1010,7 +1010,7 @@ int HttpHandler::handleForwardProxy() {
10101010 if (service && service->enable_forward_proxy ) {
10111011 return connectProxy (req->url );
10121012 } else {
1013- hlogw (" Forbidden to forward proxy %s" , req->url .c_str ());
1013+ hlogw (" [%s:%d] Forbidden to forward proxy %s" , ip, port , req->url .c_str ());
10141014 SetError (HTTP_STATUS_FORBIDDEN, HTTP_STATUS_FORBIDDEN);
10151015 }
10161016 return 0 ;
@@ -1043,7 +1043,7 @@ int HttpHandler::connectProxy(const std::string& strUrl) {
10431043 }
10441044
10451045 if (forward_proxy && !service->IsTrustProxy (url.host .c_str ())) {
1046- hlogw (" Forbidden to proxy %s" , url.host .c_str ());
1046+ hlogw (" [%s:%d] Forbidden to proxy %s" , ip, port , url.host .c_str ());
10471047 SetError (HTTP_STATUS_FORBIDDEN, HTTP_STATUS_FORBIDDEN);
10481048 return 0 ;
10491049 }
0 commit comments