public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
* webserver stalls
@ 2002-10-14  8:41 jb1
  2002-10-14 22:20 ` Paul Nasrat
  0 siblings, 1 reply; 2+ messages in thread
From: jb1 @ 2002-10-14  8:41 UTC (permalink / raw)
  To: linux-8086

The ELKS webserver stalls when I access the 266-byte sample web page from
Red Hat 7.0 (see below for versions). The problem seems to be related to
the "Content-Length", which is apparently equal to the size of the web
page file. If the file size is less than 100 then both "get /"  from
telnet and lynx (a browser) display the file as expected; if the file size
is 100 or larger then both stall. Both lynx and telnet work properly with 
everything I've tried except ELKS.

There's nothing distinctive about 99 or 100 in binary, but in packed BCD
99 can be stored in one byte, while 100 requires two to be distinguishable
from 0 or 1 (depending on byte order). I don't think this is the cause of
the problem because lynx stalls with a message that one byte has been read
with both 101- and 266-byte files, and stalls with no such message with a
100-byte file.

Another possible cause of the problem is byte order. This code fragment 
from main() in httpd.c:
	localadr.sin_port = htons(DEF_PORT);
converts DEF_PORT to a byte-reversed short integer, whereas this code 
fragment from process_request() in httpd.c:
	size = lseek(fin, (off_t)0, SEEK_END);
	...
	sprintf(buf,"Content-Length: %d\r\n\r\n",size);
does *not* reverse the bytes. This can't, in itself, be the cause 
of the problem because it just determines the file size and sends it as an 
ASCII string, but if the integer "size" is sent in binary without 
conversion from host- to network-byte-order then the other end will 
generally expect too few or to many bytes from httpd. A 4369 (0x1111) byte 
file fails, but this isn't definitive if the size is transmitted as a 
long. In that case the appropriate test file size would be 0x11111111 
(286331153), 0x22222222, etc.

SOURCE PACKAGES:
        elks-0.1.1.tar.gz, elkscmd_20020501.tar.gz, elksnet-0.1.1.tar.gz,
        Dev86src-0.16.0.tar.gz
CVS PATCHES:
        (none)
COMPILED UNDER:
        Red Hat 7.0 Linux, kernel 2.2.16-22


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: webserver stalls
  2002-10-14  8:41 webserver stalls jb1
@ 2002-10-14 22:20 ` Paul Nasrat
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Nasrat @ 2002-10-14 22:20 UTC (permalink / raw)
  To: linux-8086

On Mon, Oct 14, 2002 at 01:41:49AM -0700, jb1@btstream.com wrote:
> The ELKS webserver stalls when I access the 266-byte sample web page from
> Red Hat 7.0 (see below for versions). The problem seems to be related to
> the "Content-Length", which is apparently equal to the size of the web
> page file. If the file size is less than 100 then both "get /"  from
> telnet and lynx (a browser) display the file as expected; if the file size
> is 100 or larger then both stall. Both lynx and telnet work properly with 
> everything I've tried except ELKS.

Thanks for such a detailed report, I'll see if I can replicate this on
my setup - but that probably won't be untill the weekend.

Paul

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-14 22:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-14  8:41 webserver stalls jb1
2002-10-14 22:20 ` Paul Nasrat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox