Project

General

Profile

Bug #427 ยป 0001-Return-STREAM_STATE_TUNNEL-after-entering-a-tunnel.patch

Victor Julien, 03/20/2012 07:00 AM

View differences:

htp/htp_request.c
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_DATA (previous error)\n");
#endif
return STREAM_STATE_ERROR;
}
......
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_DATA (zero-length chunk)\n");
#endif
return STREAM_STATE_ERROR;
}
......
// mode (which it would be after an initial CONNECT transaction).
if (connp->in_status == STREAM_STATE_TUNNEL) {
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_DATA (tunnel)\n");
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_TUNNEL\n");
#endif
return STREAM_STATE_DATA;
return STREAM_STATE_TUNNEL;
}
// Invoke a processor, in a loop, until an error
......
// on processors to add error messages, so we'll
// keep quiet here.
int rc = connp->in_state(connp);
if (rc != HTP_OK) {
if (rc == HTP_OK) {
if (connp->in_status == STREAM_STATE_TUNNEL) {
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_TUNNEL\n");
#endif
return STREAM_STATE_TUNNEL;
}
} else {
// Do we need more data?
if (rc == HTP_DATA) {
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_req_data: returning STREAM_STATE_DATA\n");
#endif
return STREAM_STATE_DATA;
}
htp/htp_response.c
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_res_data: returning STREAM_STATE_DATA (previous error)\n");
#endif
return STREAM_STATE_ERROR;
}
......
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_res_data: returning STREAM_STATE_DATA (zero-length chunk)\n");
#endif
return STREAM_STATE_ERROR;
}
......
// mode (which it would be after an initial CONNECT transaction.
if (connp->out_status == STREAM_STATE_TUNNEL) {
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_res_data: returning STREAM_STATE_DATA (tunnel)\n");
fprintf(stderr, "htp_connp_res_data: returning STREAM_STATE_TUNNEL\n");
#endif
return STREAM_STATE_DATA;
return STREAM_STATE_TUNNEL;
}
// Invoke a processor, in a loop, until an error
......
// on processors to add error messages, so we'll
// keep quiet here.
int rc = connp->out_state(connp);
if (rc != HTP_OK) {
if (rc == HTP_OK) {
if (connp->out_status == STREAM_STATE_TUNNEL) {
#ifdef HTP_DEBUG
fprintf(stderr, "htp_connp_res_data: returning STREAM_STATE_TUNNEL\n");
#endif
return STREAM_STATE_TUNNEL;
}
} else {
// Do we need more data?
if (rc == HTP_DATA) {
return STREAM_STATE_DATA;
    (1-1/1)