[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#708372: don't say "100%" until the file is really fully transmitted



On Wed, May 15, 2013 at 08:05:54PM +0800, jidanni@jidanni.org wrote:
> X-Debbugs-Cc: tri@iki.fi,ylo@cs.hut.fi

These people wrote the original version of scp, but I don't believe they
have been involved since OpenSSH was created.  Please don't bother them
about this.

> scp prints "100%" at the very beginning of the transmission.
> Whereupon people think the job is done and close down their computers
> only to discover the next day the file was not fully transmitted to
> their boss after all etc. etc.
> 
> $ scp big_file mysite.com:
> dieyuan_logo_1181x1073.jpg                                                   100%  794KB 793.9KB/s   00:00
> 
> It should wait for the file to really be fully transited before saying that!

I agree that this is a bug.  Unfortunately it turns out to be difficult
to fix for the reasons given in the OpenSSH FAQ:

  http://www.openssh.org/faq.html#2.10

Specifically, a natural fix for this bug would require extending the scp
"protocol" to have the sink end of the connection send acknowledgements
back to the source each time it's received a chunk of data.  Given
interoperability requirements, I think this is very unlikely to be
feasible.

Normally, the answer to this kind of thing would be "use sftp instead".
However, I checked and it has the same bug, even though the SFTP
protocol does involve sending back acknowledgement messages after
receiving each chunk of data.  That means this is just a client bug, so
it should be quite tractable, and indeed was only a few minutes' work.
I filed https://bugzilla.mindrot.org/show_bug.cgi?id=2108 upstream with
a patch which fixes sftp's progress meter to behave as you request; I
hope they'll accept that.

Now, that only provides a workaround in the form of using a different
program, and doesn't really fix this bug properly since for many
purposes scp's interface is more convenient.  I have been meaning for a
long time to convert scp into an SFTP client under the covers, when it
isn't being called in such a way that requires it to speak the old
protocol.  If I ever manage to do that, or anyone else for that matter,
then that would allow this bug to be fixed properly, along with a number
of others.  Until then it will have to be blocked.

Thanks,

-- 
Colin Watson                                       [cjwatson@debian.org]


Reply to: