Re: Avoid hangs when handling of HTTP POST requests

Kaloian Doganov <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
> So, I suggest the following patch:

Sorry, the patch had a bug in it.  Here it is again, fixed:

Index: pyblosxom.py
===================================================================
RCS file: /cvsroot/pyblosxom/pyblosxom/Pyblosxom/pyblosxom.py,v
retrieving revision 1.72
diff -U3 -r1.72 pyblosxom.py
--- pyblosxom.py        7 Oct 2005 22:48:32 -0000       1.72
+++ pyblosxom.py        9 Oct 2005 00:27:30 -0000
@@ -448,12 +448,13 @@
         pyhttp = self.getHttp()
         input = pyhttp['wsgi.input']
         method = pyhttp["REQUEST_METHOD"]
+        length = int(pyhttp["CONTENT_LENGTH"])

         # there's no data on stdin for a GET request.  pyblosxom
         # will block indefinitely on the read for a GET request with
         # thttpd.
         if method != "GET":
-            self._in.write(input.read())
+            self._in.write(input.read(length))
             # rewind to start
             self._in.seek(0)


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.