mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-05-06 03:45:32 +00:00
Respose status code after validation check.
This commit is contained in:
parent
449e06df77
commit
63c97753a1
2 changed files with 5 additions and 6 deletions
|
|
@ -3817,6 +3817,11 @@ void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struc
|
|||
packet->http_response.len = packet->line[0].len - NDPI_STATICSTRING_LEN("HTTP/1.1 ");
|
||||
packet->http_num_headers++;
|
||||
|
||||
/* Set server HTTP response code */
|
||||
strncpy((char*)flow->http.response_status_code, (char*)packet->http_response.ptr, 3);
|
||||
flow->http.response_status_code[4]='\0';
|
||||
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_UNKNOWN, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"ndpi_parse_packet_line_info: HTTP response parsed: \"%.*s\"\n",
|
||||
packet->http_response.len, packet->http_response.ptr);
|
||||
|
|
|
|||
|
|
@ -826,12 +826,6 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||
|
||||
/* Set server HTTP response code, if available */
|
||||
if(packet->http_response.len>=3){
|
||||
strncpy((char*)flow->http.response_status_code, (char*)packet->http_response.ptr, 3);
|
||||
flow->http.response_status_code[4]='\0';
|
||||
}
|
||||
|
||||
if(packet->packet_direction == 1 /* server -> client */){
|
||||
flow->http.num_response_headers += packet->http_num_headers; /* flow structs are initialized with zeros */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue