mirror of https://github.com/moparisthebest/curl
Created test cases 1080 and 1081 to reproduce a problem of
CURLINFO_REDIRECT_URL leaking memory and returning incorrect results when two URLs are requested. Reported by vmpdemo in bug #2152270
This commit is contained in:
parent
1b246eecfe
commit
11a8a25528
4
CHANGES
4
CHANGES
|
@ -13,6 +13,10 @@ Daniel Fandrich (7 Oct 2008)
|
||||||
test a similar connection dropping scenario, but as a race condition, it's
|
test a similar connection dropping scenario, but as a race condition, it's
|
||||||
hard to test reliably.
|
hard to test reliably.
|
||||||
|
|
||||||
|
- Created test cases 1080 and 1081 to reproduce a problem of
|
||||||
|
CURLINFO_REDIRECT_URL leaking memory and returning incorrect results when
|
||||||
|
two URLs are requested. Reported by vmpdemo in bug #2152270
|
||||||
|
|
||||||
Daniel Stenberg (7 Oct 2008)
|
Daniel Stenberg (7 Oct 2008)
|
||||||
- Fixed CURLINFO_PRIMARY_IP: When libcurl created a connection to host A then
|
- Fixed CURLINFO_PRIMARY_IP: When libcurl created a connection to host A then
|
||||||
the app re-used the handle to do a connection to host B and then again
|
the app re-used the handle to do a connection to host B and then again
|
||||||
|
|
|
@ -3,3 +3,5 @@
|
||||||
# test cases are run by runtests.pl. Just add the plain test case numbers, one
|
# test cases are run by runtests.pl. Just add the plain test case numbers, one
|
||||||
# per line.
|
# per line.
|
||||||
# Lines starting with '#' letters are treated as comments.
|
# Lines starting with '#' letters are treated as comments.
|
||||||
|
1080
|
||||||
|
1081
|
||||||
|
|
|
@ -57,7 +57,8 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
||||||
test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
|
test1048 test1049 test1050 test1051 test1052 test1053 test1054 test1055 \
|
||||||
test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
|
test1056 test1057 test1058 test1059 test1060 test1061 test1062 test1063 \
|
||||||
test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
|
test1064 test1065 test1066 test1067 test1068 test1069 test1070 test1071 \
|
||||||
test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079
|
test1072 test1073 test1074 test1075 test1076 test1077 test1078 test1079 \
|
||||||
|
test1080 test1081
|
||||||
|
|
||||||
filecheck:
|
filecheck:
|
||||||
@mkdir test-place; \
|
@mkdir test-place; \
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
HTTP
|
||||||
|
HTTP GET
|
||||||
|
redirect_url
|
||||||
|
followlocation
|
||||||
|
--write-out
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data nocheck="1">
|
||||||
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
|
Location: data/10800002.txt?coolsite=yes
|
||||||
|
Content-Length: 62
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
This server reply is for testing a simple Location: following
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
http
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
HTTP Location: on two URLs 'redirect_url' check
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HTTPPORT/we/want/our/1080 http://%HOSTIP:%HTTPPORT/we/want/our/1080 -w '%{redirect_url}\n'
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /we/want/our/1080 HTTP/1.1
|
||||||
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
Accept: */*
|
||||||
|
|
||||||
|
GET /we/want/our/1080 HTTP/1.1
|
||||||
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
Accept: */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
<stdout mode="text">
|
||||||
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
|
Location: data/10800002.txt?coolsite=yes
|
||||||
|
Content-Length: 62
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
This server reply is for testing a simple Location: following
|
||||||
|
http://%HOSTIP:%HTTPPORT/we/want/our/data/10800002.txt?coolsite=yes
|
||||||
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
|
Location: data/10800002.txt?coolsite=yes
|
||||||
|
Content-Length: 62
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
This server reply is for testing a simple Location: following
|
||||||
|
http://%HOSTIP:%HTTPPORT/we/want/our/data/10800002.txt?coolsite=yes
|
||||||
|
</stdout>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
|
@ -0,0 +1,77 @@
|
||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
HTTP
|
||||||
|
HTTP GET
|
||||||
|
redirect_url
|
||||||
|
followlocation
|
||||||
|
--write-out
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data nocheck="1">
|
||||||
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
|
Location: data/10810099.txt?coolsite=yes
|
||||||
|
Content-Length: 62
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
This server reply is for testing a simple Location: following
|
||||||
|
</data>
|
||||||
|
<data2 nocheck="1">
|
||||||
|
HTTP/1.1 200 Followed here fine swsclose
|
||||||
|
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||||
|
Server: test-server/fake
|
||||||
|
Content-Length: 41
|
||||||
|
|
||||||
|
This second URL does not have a location
|
||||||
|
</data2>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
http
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
HTTP no Location: on second URL 'redirect_url' check
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HTTPPORT/we/want/our/1081 http://%HOSTIP:%HTTPPORT/we/want/our/10810002 -w '%{redirect_url}\n'
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /we/want/our/1081 HTTP/1.1
|
||||||
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
Accept: */*
|
||||||
|
|
||||||
|
GET /we/want/our/10810002 HTTP/1.1
|
||||||
|
Host: %HOSTIP:%HTTPPORT
|
||||||
|
Accept: */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
<stdout mode="text">
|
||||||
|
HTTP/1.1 301 This is a weirdo text message swsclose
|
||||||
|
Location: data/10810099.txt?coolsite=yes
|
||||||
|
Content-Length: 62
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
This server reply is for testing a simple Location: following
|
||||||
|
http://%HOSTIP:%HTTPPORT/we/want/our/data/10810099.txt?coolsite=yes
|
||||||
|
HTTP/1.1 200 Followed here fine swsclose
|
||||||
|
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||||
|
Server: test-server/fake
|
||||||
|
Content-Length: 41
|
||||||
|
|
||||||
|
This second URL does not have a location
|
||||||
|
|
||||||
|
</stdout>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
Loading…
Reference in New Issue