[prev in list] [next in list] [prev in thread] [next in thread] 

List:       proftpd-committers
Subject:    [ProFTPD-committers] proftpd/contrib/mod_sftp scp.c,1.78,1.79
From:       TJ Saunders <castaglia () users ! sourceforge ! net>
Date:       2013-02-27 17:10:30
Message-ID: E1UAkWW-0000YX-CS () sfs-ml-2 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/proftp/proftpd/contrib/mod_sftp
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25807/contrib/mod_sftp

Modified Files:
	scp.c 
Log Message:

Bug#3904 - scp downloads using glob pattern sometimes fails.


Index: scp.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/contrib/mod_sftp/scp.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- scp.c	15 Feb 2013 22:46:42 -0000	1.78
+++ scp.c	27 Feb 2013 17:10:27 -0000	1.79
@@ -1679,7 +1679,7 @@
     }
 
     pr_trace_msg(trace_channel, 3, "sending '%s' data (%lu bytes)", sp->path,
-      (unsigned long) chunklen);
+      need_confirm ? (unsigned long) (chunklen - 1) : (unsigned long) chunklen);
 
     res = sftp_channel_write_data(p, channel_id, chunk, chunklen);
     if (res < 0) {
@@ -2124,8 +2124,16 @@
         /* If we've sent all the paths, and we're here, assume that everything
          * is OK.  We may just have received the final "OK" ACK byte from the
          * scp client, and have nothing more to do.
+         *
+         * We would normally return 1 here, to indicate that we are done with
+         * the transfer.  However, doing so indicates to the channel-handling
+         * code that the channel is done, and should be closed.
+         *
+         * In the case of scp, though, we want the client to close the
+         * connection, in order ensure that it has received all of the data
+         * (see Bug#3904).
          */
-        return 1;
+        return 0;
       }
 
       return -1;


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic