Bug#379690: lftp: mirror -c gets stalled

2006-07-25 Thread Alexander V. Lukyanov
Here is a patch to fix the problem.

--
   Alexander.
Index: FileCopy.cc
===
RCS file: /home/lav/cvsroot/lftp/src/FileCopy.cc,v
retrieving revision 1.125
diff -u -p -r1.125 FileCopy.cc
--- FileCopy.cc 4 Jul 2006 05:15:35 -   1.125
+++ FileCopy.cc 25 Jul 2006 08:28:37 -
@@ -58,6 +58,9 @@ ResDecl max_redir(xfer:max-redirect
 // FileCopy
 #define super SMTask
 
+#define set_state(s) do { state=(s); \
+   Log::global-Format(11,FileCopy(%p) enters state %s\n, this, #s); } 
while(0)
+
 int FileCopy::Do()
 {
int m=STALL;
@@ -70,7 +73,7 @@ int FileCopy::Do()
switch(state)
{
pre_INITIAL:
-  state=INITIAL;
+  set_state(INITIAL);
   m=MOVED;
case(INITIAL):
   if(remove_target_first  !put-FileRemoved())
@@ -114,7 +117,7 @@ int FileCopy::Do()
 
   get-Suspend();
   put-Resume();
-  state=PUT_WAIT;
+  set_state(PUT_WAIT);
   m=MOVED;
   /* fallthrough */
case(PUT_WAIT):
@@ -137,7 +140,7 @@ int FileCopy::Do()
   get-Resume();
   get-StartTransfer();
   RateReset();
-  state=DO_COPY;
+  set_state(DO_COPY);
   m=MOVED;
   /* fallthrough */
case(DO_COPY): {
@@ -336,7 +339,7 @@ int FileCopy::Do()
   put-Resume();
   put_eof_pos=put-GetRealPos();
   debug((10,copy: waiting for put confirmation\n));
-  state=CONFIRM_WAIT;
+  set_state(CONFIRM_WAIT);
   m=MOVED;
case(CONFIRM_WAIT):
   if(put-Error())
@@ -344,7 +347,7 @@ int FileCopy::Do()
   /* check if put position is correct */
   if(put_eof_pos!=put-GetRealPos() || put-GetSeekPos()==FILE_END)
   {
-state=DO_COPY;
+set_state(DO_COPY);
 return MOVED;
   }
 
@@ -361,7 +364,7 @@ int FileCopy::Do()
   get-Empty();
   get-PutEOF();
   get-Resume();
-  state=GET_DONE_WAIT;
+  set_state(GET_DONE_WAIT);
   m=MOVED;
   end_time=now;
   put-Suspend();
@@ -377,12 +380,12 @@ int FileCopy::Do()
   if(!get-Done())
 return m;
   debug((10,copy: get is finished - all done\n));
-  state=ALL_DONE;
+  set_state(ALL_DONE);
   get-Suspend();
   return MOVED;
 
pre_GET_INFO_WAIT:
-  state=GET_INFO_WAIT;
+  set_state(GET_INFO_WAIT);
   m=MOVED;
case(GET_INFO_WAIT):
   if(get-Error())
@@ -401,7 +404,7 @@ void FileCopy::Init()
 {
get=0;
put=0;
-   state=INITIAL;
+   set_state(INITIAL);
max_buf=0x1;
cont=false;
error_text=0;
@@ -976,7 +979,7 @@ void FileCopyPeerFA::WantSize()
struct stat st;
if(!strcmp(session-GetProto(),file)
 stat(dir_file(session-GetCwd(),file),st)!=-1)
-  size=st.st_size;
+  SetSize(st.st_size);
else
   super::WantSize();
 }
@@ -1685,7 +1688,7 @@ void FileCopyPeerFDStream::WantSize()
   stat(stream-full_name,st);
 
if(st.st_size!=NO_SIZE)
-  size=st.st_size;
+  SetSize(st.st_size);
else
   super::WantSize();
 }


Bug#379690: lftp: mirror -c gets stalled

2006-07-24 Thread Akos . Frohner
Package: lftp
Version: 3.5.0-1
Severity: normal


When using 'mirror -c directory' lftp 3.5.0-1, the process
gets stalled. By increasing the debug level I get the draft
output:
PASV
LIST
TYPE I
MDTM file-1
MDTM file-2
and at this point it stops.
'mirror directory' works.

I compared the behaviour with lftp 3.4.7-1, which worked
fine and produced the following draft output:
PASV
LIST
TYPE I
MDTM file-1
MDTM file-2
PASV
REST 12345
RETR file-1

Both clients were using the same server and I have repeated
the exercise several times by installing one and the other
version of lftp. The behaviour was as described above in all
cases.

The mirror:use-pget-n (1) and caching options were left at 
their default values.

Test case:
lftp ftp://ftp.kernel.org/
mirror pub/linux/kernel/v2.6/pre-releases
Ctrl-C
mirror -c pub/linux/kernel/v2.6/pre-releases

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-ursula.6
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages lftp depends on:
ii  libc6 2.3.6-15   GNU C Library: Shared libraries
ii  libexpat1 1.95.8-3.2 XML parsing C library - runtime li
ii  libgcc1   1:4.1.1-5  GCC support library
ii  libgcrypt11   1.2.2-1LGPL Crypto library - runtime libr
ii  libgnutls13   1.4.0-3the GNU TLS library - runtime libr
ii  libgpg-error0 1.2-1  library for common error values an
ii  libncurses5   5.5-2  Shared libraries for terminal hand
ii  libreadline5  5.1-7  GNU readline and history libraries
ii  libtasn1-30.3.5-1Manage ASN.1 structures (runtime)
ii  netbase   4.25   Basic TCP/IP networking system
ii  zlib1g1:1.2.3-13 compression library - runtime

lftp recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]