lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : [lwip-users] webserver withmethod=POST


From: Frédéric BERNON
Subject: RE : [lwip-users] webserver withmethod=POST
Date: Wed, 25 Jul 2007 14:49:44 +0200

>Could this also a limitation that our httpd closes the TCP connection
>after sending one file whereas most 'modern' webservers re-use a TCP
>connection for multiple requests?

A web server could reply with a "Connection: close" in its HTTP headers reply, 
even if a browser ask to "Connection: Keep-Alive" it. There is no "functional" 
limitation on that. If we want to be compatible on most of "modern" browsers, 
the httpd  should process multiples requests in the same time, using several 
threads to do that (with a software limitation to avoid any DoS attack). Else, 
one HTTP connection could block too long time others HTTP connections (since 
they are not process before the end of the first one).

To my point of view, httpd is just good enough as sample, but can be considered 
like a real http server (or a very very simple one). So improve such things is 
not something we should do (it will give a sample more difficult to 
understand)...
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Goldschmidt Simon
Envoyé : mercredi 25 juillet 2007 13:15
À : Mailing list for lwIP users
Objet : RE: [lwip-users] webserver withmethod=POST



> Ok, it's confirm what I thought. With the default
> MEMP_NUM_NETCONN(4), when you're browser read the main doc, 
> it see(parse) there is several "sub docs" to read. Most of 
> modern browsers try to accelerate the response time by 
> sending multiples "GET" in parallel (in the same time). Your 
> target receive all, but since you process each request in a 
> sequential order (you don't launch a thread for each one, 
> which is usual in embedded targets), if your target if too 
> "slow", you don't call netconn_delete fast enought, and the 
> one or several request will failed since there is not enought 
> netconn in the memp pool. MEMP_NUM_NETCONN=10 is a good value 
> since most of browsers can send max. 8 requests in the same 
> time (and you use one for listen).


Could this also a limitation that our httpd closes the TCP connection
after sending one file whereas most 'modern' webservers re-use a TCP
connection for multiple requests?

This can be achieved with our httpd by not actively closing the pcb
after sending but only closing after a timeout or as a response to
a client closing its side of the connection (i.e. http_recv() being
called with a pbuf of NULL).


Simon


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

[Prev in Thread] Current Thread [Next in Thread]