Parcourir la source

Update http_interceptor.cpp

nianhua il y a 1 an
Parent
commit
c563cc788e
1 fichiers modifiés avec 5 ajouts et 6 suppressions
  1. 5 6
      src/net/http_interceptor.cpp

+ 5 - 6
src/net/http_interceptor.cpp

@@ -81,13 +81,12 @@ bool network::http::interceptor::trigger(const std::string& url, network::http::
     for (size_t i = 0; i < m_list.size(); i++)
     {
         if (std::regex_match(url.c_str(), m_list[i].regex)) {
-            bool result = m_list[i].callback(rp, m_list[i].pattern, m_list[i].extra);
-            if (result == false) {
-#if HTTP_INTERCEPTOR_PRINT == 1
-                ylib::log->warn("[" + rp->exec_msec() + " ms] false url:" + url + "\t" + " express:" + info->express_string + " ip:" + rp->request()->remote_ipaddress(true), "interceptor");
-#endif
+            if (m_list[i].callback(rp, m_list[i].pattern, m_list[i].extra)== false) {
+//#if HTTP_INTERCEPTORRINT == 1
+		    //std::cout<<"[trigger] false url:" << url << "\t" << " express:" << m_list[i].pattern << std::endl;
+//#endif
+		return false;
             }
-            return result;
         }
     }
     return true;