ftpget triggering TCP RST at end of download

Stephen Warren swarren at wwwdotorg.org
Sun Sep 25 00:50:35 UTC 2005


Jason Schoon wrote:
> Actually, this does sound like a common bug I have seen in TCP 
> applications.  If you don't read everything out of the recv socket 
> before closing the stack thinks that you terminated abnormally and sends 
> a reset.  This sounds like the correct fix to me.

Well, I've certainly seen the bug where server sends 100 bytes, and 
client only reads e.g. 90 bytes. In that scenario, I'd expect the TCP RST.

However, in this case, the server sends N bytes and the client reads N 
bytes, so I don't quite understand exactly why the TCP RST occurs, since 
all data has been read.

Does the socket API (or Linux implementation) treat EOF "notification" 
as data that must be read?

Glenn L. McCrath wrote:

 > Interesting problem, it sounds like it could be fixed in ftpget, but
 > also i think current behaviour should work.
 >
 > If the kernel (or could it be libc?) is behaving eratically with this
 > code, maybe other applications could have this same problem.
 >
 > Have you tried a few different kernel, say a 2.4.x kernel, or a
 > different libc ?

I've only tried Busybox 1.00 built using gcc 3.4.3 with uClibc 0.9.27 
running on an Athlon-optimized 2.6.10 kernel.

I'm assuming read() is going straight to the kernel, so that'd be the 
only variable...

-- 
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren at wwwdotorg.org     http://www.wwwdotorg.org/pgp.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://lists.busybox.net/pipermail/busybox/attachments/20050924/44b6ed2d/attachment.pgp 


More information about the busybox mailing list