diff options
author | Luca Deri <deri@ntop.org> | 2022-12-05 21:27:30 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2022-12-05 21:27:30 +0100 |
commit | e0afc16aa2ae78c39b7b51c73840f79ba1723c9c (patch) | |
tree | 58cb02776a9e8f069910fe1cddd8308496e6cce6 /src/lib/protocols/http.c | |
parent | c882120afd76255d6511f9b43b9776f8e0a9044f (diff) |
Exported HTTP server in metadata
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index e33ee265d..2c8f474fa 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -882,6 +882,17 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ flow->guessed_category = flow->category = ndpi_http_check_content(ndpi_struct, flow); } } + + if((flow->http.server == NULL) && (packet->server_line.len > 0)) { + int len = packet->server_line.len + 1; + + flow->http.server = ndpi_malloc(len); + if(flow->http.server) { + strncpy(flow->http.server, (char*)packet->server_line.ptr, + packet->server_line.len); + flow->http.server[packet->server_line.len] = '\0'; + } + } } if(flow->http_detected && packet->content_line.ptr && *(char*)packet->content_line.ptr) { |