Rev 5605: (jameinel) Bug #581311, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jan 12 23:37:18 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5605 [merge]
revision-id: pqm at pqm.ubuntu.com-20110112233716-ll3papi4704tefjg
parent: pqm at pqm.ubuntu.com-20110112230230-p0dzwke9han3t0ud
parent: john at arbash-meinel.com-20110112222105-spcqof5g3neg1iuq
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-01-12 23:37:16 +0000
message:
  (jameinel) Bug #581311,
   treat WSAECONNABORTED as ConnectionReset. (John A Meinel)
modified:
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
  bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
  bzrlib/version_info_formats/format_python.py format_python.py-20060809202444-ike7i9ub03gb432p-1
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2011-01-12 00:58:05 +0000
+++ b/bzrlib/osutils.py	2011-01-12 21:06:32 +0000
@@ -2001,6 +2001,14 @@
 # data at once.
 MAX_SOCKET_CHUNK = 64 * 1024
 
+_end_of_stream_errors = [errno.ECONNRESET]
+for _eno in ['WSAECONNRESET', 'WSAECONNABORTED']:
+    _eno = getattr(errno, _eno, None)
+    if _eno is not None:
+        _end_of_stream_errors.append(_eno)
+del _eno
+
+
 def read_bytes_from_socket(sock, report_activity=None,
         max_read_size=MAX_SOCKET_CHUNK):
     """Read up to max_read_size of bytes from sock and notify of progress.
@@ -2014,7 +2022,7 @@
             bytes = sock.recv(max_read_size)
         except socket.error, e:
             eno = e.args[0]
-            if eno == getattr(errno, "WSAECONNRESET", errno.ECONNRESET):
+            if eno in _end_of_stream_errors:
                 # The connection was closed by the other side.  Callers expect
                 # an empty string to signal end-of-stream.
                 return ""

=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py	2011-01-10 22:20:12 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py	2011-01-12 21:22:20 +0000
@@ -598,7 +598,9 @@
                         'Bad status line received',
                         orig_error=exc_val)
                 elif (isinstance(exc_val, socket.error) and len(exc_val.args)
-                      and exc_val.args[0] in (errno.ECONNRESET, 10054)):
+                      and exc_val.args[0] in (errno.ECONNRESET, 10053, 10054)):
+                      # 10053 == WSAECONNABORTED
+                      # 10054 == WSAECONNRESET
                     raise errors.ConnectionReset(
                         "Connection lost while sending request.")
                 else:

=== modified file 'bzrlib/version_info_formats/format_python.py'
--- a/bzrlib/version_info_formats/format_python.py	2011-01-12 14:08:28 +0000
+++ b/bzrlib/version_info_formats/format_python.py	2011-01-12 21:28:39 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 Canonical Ltd
+# Copyright (C) 2006, 2009, 2011 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2011-01-12 23:02:30 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2011-01-12 23:37:16 +0000
@@ -88,6 +88,11 @@
 * The BZR_COLUMNS environment variable can be set to 0 to indicate no
   limitation on the width of the terminal.  (Neil Martinsen-Burrell, #675652)
 
+* Treat WSAECONNABORTED the same as WSAECONNRESET for the purposes of
+  considering a smart data stream as being interrupted. This fixes a
+  failure in the windows test suite, that was trying to ensure we cleanly
+  handled a server disconnect.  (John Arbash Meinel, #581311, #686587)
+
 * Unshelving changes that occur in a now-unversioned directory now restore
   the directory properly rather than crashing.
   (John Arbash Meinel, #389674)




More information about the bazaar-commits mailing list