Dmitriy Sergeyev reported a regression: resumed file:// transfers broke

after 7.16.2. This is much due to the different treatment file:// gets
internally, but now I added test 231 to make it less likely to happen again
without us noticing!
This commit is contained in:
Daniel Stenberg 2007-08-02 14:09:08 +00:00
parent 5a6dcdc36c
commit 6f750f3b57
5 changed files with 58 additions and 12 deletions

View File

@ -6,6 +6,12 @@
Changelog Changelog
Daniel S (2 August 2007)
- Dmitriy Sergeyev reported a regression: resumed file:// transfers broke
after 7.16.2. This is much due to the different treatment file:// gets
internally, but now I added test 231 to make it less likely to happen again
without us noticing!
Daniel S (1 August 2007) Daniel S (1 August 2007)
- Patrick Monnerat and I modified libcurl so that now it *copies* all strings - Patrick Monnerat and I modified libcurl so that now it *copies* all strings
passed to it with curl_easy_setopt()! Previously it has always just refered passed to it with curl_easy_setopt()! Previously it has always just refered

View File

@ -32,6 +32,7 @@ This release includes the following bugfixes:
o FTPS data connection close o FTPS data connection close
o AIX 4 and 5 get to use non-blocking sockets o AIX 4 and 5 get to use non-blocking sockets
o small POST with NTLM o small POST with NTLM
o resumed file:// transfers
This release includes the following known bugs: This release includes the following known bugs:
@ -53,6 +54,6 @@ advice from friends like these:
Dan Fandrich, Song Ma, Daniel Black, Giancarlo Formicuccia, Shmulik Regev, Dan Fandrich, Song Ma, Daniel Black, Giancarlo Formicuccia, Shmulik Regev,
Daniel Cater, Colin Hogben, Jofell Gallardo, Daniel Johnson, Daniel Cater, Colin Hogben, Jofell Gallardo, Daniel Johnson,
Ralf S. Engelschall, James Housley, Chris Flerackers, Patrick Monnerat, Ralf S. Engelschall, James Housley, Chris Flerackers, Patrick Monnerat,
Jayesh A Shah, Greg Zavertnik, Peter O'Gorman, Greg Morse Jayesh A Shah, Greg Zavertnik, Peter O'Gorman, Greg Morse, Dmitriy Sergeyev
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -3604,18 +3604,24 @@ static CURLcode CreateConnection(struct SessionHandle *data,
***********************************************************************/ ***********************************************************************/
#ifndef CURL_DISABLE_FILE #ifndef CURL_DISABLE_FILE
if (strequal(conn->protostr, "FILE")) { if (strequal(conn->protostr, "FILE")) {
/* anyway, this is supposed to be the connect function so we better /* this is supposed to be the connect function so we better at least check
at least check that the file is present here! */ that the file is present here! */
result = Curl_file_connect(conn); result = Curl_file_connect(conn);
/* Setup a "faked" transfer that'll do nothing */ /* Setup a "faked" transfer that'll do nothing */
if(CURLE_OK == result) { if(CURLE_OK == result) {
conn->data = data; conn->data = data;
conn->bits.tcpconnect = TRUE; /* we are "connected */ conn->bits.tcpconnect = TRUE; /* we are "connected */
ConnectionStore(data, conn);
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ ConnectionStore(data, conn);
-1, NULL); /* no upload */
result = setup_range(data);
if(result)
return result;
result = Curl_setup_transfer(conn, -1, -1, FALSE,
NULL, /* no download */
-1, NULL); /* no upload */
} }
return result; return result;

View File

@ -42,4 +42,5 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test405 test604 test605 test606 test607 test608 test609 test294 test295 \ test405 test604 test605 test606 test607 test608 test609 test294 test295 \
test296 test297 test298 test610 test611 test612 test406 test407 test408 \ test296 test297 test298 test610 test611 test612 test406 test407 test408 \
test409 test613 test614 test700 test701 test702 test704 test705 test703 \ test409 test613 test614 test700 test701 test702 test704 test705 test703 \
test706 test707 test350 test351 test352 test353 test289 test540 test354 test706 test707 test350 test351 test352 test353 test289 test540 test354 \
test231

32
tests/data/test231 Normal file
View File

@ -0,0 +1,32 @@
<testcase>
# Server-side
<reply>
# 16 bytes to check
<datacheck>
B01234567
C01234567
</datacheck>
</reply>
# Client-side
<client>
<server>
file
</server>
<name>
file:// with resume
</name>
<command>
file://localhost/%PWD/log/test231.txt -C 10-
</command>
<file name="log/test231.txt">
A01234567
B01234567
C01234567
</file>
</client>
# Verify data after the test has been "shot"
<verify>
</verify>
</testcase>