Merge lp:~spiv/bzr/win-serve-error into lp:~bzr/bzr/trunk-old
Proposed by
Andrew Bennetts
Status: | Merged |
---|---|
Approved by: | Ian Clatworthy |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~spiv/bzr/win-serve-error |
Merge into: | lp:~bzr/bzr/trunk-old |
Diff against target: | 74 lines |
To merge this branch: | bzr merge lp:~spiv/bzr/win-serve-error |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Clatworthy | Approve | ||
Review via email: mp+6827@code.launchpad.net |
To post a comment you must log in.
On Wed, 2009-05-27 at 15:25 +0000, Andrew Bennetts wrote: until_no_ eintr(self. socket. recv, until_no_ eintr(self. socket. recv, activity( len(bytes) , 'read')
> - bytes = osutils.
> _MAX_READ_SIZE)
> + try:
> + bytes = osutils.
> _MAX_READ_SIZE)
> + except socket.error, e:
> + if e.args[0] in (errno.ECONNRESET, 10054):
> + # The connection was closed by the other side.
> + return ''
> + raise
> self._report_
> return bytes
How about until_no_ eintr(self. socket. recv, _MAX_READ_SIZE) until_no_ eintr(self. socket. recv, _MAX_READ_SIZE)
self. _report_ activity( len(bytes) , 'read')
- bytes = osutils.
+ try:
+ bytes = osutils.
+ except socket.error, e:
+ if e.args[0] in (errno.ECONNRESET, 10054):
+ # The connection was closed by the other side.
+ bytes = ''
+ else:
+ raise
return bytes
This avoids having a different code path exiting the function and may
scale better as other cases need to be caught.
-Rob