Loading CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ Changelog Daniel Stenberg (29 Sep 2008) - Ian Lynagh provided a patch that now makes CURLOPT_RANGE work fine for SFTP downloads! - Maxim Ivanov filed bug report #2107803 (http://curl.haxx.se/bug/view.cgi?id=2107803) "no CURLINFO_REDIRECT_URL in multi mode" together with a patch that fixed the problem. Loading RELEASE-NOTES +2 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ This release includes the following bugfixes: o removed the use of mktime() and gmtime(_r)() in date parsing and conversions o HTTP Digest with a blank realm did wrong o CURLINFO_REDIRECT_URL didn't work with the multi interface o CURLOPT_RANGE now works for SFTP downloads This release includes the following known bugs: Loading @@ -44,6 +45,6 @@ advice from friends like these: Keith Mok, Yang Tse, Daniel Fandrich, Guenter Knauf, Dmitriy Sergeyev, Linus Nielsen Feltzing, Martin Drasar, Stefan Krause, Dmitry Kurochkin, Mike Revi, Andres Garcia, Michael Goffioul, Markus Moeller, Rob Crittenden, Jamie Lokier, Emanuele Bovisio, Maxim Ivanov Jamie Lokier, Emanuele Bovisio, Maxim Ivanov, Ian Lynagh Thanks! (and sorry if I forgot to mention someone) TODO-RELEASE +0 −2 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ To be addressed before 7.19.1 (planned release: October/November 2008) possibly the same or related to "Potential issue when using the new PRIMARY_IP metric" 176 - "SFTP and CURLOPT_RANGE" 177 - "[Patch] Disable proxy support" 178 - "[Patch] Disable multi API support" Loading lib/ssh.c +30 −3 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ #include "inet_ntop.h" #include "parsedate.h" /* for the week day and month names */ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ #include "strtoofft.h" #include "multiif.h" #define _MPRINTF_REPLACE /* use our functions only */ Loading Loading @@ -1631,9 +1632,35 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) data->req.maxdownload = -1; } else { data->req.size = attrs.filesize; data->req.maxdownload = attrs.filesize; Curl_pgrsSetDownloadSize(data, attrs.filesize); curl_off_t size; size = attrs.filesize; if(conn->data->state.use_range) { curl_off_t from, to; char *ptr; char *ptr2; from=curlx_strtoofft(conn->data->state.range, &ptr, 0); while(ptr && *ptr && (isspace((int)*ptr) || (*ptr=='-'))) ptr++; to=curlx_strtoofft(ptr, &ptr2, 0); if ((ptr == ptr2) /* no "to" value given */ || (to > size)) { to = size; } if (from > to) { from = to; size = 0; } else { size = to - from + 1; } libssh2_sftp_seek(conn->proto.sshc.sftp_handle, from); } data->req.size = size; data->req.maxdownload = size; Curl_pgrsSetDownloadSize(data, size); } /* We can resume if we can seek to the resume position */ Loading Loading
CHANGES +3 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ Changelog Daniel Stenberg (29 Sep 2008) - Ian Lynagh provided a patch that now makes CURLOPT_RANGE work fine for SFTP downloads! - Maxim Ivanov filed bug report #2107803 (http://curl.haxx.se/bug/view.cgi?id=2107803) "no CURLINFO_REDIRECT_URL in multi mode" together with a patch that fixed the problem. Loading
RELEASE-NOTES +2 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ This release includes the following bugfixes: o removed the use of mktime() and gmtime(_r)() in date parsing and conversions o HTTP Digest with a blank realm did wrong o CURLINFO_REDIRECT_URL didn't work with the multi interface o CURLOPT_RANGE now works for SFTP downloads This release includes the following known bugs: Loading @@ -44,6 +45,6 @@ advice from friends like these: Keith Mok, Yang Tse, Daniel Fandrich, Guenter Knauf, Dmitriy Sergeyev, Linus Nielsen Feltzing, Martin Drasar, Stefan Krause, Dmitry Kurochkin, Mike Revi, Andres Garcia, Michael Goffioul, Markus Moeller, Rob Crittenden, Jamie Lokier, Emanuele Bovisio, Maxim Ivanov Jamie Lokier, Emanuele Bovisio, Maxim Ivanov, Ian Lynagh Thanks! (and sorry if I forgot to mention someone)
TODO-RELEASE +0 −2 Original line number Diff line number Diff line Loading @@ -17,8 +17,6 @@ To be addressed before 7.19.1 (planned release: October/November 2008) possibly the same or related to "Potential issue when using the new PRIMARY_IP metric" 176 - "SFTP and CURLOPT_RANGE" 177 - "[Patch] Disable proxy support" 178 - "[Patch] Disable multi API support" Loading
lib/ssh.c +30 −3 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ #include "inet_ntop.h" #include "parsedate.h" /* for the week day and month names */ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ #include "strtoofft.h" #include "multiif.h" #define _MPRINTF_REPLACE /* use our functions only */ Loading Loading @@ -1631,9 +1632,35 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) data->req.maxdownload = -1; } else { data->req.size = attrs.filesize; data->req.maxdownload = attrs.filesize; Curl_pgrsSetDownloadSize(data, attrs.filesize); curl_off_t size; size = attrs.filesize; if(conn->data->state.use_range) { curl_off_t from, to; char *ptr; char *ptr2; from=curlx_strtoofft(conn->data->state.range, &ptr, 0); while(ptr && *ptr && (isspace((int)*ptr) || (*ptr=='-'))) ptr++; to=curlx_strtoofft(ptr, &ptr2, 0); if ((ptr == ptr2) /* no "to" value given */ || (to > size)) { to = size; } if (from > to) { from = to; size = 0; } else { size = to - from + 1; } libssh2_sftp_seek(conn->proto.sshc.sftp_handle, from); } data->req.size = size; data->req.maxdownload = size; Curl_pgrsSetDownloadSize(data, size); } /* We can resume if we can seek to the resume position */ Loading