diff options
author | Luca Deri <deri@ntop.org> | 2021-03-09 11:38:31 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2021-03-09 11:38:31 +0100 |
commit | 477e4db650a4a565bb2288621adc01bb2a2dfed4 (patch) | |
tree | 5096088e401d0b3b806afd917f7a29aedecb1c88 /src | |
parent | bb6423a79f80898d140c946dd08ea571ae95d5e7 (diff) |
Improved detection of Ookla speedtest and openspeedtest.com
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/http.c | 14 |
1 files changed, 10 insertions, 4 deletions
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); + } + } } } |