fix probing parser flag usage during protocol detection

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent 432c3317d2
commit 80d80000bb

@ -637,19 +637,9 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx,
return alproto; return alproto;
} }
/* If we have reached here, the PM parser has failed to detect the /* If we have reached here, the PM parser has failed to detect the
* alproto. * alproto */
*
* Check if the probing parser has already finished its duties. If it
* has, set flag to indicate both parsers have done all they could have
* to detect the alproto and failed. If it isn't through as yet, run
* the probing parser */
if (flags & FLOW_TS_PP_ALPROTO_DETECT_DONE) {
f->flags |= FLOW_TS_PM_PP_ALPROTO_DETECT_DONE;
return ALPROTO_UNKNOWN;
} else {
return AppLayerDetectGetProtoProbingParser(ctx, f, buf, buflen, return AppLayerDetectGetProtoProbingParser(ctx, f, buf, buflen,
flags, ipproto); flags, ipproto);
}
/* STREAM_TOCLIENT */ /* STREAM_TOCLIENT */
} else { } else {
@ -673,15 +663,10 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx,
if (alproto != ALPROTO_UNKNOWN) if (alproto != ALPROTO_UNKNOWN)
return alproto; return alproto;
} }
if (flags & FLOW_TC_PP_ALPROTO_DETECT_DONE) {
f->flags |= FLOW_TC_PM_PP_ALPROTO_DETECT_DONE;
return ALPROTO_UNKNOWN;
} else {
return AppLayerDetectGetProtoProbingParser(ctx, f, buf, buflen, return AppLayerDetectGetProtoProbingParser(ctx, f, buf, buflen,
flags, ipproto); flags, ipproto);
} }
} }
}
/* VJ Originally I thought of having separate app layer /* VJ Originally I thought of having separate app layer
* handling threads, leaving this here in case we'll revisit that */ * handling threads, leaving this here in case we'll revisit that */

Loading…
Cancel
Save