Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 1998 08:26:19 -0700 (PDT)
From:      Marc Slemko <marcs@znep.com>
To:        Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Only "fetch -b" works, what am I doing wrong?
Message-ID:  <Pine.GSO.4.02A.9810020824210.4587-100000@redfish>
In-Reply-To: <199810020730.JAA05992@internal>

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.


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?Pine.GSO.4.02A.9810020824210.4587-100000>