]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
code cleanup.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Sun, 4 Aug 2013 12:08:54 +0000 (17:38 +0530)
committerAnoop Saldanha <anoopsaldanha@gmail.com>
Sun, 29 Sep 2013 17:43:08 +0000 (23:13 +0530)
src/app-layer-detect-proto.c

index 7e911ccaf802c29adcf76fe2f22c087163bf616a..d9e1ed9c698555361380b8b0f4caab71178e1439 100644 (file)
@@ -591,63 +591,8 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx,
     return ALPROTO_UNKNOWN;
 }
 
-/* VJ Originally I thought of having separate app layer
- * handling threads, leaving this here in case we'll revisit that */
-#if 0
-void *AppLayerDetectProtoThread(void *td)
-{
-    ThreadVars *tv = (ThreadVars *)td;
-    char run = TRUE;
-
-    /* get the stream msg queue for this thread */
-    StreamMsgQueue *stream_q = StreamMsgQueueGetByPort(0);
-
-    TmThreadsSetFlag(tv, THV_INIT_DONE);
-
-    /* main loop */
-    while(run) {
-        if (TmThreadsCheckFlag(tv, THV_PAUSE)) {
-            TmThreadsSetFlag(tv, THV_PAUSED);
-            TmThreadTestThreadUnPaused(tv);
-            TmThreadsUnsetFlag(tv, THV_PAUSED);
-        }
-
-        /* grab a msg, can return NULL on signals */
-        StreamMsg *smsg = StreamMsgGetFromQueue(stream_q);
-        if (smsg != NULL) {
-            AppLayerHandleMsg(smsg, TRUE);
-        }
-
-        if (TmThreadsCheckFlag(tv, THV_KILL)) {
-            SCPerfSyncCounters(tv, 0);
-            run = 0;
-        }
-    }
+/*****Unittests*****/
 
-    pthread_exit((void *) 0);
-}
-
-void AppLayerDetectProtoThreadSpawn()
-{
-    ThreadVars *tv_applayerdetect = NULL;
-
-    tv_applayerdetect = TmThreadCreateMgmtThread("AppLayerDetectProtoThread",
-                                                 AppLayerDetectProtoThread, 0);
-    if (tv_applayerdetect == NULL) {
-        printf("ERROR: TmThreadsCreate failed\n");
-        exit(1);
-    }
-    if (TmThreadSpawn(tv_applayerdetect) != TM_ECODE_OK) {
-        printf("ERROR: TmThreadSpawn failed\n");
-        exit(1);
-    }
-
-#ifdef DEBUG
-    printf("AppLayerDetectProtoThread thread created\n");
-#endif
-    return;
-}
-#endif
 #ifdef UNITTESTS
 
 int AlpDetectTest01(void) {