From 477e4db650a4a565bb2288621adc01bb2a2dfed4 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 9 Mar 2021 11:38:31 +0100 Subject: Improved detection of Ookla speedtest and openspeedtest.com --- src/lib/protocols/http.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/lib/protocols/http.c') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index c941fe145..8efaf1af4 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -348,10 +348,16 @@ static void ndpi_http_parse_subprotocol(struct ndpi_detection_module_struct *ndp char *double_col = strchr((char*)flow->host_server_name, ':'); if(double_col) double_col[0] = '\0'; - - ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, - (char *)flow->host_server_name, - strlen((const char *)flow->host_server_name)); + + if(ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, + (char *)flow->host_server_name, + strlen((const char *)flow->host_server_name)) == 0) { + if((strstr(flow->http.url, ":8080/downloading?n=0.") == 0) + || (strstr(flow->http.url, ":8080/upload?n=0.") == 0)) { + /* This looks like Ookla speedtest */ + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_HTTP); + } + } } } -- cgit v1.2.3