fixed port info

remotes/origin/master-1.0.x
Gurvinder Singh 16 years ago committed by Victor Julien
parent 991d421394
commit 1b39e602d0

@ -93,6 +93,7 @@ static int HTPHandleRequestData(void *htp_state, AppLayerParserState *pstate,
uint8_t *input, uint32_t input_len, uint8_t *input, uint32_t input_len,
AppLayerParserResult *output) AppLayerParserResult *output)
{ {
SCEnter();
HtpState *hstate = (HtpState *)htp_state; HtpState *hstate = (HtpState *)htp_state;
struct timeval tv; 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) == if (htp_connp_req_data(hstate->connp, tv.tv_usec, input, input_len) ==
HTP_ERROR) 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, uint8_t *input, uint32_t input_len,
AppLayerParserResult *output) AppLayerParserResult *output)
{ {
SCEnter();
HtpState *hstate = (HtpState *)htp_state; HtpState *hstate = (HtpState *)htp_state;
struct timeval tv; 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) == if (htp_connp_res_data(hstate->connp, tv.tv_usec, input, input_len) ==
HTP_ERROR) 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);
} }
/** /**

@ -687,7 +687,11 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
} }
} else { } else {
SCLogDebug("No App Layer Data"); 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; AppLayerParserState *parser_state = NULL;
@ -793,7 +797,7 @@ error:
"protocol, using network protocol %"PRIu8", source IP " "protocol, using network protocol %"PRIu8", source IP "
"address %s, destination IP address %s, src port %"PRIu16" and " "address %s, destination IP address %s, src port %"PRIu16" and "
"dst port %"PRIu16"", al_proto_table[ssn->alproto].name, "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); SCReturnInt(-1);

Loading…
Cancel
Save