On Fri, Dec 19, 2003 at 12:20:24PM +0300, Alexander V. Lukyanov wrote:
> The problem was with mirroring of empty files with -c option. Here is
> the patch to fix it. Please test. 2.6.11 will be released soon with the fix.
Patch attached this time. Sorry.
Index: ChangeLog
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ChangeLog,v
retrieving revision 1.744
diff -u -p -r1.744 ChangeLog
--- ChangeLog 17 Dec 2003 08:31:20 -0000 1.744
+++ ChangeLog 19 Dec 2003 08:59:09 -0000
@@ -1,3 +1,8 @@
+2003-12-19 Alexander V. Lukyanov <[EMAIL PROTECTED]>
+
+ * LocalAccess.cc: (StoreStatus) return OK when not opened for storing.
+ * FileCopy.cc: skip storing past eof only if there is such file already.
+
2003-12-17 Alexander V. Lukyanov <[EMAIL PROTECTED]>
* module.cc: rename module_into to lftp_module_info to avoid
Index: LocalAccess.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/LocalAccess.cc,v
retrieving revision 1.45
diff -u -p -r1.45 LocalAccess.cc
--- LocalAccess.cc 17 Dec 2003 13:01:24 -0000 1.45
+++ LocalAccess.cc 19 Dec 2003 08:39:31 -0000
@@ -465,6 +465,8 @@ int LocalAccess::Write(const void *vbuf,
int LocalAccess::StoreStatus()
{
+ if(mode!=STORE)
+ return OK;
if(!stream)
return IN_PROGRESS;
if(stream->getfd()==-1)
Index: FileCopy.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileCopy.cc,v
retrieving revision 1.98
diff -u -p -r1.98 FileCopy.cc
--- FileCopy.cc 11 Dec 2003 11:18:56 -0000 1.98
+++ FileCopy.cc 19 Dec 2003 08:52:17 -0000
@@ -890,7 +890,7 @@ void FileCopyPeerFA::OpenSession()
}
else // mode==PUT
{
- if(e_size!=NO_SIZE && seek_pos>=e_size)
+ if(e_size>=0 && size>=0 && seek_pos>=e_size)
{
debug((10,"copy dst: seek past eof (seek_pos=%lld, size=%lld)\n",
(long long)seek_pos,(long long)e_size));