fgb pointed me to TDs web server on IRC the other day,
its really aimed at embedded devices but I would trust
his code.

http://www.iq0.com/duffgram/http.c

-Steve