diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 91866dad36..3c5e1e02dc 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -93,6 +93,7 @@ static int HTPHandleRequestData(void *htp_state, AppLayerParserState *pstate, uint8_t *input, uint32_t input_len, AppLayerParserResult *output) { + SCEnter(); HtpState *hstate = (HtpState *)htp_state; struct timeval tv; @@ -101,10 +102,15 @@ static int HTPHandleRequestData(void *htp_state, AppLayerParserState *pstate, if (htp_connp_req_data(hstate->connp, tv.tv_usec, input, input_len) == HTP_ERROR) { - return -1; + /* As work in HTP library is in progress, so it doesn't filled the + last_error field always and it can be null at the moment. So we can't + print the error casue always. If the infomraion is logged then, it + will be printed on console by library itself */ + SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP client request"); + SCReturnInt(-1); } - return 1; + SCReturnInt(1); } /** @@ -123,6 +129,7 @@ static int HTPHandleResponseData(void *htp_state, AppLayerParserState *pstate, uint8_t *input, uint32_t input_len, AppLayerParserResult *output) { + SCEnter(); HtpState *hstate = (HtpState *)htp_state; struct timeval tv; @@ -131,10 +138,15 @@ static int HTPHandleResponseData(void *htp_state, AppLayerParserState *pstate, if (htp_connp_res_data(hstate->connp, tv.tv_usec, input, input_len) == HTP_ERROR) { - return -1; + /* As work in HTP library is in progress, so it doesn't filled the + last_error field always and it can be null at the moment. So we can't + print the error casue always. If the infomraion is logged then, it + will be printed on console by library itself */ + SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP server response"); + SCReturnInt(-1); } - return 1; + SCReturnInt(1); } /** diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 809ea617df..0d086b9f5f 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -687,7 +687,11 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input, } } else { SCLogDebug("No App Layer Data"); - goto error; + /* Nothing is there to clean up, so just return from here after setting + * up the no reassembly flags */ + StreamTcpSetSessionNoReassemblyFlag(ssn, flags & STREAM_TOCLIENT ? 1 : 0); + StreamTcpSetSessionNoReassemblyFlag(ssn, flags & STREAM_TOSERVER ? 1 : 0); + SCReturnInt(-1); } AppLayerParserState *parser_state = NULL; @@ -793,7 +797,7 @@ error: "protocol, using network protocol %"PRIu8", source IP " "address %s, destination IP address %s, src port %"PRIu16" and " "dst port %"PRIu16"", al_proto_table[ssn->alproto].name, - f->proto, src, dst, ntohs(f->sp), ntohs(f->dp)); + f->proto, src, dst, f->sp, f->dp); } SCReturnInt(-1);