konqueror embedded from busybox init

Stephen Warren swarren at wwwdotorg.org
Thu Mar 9 00:47:58 UTC 2006


yan seiner wrote:
> I am beginning to suspect that it may be something with busybox httpd
> closing the connection before konq/e is ready for it...  Just from
> watching it, the crash happens about the time the httpd child goes away,
> a second after the flash movie starts.  Why it would only happen from
> init I don't know....

I haven't looked into the code, but check the HTTPD code for this:

When HTTP wants to close the connection, it needs to make sure that it
has read all data the input side of the connection before closing it. If
you don't, then the IP stack will issue an RST packet to the client, so
that it won't receive all data, even if it's already sitting in the
client's input buffers.

You may also want to look into half-close operations on the socket -
often, this is the sequence on the server:

1. read request from client
2. send response
3. close just sending half of the socket
4. drain input socket (possibly with timeout) but reading until EOF
5. close receiving side of socket

or something like that.

When I wrote a web-server a couple years back, I didn't do the above,
and found that IE always worked perfectly, but Firefox (or possibly
Mozilla) would always show empty documents for some/all requests (but no
error message).

When I eventually got around to investigating, I found that Firefox was
sending a lot of headers, which were too large to fit into my fixed-size
input buffer for the request, so that data was sitting in the server's
IP stack's input buffer for my socket. IE sent fewer headers, so this
didn't happen. When the server closed the socket (regular close() call),
the IP stack saw unread input data, and sent an RST to the client, which
then threw away any data in the IP stack not yet read by the client.

There are similar issues in the Busybox ftpget application (or were -
I'm not sure if my patch was merged yet, since I haven't been tracking it).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060308/a7e8a802/attachment.pgp 


More information about the busybox mailing list