]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
bug 452 - enable http extra callbacks for configs other than the default configs
authorAnoop Saldanha <poonaatsoc@gmail.com>
Fri, 20 Apr 2012 09:21:06 +0000 (14:51 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 24 Apr 2012 11:38:49 +0000 (13:38 +0200)
src/app-layer-htp.c

index 6b9da900515dedb521e34619813654830a2311e6..2f2574b22c9245ac09b7120db465fde207d01df3 100644 (file)
@@ -2392,15 +2392,20 @@ void RegisterHTPParsers(void)
 void AppLayerHtpRegisterExtraCallbacks(void) {
     SCEnter();
     SCLogDebug("Registering extra htp callbacks");
-    if (need_htp_request_body == 1) {
-        SCLogDebug("Registering callback htp_config_register_request_body_data on htp");
-        htp_config_register_request_body_data(cfglist.cfg,
-                                              HTPCallbackRequestBodyData);
-    }
-    if (need_htp_response_body == 1) {
-        SCLogDebug("Registering callback htp_config_register_response_body_data on htp");
-        htp_config_register_response_body_data(cfglist.cfg,
-                                              HTPCallbackResponseBodyData);
+
+    HTPCfgRec *p_cfglist = &cfglist;
+    while (p_cfglist != NULL) {
+        if (need_htp_request_body == 1) {
+            SCLogDebug("Registering callback htp_config_register_request_body_data on htp");
+            htp_config_register_request_body_data(p_cfglist->cfg,
+                                                  HTPCallbackRequestBodyData);
+        }
+        if (need_htp_response_body == 1) {
+            SCLogDebug("Registering callback htp_config_register_response_body_data on htp");
+            htp_config_register_response_body_data(p_cfglist->cfg,
+                                                   HTPCallbackResponseBodyData);
+        }
+        p_cfglist = p_cfglist->next;
     }
     SCReturn;
 }