mirror of
https://github.com/curl/curl.git
synced 2026-04-12 00:11:42 +08:00
When saving a file with --no-clobber, make sure the existing file name remains set when creating the name fails. In a retry scenario, it comes back and uses that variable again. Add test 3036 to verify. Reported-by: James Fuller Closes #20939
63 lines
984 B
XML
63 lines
984 B
XML
<?xml version="1.0" encoding="US-ASCII"?>
|
|
<testcase>
|
|
<info>
|
|
<keywords>
|
|
-O
|
|
-J
|
|
--output-dir
|
|
--retry
|
|
--no-clobber
|
|
</keywords>
|
|
</info>
|
|
# Server-side
|
|
<reply>
|
|
<data nocheck="yes">
|
|
HTTP/1.1 200 OK
|
|
Content-Length: 6
|
|
Connection: close
|
|
Content-Disposition: inline; filename="MMM%TESTNUMBERMMM"
|
|
Content-Type: text/html
|
|
|
|
-foo-
|
|
</data>
|
|
</reply>
|
|
|
|
# Client-side
|
|
<client>
|
|
<server>
|
|
http
|
|
</server>
|
|
<features>
|
|
http
|
|
</features>
|
|
<name>
|
|
--no-clobber, --retry and --output-dir identifying a file
|
|
</name>
|
|
<command option="no-output">
|
|
http://%HOSTIP:%HTTPPORT/ --no-clobber --output-dir %LOGDIR/present -OJ --retry 1 --retry-all-errors
|
|
</command>
|
|
<file name="%LOGDIR/present">
|
|
present
|
|
</file>
|
|
</client>
|
|
|
|
<verify>
|
|
<protocol crlf="headers">
|
|
GET / HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
User-Agent: curl/%VERSION
|
|
Accept: */*
|
|
|
|
GET / HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
User-Agent: curl/%VERSION
|
|
Accept: */*
|
|
|
|
</protocol>
|
|
# it fails because it cannot create the output file
|
|
<errorcode>
|
|
23
|
|
</errorcode>
|
|
</verify>
|
|
</testcase>
|