[En-Nut-Discussion] tap stream of Request
Landsperger, Werner
Werner.Landsperger at cassidian.com
Tue May 10 09:08:46 CEST 2011
Hey together,
thanks for your responses but actually it works ;) If I'm honest, I
can't say exactly why but now my code works and I can transfer files
from my webinterface to my memory-card. I've just overlooked that
NutHttpProcessQueryString just execute when a "?" is in the url. :) But
actualy it's extreme slowly. For example, a file with 600kb needs to
transfer about 30 secounds. Did anyone have an idea to accelerate the
transfer? Actually i use an buffersize of 128 Bytes.
Is there any limit of sizes for memory-cards? I've tried to use an 4GB
card but with no success.
Many greets!
Werner Landsperger
-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Harald Kipp
Sent: Monday, May 09, 2011 12:13 PM
To: en-nut-discussion at egnite.de
Subject: Re: [En-Nut-Discussion] tap stream of Request
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.
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list