~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-02 15:17:18 UTC
  • mfrom: (3750.1.4 osx_tests_fix)
  • Revision ID: pqm@pqm.ubuntu.com-20081002151718-hd9avrlfo0o2wf8j
(vila) Fix test suite regression on OSX
        (smart_server_connection_reset)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
bzrlib/transport/smart/__init__.py.
25
25
"""
26
26
 
 
27
import errno
27
28
import os
28
29
import socket
29
30
import sys
845
846
            raise errors.MediumNotConnected(self)
846
847
        # We ignore the desired_count because on sockets it's more efficient to
847
848
        # read large chunks (of _MAX_READ_SIZE bytes) at a time.
848
 
        return self._socket.recv(_MAX_READ_SIZE)
 
849
        try:
 
850
            return self._socket.recv(_MAX_READ_SIZE)
 
851
        except socket.error, e:
 
852
            if len(e.args) and e.args[0] == errno.ECONNRESET:
 
853
                # Callers expect an empty string in that case
 
854
                return ''
 
855
            else:
 
856
                raise
849
857
 
850
858
 
851
859
class SmartClientStreamMediumRequest(SmartClientMediumRequest):