ufairiya / mongoose

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

Unable to access the PUT Stream in embedded mongoose server #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. accessing PUT http Stream in embedded mongoose server fails
2. There is no file pointer available in the server sent through PUT client

What is the expected output? What do you see instead?
Able to access PUT Stream, request comes to the server but pull() function in 
mg_read() fails to pull the stream

What version of the product are you using? On what operating system?
Latest mongoose file dated Nov 28 on Windows XP OS

Please provide any additional information below.

NO

Original issue reported on code.google.com by vijay.n...@gmail.com on 13 Dec 2010 at 1:03

GoogleCodeExporter commented 9 years ago
I had a similar (maybe the same) issue... there was nothing in the http data 
buffer when I did a PUT. The below patch resolved what I needed:

--- mongoose/mongoose.c 2010-09-26 17:07:14.000000000 -0700
+++ mongoose-new/mongoose.c     2011-02-02 17:08:27.000000000 -0800
@@ -1320,7 +1320,8 @@
   DEBUG_TRACE(("%p %zu %lld %lld", buf, len,
                conn->content_len, conn->consumed_content));
   nread = 0;
-  if (strcmp(conn->request_info.request_method, "POST") == 0 &&
+  if (( (strcmp(conn->request_info.request_method, "POST") == 0) ||
+        (strcmp(conn->request_info.request_method, "PUT") == 0) ) &&
       conn->consumed_content < conn->content_len) {

     // Adjust number of bytes to read.

Original comment by kwo...@gmail.com on 3 Feb 2011 at 11:37

GoogleCodeExporter commented 9 years ago
This must be fixed in the head.
Please verify.

Original comment by valenok on 23 Sep 2012 at 1:11