/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Andrew Bennetts
  • Date: 2007-12-19 02:25:26 UTC
  • mto: This revision was merged to the branch mainline in revision 3127.
  • Revision ID: andrew.bennetts@canonical.com-20071219022526-pnpspp8dgbzso15n
(andrew) Fix #115781 by passing no more than 64k at a time to socket.sendall.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1406
1406
        b += new
1407
1407
    return b
1408
1408
 
 
1409
 
 
1410
def send_all(socket, bytes):
 
1411
    """Send all bytes on a socket.
 
1412
 
 
1413
    Regular socket.sendall() can give socket error 10053 on Windows.  This
 
1414
    implementation sends no more than 64k at a time, which avoids this problem.
 
1415
    """
 
1416
    chunk_size = 2**16
 
1417
    for pos in xrange(0, len(bytes), chunk_size):
 
1418
        socket.sendall(bytes[pos:pos+chunk_size])
 
1419
 
 
1420
 
1409
1421
def dereference_path(path):
1410
1422
    """Determine the real path to a file.
1411
1423