[En-Nut-Discussion] HTTP QueryString parser
Lars Andersson
laran at ikp.liu.se
Wed Sep 10 22:33:33 CEST 2003
Hi Mikael,
Sorry for not being specific on the version and HW. I am using Nut/OS 3.3 on a rev-d board.
I have found out that the "NutHttpGetParameterCount" function works fine and returns the correct number of parameters. It seams that the mpu makes weird things inside the loop. The output is different for the same query string.
I have used the httpd.c and httpd.h files and not patched anything.
Do you have any clue on how much memory this process requires compared to the original code. Could it be that I have not dedicated enough memory when starting the thread dong the processing?
I'll try this code in a simpler application than I am working on right now and see what happens.
Regards,
/Lars A Andersson
-----Original Message-----
From: Mikael Adolfsson [mailto:ethernut at ma.stendahls.net]
Sent: den 10 september 2003 21:43
To: en-nut-discussion at egnite.de
Subject: RE: [En-Nut-Discussion] HTTP QueryString parser
Hi,
Your code is a correct way of using it.
Here are a few things to check:
Do you get various results on the same querystring? Does the
NutHttpGetParameter(req, name)-method work?
Can you see if the mpu hangs before it enters your cgi, or if it hangs on
one of the NutHttpGet*-methods? (The querystring is parsed, when
NutHttpProcessRequest() finds out that the request contains a
questionmark)
What version of Nut/OS do you use? The patch I submitted was based on the
current Nut/OS 3.3-file, taken from the cvs 7/9. Did you use my
httpd.c-file or did you patch your own httpd.c? I first wrote this code
for Nut/OS 2.2(?), and I have to admit that I just applied my changes to
the 3.3-file. The httpd.c-file is only tested with my modified version of
Nut/OS 3.3.
As I mentioned before, this code is not tested on the ethernut board; only
on my hardare. I will test it further as soon as I get one.
/ Mikael
On Wed, 10 Sep 2003, Lars Andersson wrote:
> Hi,
>
> I have tried some of your functions and with mixed success.
>
> When I do the following operation the processor sometimes hang and most
> of the time the output strings look very strange.
>
> char *cpn;
> char *cpv;
> u_char i;
> u_char count;
>
> count=NutHttpGetParameterCount(req);
> for (i =0 ; i < count; i++)
> {
> cpn=NutHttpGetParameterName(req, i);
> cpv=NutHttpGetParameterValue(req, i);
> printf("%s:%s\n\r",cpn,cpv);
> }
>
> please advise,
>
> Regards,
> /Lars
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list