Cleanup AppLayerDetectGetProto a bit.

remotes/origin/master-1.0.x
Victor Julien 17 years ago
parent fd409049cb
commit 7deb4e9f09

@ -252,11 +252,7 @@ void AppLayerDetectProtoThreadInit(void) {
} }
uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, AlpProtoDetectThreadCtx *tctx, uint8_t *buf, uint16_t buflen, uint8_t flags) { uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, AlpProtoDetectThreadCtx *tctx, uint8_t *buf, uint16_t buflen, uint8_t flags) {
//printf("AppLayerDetectGetProto: start\n"); SCEnter();
//PrintRawDataFp(stdout, buf, buflen);
//if (buflen < INSPECT_BYTES)
// return ALPROTO_UNKNOWN;
AlpProtoDetectDirection *dir; AlpProtoDetectDirection *dir;
AlpProtoDetectDirectionThread *tdir; AlpProtoDetectDirectionThread *tdir;
@ -268,8 +264,9 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, AlpProtoDetectThreadCtx
tdir = &tctx->toclient; tdir = &tctx->toclient;
} }
if (dir->id == 0) if (dir->id == 0) {
return ALPROTO_UNKNOWN; SCReturnUInt(ALPROTO_UNKNOWN);
}
/* see if we can limit the data we scan */ /* see if we can limit the data we scan */
uint16_t scanlen = buflen; uint16_t scanlen = buflen;
@ -349,7 +346,7 @@ end:
break; break;
} }
#endif #endif
return proto; SCReturnUInt(proto);
} }
int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg) int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg)

Loading…
Cancel
Save