Project

General

Profile

Actions

Bug #915

closed

Netcat hangs/dies when used against a Lighttpd server

Added by spillgroup over 17 years ago. Updated over 15 years ago.

Status:
Invalid
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

While experimenting with netcat (the original 1.10 version, not the GNU version) I encountered a weird problem. Everytime I try to use netcat to simulate an HTTP client against an Lighttpd server, the process either hangs until timeout or dies unexpectedly. While hanging, the connection shows up in server-status in state 'read' with 0 bytes being read or written.

I tried netcat on three different platforms:

- On Cygwin 1.5 the netcat process mostly hangs, but sometimes it dies unexpectedly.

- On Fedora FC3 and CentOS 4.4 the netcat process always dies unexpectedly.

Never did I get any response from the Lighttpd server.

I made a script which illustrates this behaviour. First a hit is being done with curl and next with netcat simulating curl (sending the same headers etc). I've tried this on a few random sites and these are the results:

Site Server Cygwin Fedora CentOS
www.agame.com lighttpd/1.4.13 Hangs Dies Dies
www.apple.com Apache/1.3.33 OK OK OK
www.chefkoch.de lighttpd/1.4.11 Dies Dies Dies
www.freshmeat.net Apache/1.3.37 OK OK OK
www.google.com GWS/2.1 OK OK OK
www.lighttpd.net lighttpd/1.4.12 Hangs Dies Dies
www.microsoft.com Microsoft-IIS/6.0 OK OK OK
www.sourceforge.net lighttpd/1.4.13 Hangs Dies Dies
www.youtube.com Apache OK OK OK

Now this could be a flaw in netcat ofcourse, but the question is: why would such a fault be triggered by Lighttpd and not by other webservers?

I have straces for both client and server, but I guess those can be easily reproduced with the attached scripts.


Files

testlighty.sh (333 Bytes) testlighty.sh spillgroup, 2006-11-23 10:21
testit.sh (227 Bytes) testit.sh spillgroup, 2006-11-23 10:21
Actions #1

Updated by stbuehler about 16 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid

You must send CR LF as newline for a valid request.

Fixed in 1.5 with a new parser, which accepts LF too.

Actions #2

Updated by spillgroup about 16 years ago

Great! Thanks, Jan.

Actions #3

Updated by spillgroup about 16 years ago

Woops, I mean Stefan. ;-)

Actions #4

Updated by stbuehler over 15 years ago

  • Status changed from Fixed to Invalid
Actions

Also available in: Atom