diff options
author | Luca <deri@ntop.org> | 2022-10-04 14:03:39 +0200 |
---|---|---|
committer | Luca <deri@ntop.org> | 2022-10-04 14:03:39 +0200 |
commit | 131d53896f41d9be4de77907631bed82d0b79e63 (patch) | |
tree | 95d27ae5b9d7c97e5486c184a2e727f0156bce3c /src/lib/protocols/http.c | |
parent | 3fa941698133190dd5bca6100b74f7e3f5683a55 (diff) |
Improved HTTP payload handling
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index ef5887643..9e6def210 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -1130,6 +1130,19 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct snprintf(ec, sizeof(ec), "HTTP Error Code %u", flow->http.response_status_code); ndpi_set_risk(ndpi_struct, flow, NDPI_ERROR_CODE_DETECTED, ec); } + + if(flow->flow_payload) { + char *endl; + + flow->flow_payload[flow->flow_payload_len] = '\0'; + if((endl = strrchr(flow->flow_payload, '\r')) == NULL) + endl = strrchr(flow->flow_payload, '\n'); + + if(endl != NULL) { + endl[0] = '\0'; + flow->flow_payload_len = endl - flow->flow_payload; + } + } } ndpi_parse_packet_line_info(ndpi_struct, flow); |