updated htp error info

remotes/origin/master-1.0.x
Gurvinder Singh 16 years ago committed by Victor Julien
parent e6a8c5f713
commit 7ce586bc77

@ -126,11 +126,15 @@ static int HTPHandleRequestData(Flow *f, void *htp_state,
if (htp_connp_req_data(hstate->connp, 0, input, input_len) == if (htp_connp_req_data(hstate->connp, 0, input, input_len) ==
STREAM_STATE_ERROR) STREAM_STATE_ERROR)
{ {
/* As work in HTP library is in progress, so it doesn't filled the if (hstate->connp->last_error != NULL) {
last_error field always and it can be null at the moment. So we can't SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP client request: "
print the error casue always. If the infomraion is logged then, it "[%"PRId32"] [%s] [%"PRId32"] %s", hstate->connp->last_error->level,
will be printed on console by library itself */ hstate->connp->last_error->file, hstate->connp->last_error->line,
SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP client request"); hstate->connp->last_error->msg);
} else {
SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP client request");
}
SCReturnInt(-1); SCReturnInt(-1);
} }
@ -169,11 +173,15 @@ static int HTPHandleResponseData(Flow *f, void *htp_state,
if (htp_connp_res_data(hstate->connp, 0, input, input_len) == if (htp_connp_res_data(hstate->connp, 0, input, input_len) ==
STREAM_STATE_ERROR) STREAM_STATE_ERROR)
{ {
/* As work in HTP library is in progress, so it doesn't filled the if (hstate->connp->last_error != NULL) {
last_error field always and it can be null at the moment. So we can't SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP server request: "
print the error casue always. If the infomraion is logged then, it "[%"PRId32"] [%s] [%"PRId32"] %s", hstate->connp->last_error->level,
will be printed on console by library itself */ hstate->connp->last_error->file, hstate->connp->last_error->line,
SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP server response"); hstate->connp->last_error->msg);
} else {
SCLogError(SC_ALPARSER_ERR, "Error in parsing HTTP server request");
}
SCReturnInt(-1); SCReturnInt(-1);
} }

Loading…
Cancel
Save