[CalendarServer-changes] [3999] CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/ Twisted/twisted.web2.http.patch

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 13 08:44:40 PDT 2009


Revision: 3999
          http://trac.macosforge.org/projects/calendarserver/changeset/3999
Author:   exarkun at twistedmatrix.com
Date:     2009-04-13 08:44:40 -0700 (Mon, 13 Apr 2009)
Log Message:
-----------
Applied to Twisted dav-take-two branch

Removed Paths:
-------------
    CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.http.patch

Deleted: CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.http.patch
===================================================================
--- CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.http.patch	2009-04-13 15:41:56 UTC (rev 3998)
+++ CalendarServer/branches/exarkun/update-twisted-3816/lib-patches/Twisted/twisted.web2.http.patch	2009-04-13 15:44:40 UTC (rev 3999)
@@ -1,54 +0,0 @@
-Index: twisted/web2/http.py
-===================================================================
---- twisted/web2/http.py	(revision 26342)
-+++ twisted/web2/http.py	(working copy)
-@@ -26,7 +26,7 @@
- from twisted.web2 import http_headers
- from twisted.web2 import iweb
- from twisted.web2 import stream
--from twisted.web2.stream import IByteStream
-+from twisted.web2.stream import IByteStream, readAndDiscard
- 
- defaultPortForScheme = {'http': 80, 'https':443, 'ftp':21}
- 
-@@ -66,8 +66,8 @@
-             object.
-         @type codeOrResponse: C{int} or L{http.Response}
-         """
--        Exception.__init__(self)
-         self.response = iweb.IResponse(codeOrResponse)
-+        Exception.__init__(self, str(self.response))
- 
-     def __repr__(self):
-         return "<%s %s>" % (self.__class__.__name__, self.response)
-@@ -407,9 +407,22 @@
-     def _sendContinue(self):
-         self.chanRequest.writeIntermediateResponse(responsecode.CONTINUE)
- 
--    def _finished(self, x):
-+    def _reallyFinished(self, x):
-         """We are finished writing data."""
-         self.chanRequest.finish()
-+        
-+    def _finished(self, x):
-+        """
-+        We are finished writing data.
-+        But we need to check that we have also finished reading all data as we
-+        might have sent a, for example, 401 response before we read any data.
-+        To make sure that the stream/producer sequencing works properly we need
-+        to discard the remaining data in the request.  
-+        """
-+        if self.stream.length != 0:
-+            return readAndDiscard(self.stream).addCallback(self._reallyFinished).addErrback(self._error)
-+        else:
-+            self._reallyFinished(x)
- 
-     def _error(self, reason):
-         if reason.check(error.ConnectionLost):
-@@ -470,5 +483,5 @@
- else:
-     components.registerAdapter(compat.OldResourceAdapter, resource.IResource, iweb.IOldNevowResource)
- 
--__all__ = ['HTTPError', 'NotModifiedResponse', 'Request', 'Response', 'checkIfRange', 'checkPreconditions', 'defaultPortForScheme', 'parseVersion', 'splitHostPort']
-+__all__ = ['HTTPError', 'NotModifiedResponse', 'Request', 'Response', 'StatusResponse', 'RedirectResponse', 'checkIfRange', 'checkPreconditions', 'defaultPortForScheme', 'parseVersion', 'splitHostPort']
- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090413/3ea480df/attachment-0001.html>


More information about the calendarserver-changes mailing list