chesterpolo / mongoose

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

Previous data is still in post_data #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I still have post_data from previous requests on post_data string

What steps will reproduce the problem?
1. Post a page with a post data
2. Post another page with a smaller post data
3. You'll get remaining data from first request at the end of the data from
the second

What version of the product are you using? On what operating system?
hg clone rev 7c402d8a3aef

A quick&dirty fix is to add the following line in process_new_connection
@@ -4301,6 +4308,7 @@
                } else {
                        ri->post_data = buf + request_len;
                        ri->post_data_len = nread - request_len;
+                       *(ri->post_data + ri->post_data_len) = '\0';
                        conn->birth_time = time(NULL);
                        analyze_request(conn);
                        log_access(conn);
(I've made some other modifications of the file so line numbers might not
be accurate)
This terminate the string where it should and seems to do the trick but
there's may be a better way to do this.

Original issue reported on code.google.com by julien.d...@gmail.com on 5 Jun 2010 at 1:18

GoogleCodeExporter commented 9 years ago
Obsolete - no post_data anymore.
(well, there is no way currently to read POST data in embedded mode, but 
mg_read() is coming soon).

Original comment by valenok on 23 Aug 2010 at 8:53