Merge "Make ssync_sender a better HTTP client"
This commit is contained in:
commit
26af0aee3e
@ -143,6 +143,7 @@ class Sender(object):
|
|||||||
self.daemon.node_timeout, 'connect receive'):
|
self.daemon.node_timeout, 'connect receive'):
|
||||||
self.response = self.connection.getresponse()
|
self.response = self.connection.getresponse()
|
||||||
if self.response.status != http.HTTP_OK:
|
if self.response.status != http.HTTP_OK:
|
||||||
|
self.response.read()
|
||||||
raise exceptions.ReplicationException(
|
raise exceptions.ReplicationException(
|
||||||
'Expected status %s; got %s' %
|
'Expected status %s; got %s' %
|
||||||
(http.HTTP_OK, self.response.status))
|
(http.HTTP_OK, self.response.status))
|
||||||
|
@ -80,6 +80,9 @@ class FakeResponse(object):
|
|||||||
self.fp = StringIO.StringIO(
|
self.fp = StringIO.StringIO(
|
||||||
'%x\r\n%s\r\n0\r\n\r\n' % (len(chunk_body), chunk_body))
|
'%x\r\n%s\r\n0\r\n\r\n' % (len(chunk_body), chunk_body))
|
||||||
|
|
||||||
|
def read(self, *args, **kwargs):
|
||||||
|
return ''
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.close_called = True
|
self.close_called = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user