lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP HTTP Issue sending multiple packets


From: Sergio R. Caprile
Subject: Re: [lwip-users] LWIP HTTP Issue sending multiple packets
Date: Wed, 03 Jun 2015 09:43:18 -0300
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

I seem to understand what you are trying to do.
Support for CGI is maybe less than minimal in the contrib tree web
server; I don't know what Atmel did on this, if any. But, anyway, it all
comes down to the basic TCP functions you'll find in the wiki

http://lwip.wikia.com/wiki/Raw/TCP

You are not sending raw Ethernet frames, you are sending TCP segments,
your limit is the TCP MSS buffering space. Check the http_send()
function again and you'll see.
I bet your problem is that you are not taking ACKs into account.
In short and not too strictly true: You may send upto the window size,
then you can't send anything else until you get an ACK from the remote side.
The stack will inform you when an ACK is received. You then will call
the stack to keep sending. The problem from within an http server is...
In short: you get the HTTP connection, you enter your app function via
the parser (recognizes the GET/POST, the URL belongs to your function,
and it is called somehow). Then you will call http_write() or however
you decide to wrap the final call to tcp_send(). THEN, you can't send
more than what TCP provides in this stage. THEN, you have to wait for an
ACK coming, it will go through to http_sent(), which will call
http_send(), and this function has to have a way to know that your
function has to be called... I don't know if Atmel provided a way for
you to do this; you need to study an actual CGI sending data to
understand that. From your example, I bet there isn't.
If you have lots of RAM, you might buffer all your data in a "file" and
serve that file. http_send() is basically written to serve files. Once
you understand how http_send() works, you might change it to serve your
purposes, but, are you willing to do this ?
If you want a webserver with some CGI support and some examples of
actually sending data on a CGI function, try my fork:

http://scaprile.ldir.com.ar/cms/el-ingeniero/open-source-projects-im-working-on/lwhttpd/

In this server your CGI function is basically a function that just
stores data in a buffer and returns.
How you handle the asynchronicity between the mic sampling frequency and
the http transfer rate is all up to you.



reply via email to

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