Skip to content
This repository
Browse code

handler_proxy: Don't set the 'got all' flag when POST data is received

That flag only use is to know if the connection can be re-used. Getting
all the POST data from the client has _nothing_ to do with that, we
must only set it when the response from the backend is complete.

Failure to do this results in the connection trying to be reused when
it's not ready ... In case of failure it's not closed and the next
request might try to use it whatever state its in.

Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
  • Loading branch information...
commit 099128800132c46531f8a4e6fd43c30b0e820e6f 1 parent 9864126
Stefan de Konink authored August 02, 2012
2  cherokee/handler_proxy.c
@@ -815,12 +815,10 @@ send_post (cherokee_handler_proxy_t *hdl)
815 815
 
816 816
 		if (hdl->pconn->post.do_buf_sent) {
817 817
 			if (hdl->pconn->post.sent >= buffer->len) {
818  
-				hdl->got_all = true;
819 818
 				return ret_ok;
820 819
 			}
821 820
 		} else {
822 821
 			if (cherokee_buffer_is_empty (buffer)) {
823  
-				hdl->got_all = true;
824 822
 				return ret_ok;
825 823
 			}
826 824
 		}
13  qa/TODO
... ...
@@ -0,0 +1,13 @@
  1
+Bug 1364 defines the following:
  2
+
  3
+1. Configure cherokee with a reverse proxy handler to a given backend and a 5 second timeout
  4
+2. In that backend, just sleep for 10 s before responding
  5
+3. Do two POST one after the other
  6
+4. In the error log you'll find :
  7
+
  8
+-----
  9
+[11/06/2012 14:26:49.791] (error) socket.c:708 - Could not write to socket:
  10
+    write(18, ..): 'Bad file descriptor' | It looks like you've hit a bug in the server.
  11
+    Please, do not hesitate to report it at http://bugs.cherokee-project.com/
  12
+    so  the developer team can fix it.
  13
+-----

0 notes on commit 0991288

Please sign in to comment.
Something went wrong with that request. Please try again.