continue mode for fish

Loic Le Loarer <[email protected]>
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
Hello

Here is a patch to add support for continue mode in fish protocol, this
is easy to implement, should work with any version of dd, and is very
very usefull. Do you think this could be included in future versions of
lftp ?

(Please cc me on answer, I'm not on the list, thanks.)

Best regards

-- 
Loïc

--- lftp-3.0.9/src/Fish.cc	2004-09-09 11:31:44.000000000 +0200
+++ lftp-3.0.9.new/src/Fish.cc	2004-10-20 00:59:21.000000000 +0200
@@ -527,12 +527,19 @@
       real_pos=0;
       break;
    case RETRIEVE:
-      Send("#RETR %s\n"
+      if (pos>0) {
+        Send("#RETR %s\n"
+	   "ls -lLd %s; "
+	   "echo '### 100'\n"
+           "dd ibs=1 skip=%lld if=%s; echo '### 200'\n",e,e,(long long)pos,e);
+      } else {
+        Send("#RETR %s\n"
 	   "ls -lLd %s; "
 	   "echo '### 100'; cat %s; echo '### 200'\n",e,e,e);
+      }
       PushExpect(EXPECT_RETR_INFO);
       PushExpect(EXPECT_RETR);
-      real_pos=0;
+      real_pos=pos;
       break;
    case STORE:
       if(entity_size<0)
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBdZ8K9Jq4sC4j73YRAsG7AKCbGopvtkMqkCYXc7e+UlCj4K/sFwCcCrhC
rP9mBdztvp0TbJTpFw2sazc=
=bslG
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.