ZServer contains a thread synchronization bug
exposed when the HTTP streaming protocol
(i.e. RESPONSE.write) is used.

For large responses, the reponse is written
to a temporary file and the distribution
thread receives "file_part_producer" requests.
Writing to the tempfile uses "seek => write"
in the request thread; reading the tempfile
uses "seek => read" in the distribution thread.
The threads are not synchronized. This may
result in loss of response data: broken or buggy

The following patch removes the use of
a tempfile. This, of cause, is only a
crude workaround.

--- ZServer/:HTTPResponse.py    Mon Jan 24 20:17:53 2000
+++ ZServer/HTTPResponse.py     Thu Jun  8 09:01:31 2000
@@ -239,7 +239,9 @@
                     if type(l) is type(''): l=string.atoi(l)
                     if l > 128000:
-                        self._tempfile=tempfile.TemporaryFile()
+                       # don't! exposes a thread synchronization problem
+                        # self._tempfile=tempfile.TemporaryFile()
+                       pass
                 except: pass

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to