Archon- / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

mg_get_var Parsing Problem #381

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem Description:
mg_get_var expects an ampersand at the end of each var=val pair, which is not 
the case for the last variable in a form, at least with the current 
implementation of POST forms and mg_read. I've worked around the problem by 
manually appending an ampersand at the end of my post_buffer (that I passed 
into mg_read).

What steps will reproduce the problem?
1. Serve up a POST action form.
2. mg_read the POST data back out on form submit.
3. mg_get_var the last variable returns -1 and an empty value string, despite 
the POST buffer clearly containing the variable and its value.

What is the expected output? What do you see instead?
I should see mg_get_var return the variable value. Instead, I get a -1 return 
code and an empty value string.

What version of the product are you using? On what operating system?
3.1, Linux

Please provide any additional information below.

Original issue reported on code.google.com by wdocunni...@gmail.com on 3 Aug 2012 at 2:44

GoogleCodeExporter commented 9 years ago
I've added a unit test for mg_get_var, in the situation you've described 
mongoose works as intended.
If you have more details , please let me know.

Original comment by valenok on 22 Sep 2012 at 11:24

GoogleCodeExporter commented 9 years ago
Yeah, the unit test is at 
https://github.com/valenok/mongoose/commit/ff0c2d3f91206a581543d395d08ac9d407910
72b

Original comment by valenok on 22 Sep 2012 at 11:24