]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp/bool: Use bool instead of int
authorJeff Lucovsky <jlucovsky@oisf.net>
Thu, 27 Jul 2023 14:50:40 +0000 (10:50 -0400)
committerVictor Julien <victor@inliniac.net>
Fri, 17 Nov 2023 21:24:13 +0000 (22:24 +0100)
src/app-layer-htp-libhtp.c
src/app-layer-htp-libhtp.h
src/app-layer-htp.c
src/app-layer-htp.h

index 2fbd5eae33903e337896af001a9152aa6245266f..dcc4a92b8bb0cca4bb7654714875f76a2ea6d617 100644 (file)
@@ -61,7 +61,7 @@
  * \param uri_include_all boolean to indicate if scheme, username/password,
                           hostname and port should be part of the buffer
  */
-bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, int uri_include_all)
+bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, bool uri_include_all)
 {
     if (uri == NULL)
         return NULL;
index 574dda4134dca813f7facf105c82bfc4ce155003..b08cda508ece1450b433f8782a3c43525b576902 100644 (file)
@@ -48,6 +48,6 @@
 
 #include "suricata-common.h"
 
-bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, int uri_include_all);
+bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, bool uri_include_all);
 
 #endif /* __APP_LAYER_HTP_LIBHTP__H__ */
index b576ba3b7b975231f7e1e8f78c3aa1eabb16ce60..000fc88bbd0cdd6eb6f4c987adfdf4f3f382195d 100644 (file)
@@ -2463,7 +2463,7 @@ static int HTPCallbackResponseHeaderData(htp_tx_data_t *tx_data)
  */
 static void HTPConfigSetDefaultsPhase1(HTPCfgRec *cfg_prec)
 {
-    cfg_prec->uri_include_all = FALSE;
+    cfg_prec->uri_include_all = false;
     cfg_prec->request.body_limit = HTP_CONFIG_DEFAULT_REQUEST_BODY_LIMIT;
     cfg_prec->response.body_limit = HTP_CONFIG_DEFAULT_RESPONSE_BODY_LIMIT;
     cfg_prec->request.inspect_min_size = HTP_CONFIG_DEFAULT_REQUEST_INSPECT_MIN_SIZE;
@@ -2785,7 +2785,7 @@ static void HTPConfigParseParameters(HTPCfgRec *cfg_prec, ConfNode *s,
                                                 HTP_DECODER_URL_PATH,
                                                 ConfValIsTrue(p->val));
         } else if (strcasecmp("uri-include-all", p->name) == 0) {
-            cfg_prec->uri_include_all = ConfValIsTrue(p->val);
+            cfg_prec->uri_include_all = (1 == ConfValIsTrue(p->val));
             SCLogDebug("uri-include-all %s",
                     cfg_prec->uri_include_all ? "enabled" : "disabled");
         } else if (strcasecmp("query-plusspace-decode", p->name) == 0) {
index c8c3a7f7b9873d68800a8428abd2838fc15ed262..dee5c17e833ee8da71d866eaa6435e755b0c9362 100644 (file)
@@ -157,8 +157,6 @@ typedef struct HTPCfgRec_ {
     htp_cfg_t           *cfg;
     struct HTPCfgRec_   *next;
 
-    int                 uri_include_all; /**< use all info in uri (bool) */
-
     /** max size of the client body we inspect */
     int                 randomize;
     int                 randomize_range;
@@ -171,6 +169,8 @@ typedef struct HTPCfgRec_ {
 
     HTPCfgDir request;
     HTPCfgDir response;
+
+    bool uri_include_all; /**< use all info in uri (bool) */
 } HTPCfgRec;
 
 /** Struct used to hold chunks of a body on a request */