]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp: remove usused flags
authorVictor Julien <victor@inliniac.net>
Fri, 26 Jan 2018 10:41:03 +0000 (11:41 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Jan 2018 13:43:51 +0000 (14:43 +0100)
src/app-layer-htp.c
src/app-layer-htp.h

index eb4cb3f0c759a74dfb2f8d8c8f1eb3bac7a81a20..76c12216deb0fe0fee7ba6832009fde5ce30790a 100644 (file)
@@ -341,9 +341,6 @@ void HTPStateFree(void *state)
         SCReturn;
     }
 
-    /* Unset the body inspection */
-    s->flags &=~ HTP_FLAG_NEW_BODY_SET;
-
     /* free the connection parser memory used by HTP library */
     if (s->connp != NULL) {
         SCLogDebug("freeing HTP state");
@@ -740,10 +737,6 @@ static int HTPHandleRequestData(Flow *f, void *htp_state,
     }
     DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL);
 
-    /* Unset the body inspection (the callback should
-     * reactivate it if necessary) */
-    hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
-
     htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec };
     /* pass the new data to the htp parser */
     if (input_len > 0) {
@@ -751,22 +744,14 @@ static int HTPHandleRequestData(Flow *f, void *htp_state,
 
         switch(r) {
             case HTP_STREAM_ERROR:
-
-                hstate->flags |= HTP_FLAG_STATE_ERROR;
-                hstate->flags &= ~HTP_FLAG_STATE_DATA;
-                hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
                 ret = -1;
                 break;
             case HTP_STREAM_DATA:
             case HTP_STREAM_DATA_OTHER:
-
-                hstate->flags |= HTP_FLAG_STATE_DATA;
-                break;
             case HTP_STREAM_TUNNEL:
                 break;
             default:
-                hstate->flags &= ~HTP_FLAG_STATE_DATA;
-                hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
+                break;
         }
         HTPHandleError(hstate);
     }
@@ -821,29 +806,19 @@ static int HTPHandleResponseData(Flow *f, void *htp_state,
     }
     DEBUG_VALIDATE_BUG_ON(hstate->connp == NULL);
 
-    /* Unset the body inspection (the callback should
-     * reactivate it if necessary) */
-    hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
-
     htp_time_t ts = { f->lastts.tv_sec, f->lastts.tv_usec };
     if (input_len > 0) {
         r = htp_connp_res_data(hstate->connp, &ts, input, input_len);
         switch(r) {
             case HTP_STREAM_ERROR:
-                hstate->flags = HTP_FLAG_STATE_ERROR;
-                hstate->flags &= ~HTP_FLAG_STATE_DATA;
-                hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
                 ret = -1;
                 break;
             case HTP_STREAM_DATA:
             case HTP_STREAM_DATA_OTHER:
-                hstate->flags |= HTP_FLAG_STATE_DATA;
-                break;
             case HTP_STREAM_TUNNEL:
                 break;
             default:
-                hstate->flags &= ~HTP_FLAG_STATE_DATA;
-                hstate->flags &= ~HTP_FLAG_NEW_BODY_SET;
+                break;
         }
         HTPHandleError(hstate);
     }
@@ -1803,9 +1778,6 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
     }
 
 end:
-    /* set the new chunk flag */
-    hstate->flags |= HTP_FLAG_NEW_BODY_SET;
-
     SCReturnInt(HTP_OK);
 }
 
@@ -1878,9 +1850,6 @@ static int HTPCallbackResponseBodyData(htp_tx_data_t *d)
         }
     }
 
-    /* set the new chunk flag */
-    hstate->flags |= HTP_FLAG_NEW_BODY_SET;
-
     SCReturnInt(HTP_OK);
 }
 
@@ -2002,9 +1971,6 @@ static int HTPCallbackResponse(htp_tx_t *tx)
     /* we have one whole transaction now */
     hstate->transaction_cnt++;
 
-    /* Unset the body inspection (if any) */
-    hstate->flags &=~ HTP_FLAG_NEW_BODY_SET;
-
     HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(tx);
     if (htud != NULL) {
         if (htud->tcflags & HTP_FILENAME_SET) {
index df7e9e275c4058b228346ec20131c8f41ee2c181..6dcb04b19a889e3a66c5485d88b915728480fe34 100644 (file)
                                              connection is closed */
 #define HTP_FLAG_STATE_CLOSED_TC    0x0004    /**< Flag to indicate that HTTP
                                              connection is closed */
-#define HTP_FLAG_STATE_DATA         0x0008    /**< Flag to indicate that HTTP
-                                             connection needs more data */
-#define HTP_FLAG_STATE_ERROR        0x0010    /**< Flag to indicate that an error
-                                             has been occured on HTTP
-                                             connection */
-#define HTP_FLAG_NEW_BODY_SET       0x0020    /**< Flag to indicate that HTTP
-                                             has parsed a new body (for
-                                             pcre) */
 #define HTP_FLAG_STORE_FILES_TS     0x0040
 #define HTP_FLAG_STORE_FILES_TC     0x0080
 #define HTP_FLAG_STORE_FILES_TX_TS  0x0100