Date: Sun, 4 Oct 1998 17:30:09 +0200 (CEST) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: marcs@znep.com (Marc Slemko) Cc: andre.albsmeier@mchp.siemens.de, hackers@FreeBSD.ORG Subject: Re: Only "fetch -b" works, what am I doing wrong? Message-ID: <199810041530.RAA23757@internal> In-Reply-To: <Pine.GSO.4.02A.9810020824210.4587-100000@redfish> from Marc Slemko at "Oct 2, 1998 8:26:19 am"
next in thread | previous in thread | raw e-mail | index | archive | help
> On Fri, 2 Oct 1998, Andre Albsmeier wrote:
>
> > Hi,
> >
> > I have written a small programm that serves http requests.
> > When using fetch I have to use "fetch -b" because without
> > -b fetch complains with: "fetch: empty reply from myserver.org"
> >
> > While digging around in http.c, I found out that -b
> > works around a linux bug. One of the correspondig
> > lines is:
> >
> > if (sendmsg(s, &msg, fs->fs_linux_bug ? 0 : MSG_EOF) < 0) {
> >
> > This means, my small http server works when setting flags
> > (of sendmsg) to 0. I assume, the correct way would be to set
> > MSG_EOF but somehow my http server doesn't work with it.
>
> You are not dealing properly with the case where the client half closes
> the connection before the response is fully sent. It shouldn't be too
> hard to add some debugging to your code to verify exactly where the
> problem is coming up, if your server is incorrectly assuming that if the
> socket is half closed it should abort, etc.
You were right. I didn't handle my select() loop properly.
Thanks for the help,
-Andre
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810041530.RAA23757>
