From: Anoop Saldanha Date: Fri, 20 Apr 2012 09:21:06 +0000 (+0530) Subject: bug 452 - enable http extra callbacks for configs other than the default configs X-Git-Tag: suricata-1.3beta2~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=608f4fe78732aa1494fd5ed03368abb3948e3d45;p=thirdparty%2Fsuricata.git bug 452 - enable http extra callbacks for configs other than the default configs --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 6b9da90051..2f2574b22c 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -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; }