[En-Nut-Discussion] tap stream of Request

Harald Kipp harald.kipp at egnite.de
Mon May 9 12:12:57 CEST 2011


Hi Werner,

On 5/9/2011 10:52 AM, Landsperger, Werner wrote:
> Yes thats right, NutHttpProcessRequest() will just read in the HTTP
> header but this function calls the function NutHttpProcessQueryString ()
> which read out the inputstring and parses them into name and value. So

I'll try to answer with my half baked knowledge about HTTP. :-)

NutHttpProcessRequest() will only call NutHttpProcessQueryString(), if
the URL contains a '?'.

 if ((cp = strchr(path, '?')) != 0) {
   ...
   NutHttpProcessQueryString(req);
 }
 ...
 NutHttpProcessFileRequest(stream, req);

When using the POST method, there shouldn't be any '?' in your URL. You
are sure your HTML form is set to POST instead of GET?

When using POST, NutHttpProcessRequest() will only call
NutHttpProcessFileRequest(), which calls NutCgiCheckRequest(),
NutCgiProcessRequest() and finally your CGI function, which then should
read and interpret the variables, which are part of the message body.

Can you see the HTTP parameters in the body?

> when I watch at the TCP/IP transaction via WireShark I can see that the
> ethernutboard determines the connection. At first the board  send a
> windowsize 0 message which would be asked again 2 seconds later from the

Announcing a TCP window size of 0 means, that the receive buffer is
full. The peer is requested to try again by polling the window size...

> pc and after that the board send an reset. But in the whole

...which it obviously follows. So, up to this point everything is
working as designed.

As soon as you CGI script starts reading from the stream, the window
size will grow again.


> So I think, that the function NutHttpProcessQueryString() disturb me by
> reading out the stream. What do you think about that? And how can I edit
> ethernut-files and compile it to a library with the
> ethernut-configuartor?

If in doubt with any API function, it is always a good idea to copy the
C source file from the source tree to your application's directory and
add its name to the Makefile, e.g.

 SRCS =  $(PROJ).c httpd.c httpd_p.c

When linking the application, it will replace the Nut/OS API code by the
local version. You can check this in the .map file.

Regards,

Harald

P.S.: Your postings appear out of thread. Are you responding to the
digest version of the mailing list? If yes, you can change this at the
link given below.



More information about the En-Nut-Discussion mailing list