Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def close(self):
     # Assume error will be raised again and handled by MMS?
     readAndDiscard(self).addErrback(lambda _: None)
Exemplo n.º 4
0
 def close(self):
     # Assume error will be raised again and handled by MMS?
     readAndDiscard(self).addErrback(lambda _: None)