[PATCH] broken inetd support in busybox httpd

Mathias Jeschke busybox at gmj.cjb.net
Wed Jan 10 12:54:32 PST 2007


----- Forwarded message from Mathias Jeschke <jeschke at informatik.hu-berlin.de> -----

From: Mathias Jeschke <jeschke at informatik.hu-berlin.de>
To: Vladimir Oleynik <dzo at simtreas.ru>
CC: busybox at busybox.net
Subject: [PATCH] broken inetd support in busybox httpd
Date: Wed, 10 Jan 2007 19:27:25 +0100
Message-ID: <20070110182725.GA22503 at mail.majes.de>

Hello,

I send this patch to fix the inetd support for the httpd in busybox
(I tested 1.3.1 and svn version).

The bug origns in the treatment of fds for writing at the functions
sendHeaders() and sendFile(). The unpatched busybox version uses the
same! fd for reading and writing - what is not problematic with sockets,
which are bi-directional.

To fix it, I have added another int variable "accepted_write_socket"
to the "HttpdConfig" struct and rewrites the use of config->accepted_socket
in the full_write(...) calls.

Finally im not sure if I introduced some potential errors of the select()
usage in the combination with the write-direction
(e.g. if the clients is busy).

Additionally I fixed two bugs, if someone won't select HTTPD_CGI.

Regards,
Mathias

-- 
Mathias Jeschke
home: http://www.informatik.hu-berlin.de/~jeschke/
mail: jeschke at informatik.hu-berlin.de
gpg fingerprint: CF50 E22C 50F4 AF70 9628  7AB9 7E10 3A60 EAE5 4729

----- End forwarded message -----


More information about the busybox mailing list