]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: change the behavior of swsbounce
authorJay Satiro <raysatiro@yahoo.com>
Sat, 25 Jan 2025 08:17:10 +0000 (03:17 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 26 Jan 2025 07:29:21 +0000 (02:29 -0500)
- Change the swsbounce keyword to override the part number on a
  subsequent request to the previous part number + 1.

Note the previous part number in this case is the part number that
was returned as a response to the previous request and contained
the swsbounce keyword.

Prior to this change swsbounce incremented the part number of the
subsequent request instead of overriding it, and did so in a more
limited fashion that prevented chaining swsbounce in multiple responses.

For example, if the test makes a request that causes the sws server to
return `<data>` as a response and that response contains `swsbounce`
then for the next response the sws server returns `<data1>`. If
`<data1>` also contains `swsbounce` then for the next response the sws
server now returns `<data2>` instead of the requested part.

Fixes https://github.com/curl/curl/discussions/16074
Closes https://github.com/curl/curl/pull/16085

22 files changed:
tests/FILEFORMAT.md
tests/data/Makefile.am
tests/data/test1001
tests/data/test1002
tests/data/test1060
tests/data/test1061
tests/data/test1284
tests/data/test1285
tests/data/test1286
tests/data/test176
tests/data/test2058
tests/data/test2059
tests/data/test206
tests/data/test2060
tests/data/test2067
tests/data/test2068
tests/data/test2069
tests/data/test245
tests/data/test246
tests/data/test3032 [new file with mode: 0644]
tests/server/rtspd.c
tests/server/sws.c

index 529bbc0196151fe3487ba26b42c7d7fd7f96db03..5b5f82dea47c6eb86aecf55a8ad53d5625a80f4b 100644 (file)
@@ -237,10 +237,14 @@ If the data contains `swsclose` anywhere within the start and end tag, and
 this is an HTTP test, then the connection is closed by the server after this
 response is sent. If not, the connection is kept persistent.
 
-If the data contains `swsbounce` anywhere within the start and end tag, the
-HTTP server detects if this is a second request using the same test and part
-number and then increases the part number with one. This is useful for auth
-tests and similar.
+If the data contains `swsbounce` anywhere within the start and end tag, then
+the HTTP server overrides the part number response returned for a subsequent
+request made by the same test to `previous part number + 1`. For example, if a
+test makes a request which causes the server to return `<data>` that contains
+keyword `swsbounce` then for the next response it ignores the requested part
+number and instead returns `<data1>`. And if `<data1>` contains keyword
+`swsbounce` then the next response is `<data2>` and so on. This is useful for
+auth tests and similar.
 
 `sendzero=yes` means that the (FTP) server "sends" the data even if the size
 is zero bytes. Used to verify curl's behavior on zero bytes transfers.
index f39a30f466c4093989319dd51d64decadc500a9d..43c30d5e3fa2041df2f089ad74d02a519d3aec34 100644 (file)
@@ -268,6 +268,7 @@ test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \
 test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
 test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
 test3024 test3025 test3026 test3027 test3028 test3029 test3030 test3031 \
+test3032 \
 \
 test3100 test3101 test3102 test3103 test3104 test3105 \
 test3200 \
index 4220ab6759ef6188a132c964d4367e7632bb5bdb..63eb072fdccc8963468be3710ad639d13922b589 100644 (file)
@@ -19,7 +19,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -41,7 +41,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index 92cb5e158532331e5c7f68b01ccf28625175d459..50f7dcf2a82c586028862010bd0e2e90965a63f4 100644 (file)
@@ -18,7 +18,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -40,7 +40,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index c1ad6c66768c78ac70d8087230a4726511e9e415..ce7a37ea09d97b885d3faaf05b48bd64d4e298ec 100644 (file)
@@ -836,7 +836,7 @@ daniel
 
 # then this is returned when we get proxy-auth
 <connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 </connect1000>
@@ -847,7 +847,7 @@ Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
 Content-Length: 40000\r
 X-tra-long-header: %repeat[16080 x a]%\r
 \r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 HTTP/1.1 200 OK
index 76241142c92fc6f3de344c7a377e72f998c3cdbc..0e383598d0e80cb6a93a159412b77e67e8b9271f 100644 (file)
@@ -841,7 +841,7 @@ daniel
 
 # then this is returned when we get proxy-auth
 <connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 </connect1000>
@@ -852,7 +852,7 @@ Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"
 Transfer-Encoding: chunked\r
 X-tra-long-header: %repeat[16080 x a]%\r
 \r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 HTTP/1.1 200 OK
index dd2d8b8b7ceb565f9dfb0f80f9291abd06118f5a..2900c512efd17c087d159e5d85420f0f20c9a649 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index 986cb92cc76c4df215d4add73568df24585efed4..ee5f13c5e509fe843b58d2092c831dbc980b0336 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index df0f35fc5a1b8e0d6f648965ae956ac5a8ee0260..e898a37d30a65c4b398505e6e4fd17ecdbd2d4a3 100644 (file)
@@ -11,7 +11,7 @@ followlocation
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -35,7 +35,7 @@ Content-Length: 0
 </data1001>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"\r
 Content-Type: text/html; charset=iso-8859-1\r
index eba8fef78ce9c77ff4879e4cecfd4f0eefdf4e41..0eab979c90c3db6fddf21ed6a3a45c0649fead2d 100644 (file)
@@ -11,7 +11,7 @@ HTTP NTLM auth
 <reply>
 # the first request has NTLM type-1 included, and then the 1001 is returned
 <data1001>
-HTTP/1.1 200 beng swsclose swsbounce\r
+HTTP/1.1 200 beng swsclose\r
 Server: Microsoft-IIS/6.0\r
 Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -29,7 +29,7 @@ content for you
 </data>
 
 <datacheck>
-HTTP/1.1 200 beng swsclose swsbounce\r
+HTTP/1.1 200 beng swsclose\r
 Server: Microsoft-IIS/6.0\r
 Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth\r
 Content-Type: text/html; charset=iso-8859-1\r
index 4dfac74b7dc30e47376e57f64be00d52d4496288..c85d534c9a3d953f71d813edaf72700720196d62 100644 (file)
@@ -19,7 +19,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -41,7 +41,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index e2957bce5daad06d810d6acb40ebb28a31aa7213..5b924a5847efdd9ceb3ee4878ea12aaec93eafa6 100644 (file)
@@ -19,7 +19,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -41,7 +41,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true\r
 Content-Type: text/html; charset=iso-8859-1\r
index 19fbbfb4a50b654a0fd026bf63fd8226137d99df..60e103d098de15f5e2dbd1b480f3ab4fb9f82353 100644 (file)
@@ -41,7 +41,7 @@ daniel
 
 # then this is returned when we get proxy-auth
 <connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 </connect1000>
@@ -51,7 +51,7 @@ HTTP/1.1 407 Authorization Required to proxy me my dear
 Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"\r
 Content-Length: 33\r
 \r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
 Server: no
 \r
 HTTP/1.1 200 OK
index e1632a387d64f2b01da4481bdb9d42d8015459dd..860f40eb8f446f02d106a9d459d15b0554b12b79 100644 (file)
@@ -19,7 +19,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -41,7 +41,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index 4fdd4dcbb056cec2b4df66ced6c16e7ea3648bc8..a65fb52500a7cb5dbb65c640c961ac72cc3a9370 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"\r
 Content-Type: text/html; charset=iso-8859-1\r
index 32afd26290ae0a6bb6a6ee9786dda411f8e5ff2a..1a6d2713499e5139944d963480ec141c4e6b92d7 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256"\r
 Content-Type: text/html; charset=iso-8859-1\r
index 74d719fd3e9dc3730f79e333e35c9ca403ea551a..86aa18301ae3d2f674552579709d5bb05eea70c0 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true\r
 Content-Type: text/html; charset=iso-8859-1\r
index 78893f028e454dba852fc28ad0b8d20c6879814c..60319ebc2d3bc8c0f9427f44c87c34c7b230b099 100644 (file)
@@ -10,7 +10,7 @@ HTTP Digest auth
 # Server-side
 <reply>
 <data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -27,7 +27,7 @@ ok
 </data1000>
 
 <datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
index a756028b9c88704c4d771234ec087cb2b691ebfa..67bf446d74896161e048306b9eba72f3c33b5ec3 100644 (file)
@@ -15,7 +15,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
@@ -37,7 +37,7 @@ Server: Microsoft-IIS/5.0
 Date: Sun, 03 Apr 2005 14:57:45 GMT\r
 X-Powered-By: ASP.NET\r
 \r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
 Server: Microsoft-IIS/6.0\r
 WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
 Content-Type: text/html; charset=iso-8859-1\r
diff --git a/tests/data/test3032 b/tests/data/test3032
new file mode 100644 (file)
index 0000000..985ff4f
--- /dev/null
@@ -0,0 +1,112 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+--location
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data\r
+\r
+</data>
+
+<data1>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data1\r
+\r
+</data1>
+
+<data2>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data2\r
+\r
+</data2>
+
+<data3>
+HTTP/1.1 200 OK\r
+Content-Type: text/html\r
+Content-Length: 30\r
+Part: data3\r
+\r
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+</data3>
+
+<datacheck>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data\r
+\r
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data1\r
+\r
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data2\r
+\r
+HTTP/1.1 200 OK\r
+Content-Type: text/html\r
+Content-Length: 30\r
+Part: data3\r
+\r
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# This is a test of the swsbounce keyword which is used during tests to
+# override the data response number for the next request to the previous
+# data response number + 1. eg data, data1, data2 etc.
+<name>
+HTTP redirect loop 3x swsbounce test
+</name>
+<command>
+--location http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
index 73cddcf09801d29f8676e72974a1f202d2b62633..707d20706eaf2e4def1a38f95813cba4c366e2f7 100644 (file)
@@ -72,9 +72,9 @@ static int serverlogslocked = 0;
 
 static long prevtestno = -1;    /* previous test number we served */
 static long prevpartno = -1;    /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to increase the part
-                                   number for a test in case the identical
-                                   testno+partno request shows up again */
+static bool prevbounce = FALSE; /* instructs the server to override the
+                                   requested part number to prevpartno + 1 when
+                                   prevtestno and current test are the same */
 
 #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
 #define RCMD_IDLE      1 /* told to sit idle */
@@ -1319,9 +1319,8 @@ int main(int argc, char *argv[])
 
       if(prevbounce) {
         /* bounce treatment requested */
-        if((req.testno == prevtestno) &&
-           (req.partno == prevpartno)) {
-          req.partno++;
+        if(req.testno == prevtestno) {
+          req.partno = prevpartno + 1;
           logmsg("BOUNCE part number to %ld", req.partno);
         }
         else {
index 9e364d1d683aa57c09373a99bdd8f5535fa1fda0..e6aefe3e94d03e4491ab2a3ba3f38b38f5cbaa56 100644 (file)
@@ -84,9 +84,9 @@ static bool is_proxy = FALSE;
 
 static long prevtestno = -1;    /* previous test number we served */
 static long prevpartno = -1;    /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to increase the part
-                                   number for a test in case the identical
-                                   testno+partno request shows up again */
+static bool prevbounce = FALSE; /* instructs the server to override the
+                                   requested part number to prevpartno + 1 when
+                                   prevtestno and current test are the same */
 
 #define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
 #define RCMD_IDLE      1 /* told to sit idle */
@@ -1982,9 +1982,8 @@ static int service_connection(curl_socket_t msgsock, struct httprequest *req,
 
   if(prevbounce) {
     /* bounce treatment requested */
-    if((req->testno == prevtestno) &&
-       (req->partno == prevpartno)) {
-      req->partno++;
+    if(req->testno == prevtestno) {
+      req->partno = prevpartno + 1;
       logmsg("BOUNCE part number to %ld", req->partno);
     }
     else {