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.
This commit is contained in:
Arne Welzel 2022-11-29 17:51:01 +01:00
parent 9a96e3b52a
commit 3af6b97c63

View file

@ -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;