[En-Nut-Discussion] HTTP QueryString parser

Mikael Adolfsson ethernut at ma.stendahls.net
Wed Sep 10 21:42:50 CEST 2003


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




More information about the En-Nut-Discussion mailing list