From 6f750f3b575bce420666b8115c1db7897dae5f7a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 2 Aug 2007 14:09:08 +0000 Subject: 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! --- lib/url.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/url.c b/lib/url.c index 0de87a824..21b869efa 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3604,18 +3604,24 @@ static CURLcode CreateConnection(struct SessionHandle *data, ***********************************************************************/ #ifndef CURL_DISABLE_FILE if (strequal(conn->protostr, "FILE")) { - /* anyway, this is supposed to be the connect function so we better - at least check that the file is present here! */ - result = Curl_file_connect(conn); - - /* Setup a "faked" transfer that'll do nothing */ - if(CURLE_OK == result) { - conn->data = data; - conn->bits.tcpconnect = TRUE; /* we are "connected */ - ConnectionStore(data, conn); - - result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */ - -1, NULL); /* no upload */ + /* this is supposed to be the connect function so we better at least check + that the file is present here! */ + result = Curl_file_connect(conn); + + /* Setup a "faked" transfer that'll do nothing */ + if(CURLE_OK == result) { + conn->data = data; + conn->bits.tcpconnect = TRUE; /* we are "connected */ + + ConnectionStore(data, conn); + + 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; -- cgit v1.2.3