From d765099813f58153cb859279c743e6494d179341 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 16 Feb 2014 14:07:56 +0100 Subject: ConnectionExists: re-use connections better When allowing NTLM, the re-use connection logic was too focused on finding an existing NTLM connection to use and didn't properly allow re-use of other ones. This made the logic not re-use perfectly re-usable connections. Added test case 1418 and 1419 to verify. Regression brought in 8ae35102c (curl 7.35.0) Reported-by: Jeff King Bug: http://thread.gmane.org/gmane.comp.version-control.git/242213 --- tests/data/test1418 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 tests/data/test1418 (limited to 'tests/data/test1418') diff --git a/tests/data/test1418 b/tests/data/test1418 new file mode 100644 index 000000000..fb4e91a23 --- /dev/null +++ b/tests/data/test1418 @@ -0,0 +1,107 @@ + + + +HTTP +HTTP GET +HTTP NTLM auth +connection re-use + + +# Server-side + + +connection-monitor + + + +HTTP/1.1 401 Authentication please! +Content-Length: 20 +WWW-Authenticate: Digest realm="loonie", nonce="314156592" +WWW-Authenticate: Basic + +Please auth with me + + +# This is supposed to be returned when the server gets the second +# Authorization: NTLM line passed-in from the client + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Length: 4 + +moo + + + +HTTP/1.1 200 OK +Server: Another one/1.0 +Content-Length: 4 + +boo + + +# This is the first reply after the redirection + +HTTP/1.1 200 OK +Server: Microsoft-IIS/5.0 +Content-Type: text/html; charset=iso-8859-1 +Content-Length: 34 + +This is not the real page either! + + + +HTTP/1.1 401 Authentication please! +Content-Length: 20 +WWW-Authenticate: Digest realm="loonie", nonce="314156592" +WWW-Authenticate: Basic + +HTTP/1.1 200 Things are fine in server land +Server: Microsoft-IIS/5.0 +Content-Length: 4 + +moo + + + + +# Client-side + + +http + + +crypto + + +HTTP with --anyauth and connection re-use + + +http://%HOSTIP:%HTTPPORT/1418 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14180003 + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /1418 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /1418 HTTP/1.1 +Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/1418", response="986238b7e0077754944c966f56d9bc77" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +GET /14180003 HTTP/1.1 +Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/14180003", response="1c6390a67bac3283a9b023402f3b3540" +Host: %HOSTIP:%HTTPPORT +Accept: */* + +[DISCONNECT] + + + -- cgit v1.2.3