ufairiya / mongoose

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

mg_get_var truncates posted variables #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Post a large amount of data into one variable (greater than 1KB)
2. Read the posted data using mg_get_var

What is the expected output? What do you see instead?
You should have the entire posted variable returned from mg_get_var.
instead it truncates the data to BUFSIZ (1024 bytes on my machine)

What version of the product are you using? On what operating system?
mongoose 2.3 embedded in an application on OSX 10.5.6

I can get around this by reading the raw post_data in request_info, but
mg_get_var shouldn't truncate, or at lest the documentation should be
updated to say that it does.

Original issue reported on code.google.com by martam...@yahoo.com on 15 Jan 2009 at 11:53

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 16 Jan 2009 at 6:48

GoogleCodeExporter commented 9 years ago
Quote "http://support.microsoft.com/kb/208427":
=======================================
Microsoft Internet Explorer has a maximum uniform resource locator (URL) length 
of
2,083 characters. Internet Explorer also has a maximum path length of 2,048
characters. This limit applies to both POST request and GET request URLs.

If you are using the GET method, you are limited to a maximum of 2,048 
characters,
minus the number of characters in the actual path.

However, the POST method is not limited by the size of the URL for submitting
name/value pairs. These pairs are transferred in the header and not in the URL.

RFC 2616, "Hypertext Transfer Protocol -- HTTP/1.1," does not specify any 
requirement
for URL length.
=======================================

There should really be separate functions for getting GET or POST vars, as 
there is a
compatibility issue when lots of data is sent using GET.  POST vars should be 
able to
read any amount of data though.

Original comment by matthewj...@googlemail.com on 19 Jan 2009 at 2:34

GoogleCodeExporter commented 9 years ago
Value truncation has been fixed. Regression test added.
I don't think that it is feasible making separate functions for getting GET and 
POST
vars.

Original comment by valenok on 5 Feb 2009 at 10:04