From 3af6b97c63d246d3a855507bc3f73a93b67c42e5 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Tue, 29 Nov 2022 17:51:01 +0100 Subject: [PATCH] analyzers/http: Update request_version on subsequent SetVersion() calls The #124 PR introduced special treatment when HTTP version 0.9 was set. With #127, a reproducer that set HTTP/1.0 in the first request was created and subsequent requests wouldn't reset to HTTP version 0.9. This is subtle, but doesn't seem like things fall apart. Improves runtime from 20 seconds to 2 seconds for the given reproducer. Fixes #127. --- src/analyzer/protocol/http/HTTP.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/analyzer/protocol/http/HTTP.cc b/src/analyzer/protocol/http/HTTP.cc index 55406b52fe..09bff23847 100644 --- a/src/analyzer/protocol/http/HTTP.cc +++ b/src/analyzer/protocol/http/HTTP.cc @@ -1339,7 +1339,10 @@ void HTTP_Analyzer::SetVersion(HTTP_VersionNumber* version, HTTP_VersionNumber n *version = new_version; else if ( *version != new_version ) + { Weird("HTTP_version_mismatch"); + *version = new_version; + } if ( version->major > 1 || (version->major == 1 && version->minor > 0) ) keep_alive = 1;