/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

merge bzr.dev r4164

Show diffs side-by-side

added added

removed removed

Lines of Context:
1641
1641
    return b
1642
1642
 
1643
1643
 
1644
 
def send_all(socket, bytes):
 
1644
def send_all(socket, bytes, report_activity=None):
1645
1645
    """Send all bytes on a socket.
1646
1646
 
1647
1647
    Regular socket.sendall() can give socket error 10053 on Windows.  This
1648
1648
    implementation sends no more than 64k at a time, which avoids this problem.
 
1649
 
 
1650
    :param report_activity: Call this as bytes are read, see
 
1651
        Transport._report_activity
1649
1652
    """
1650
1653
    chunk_size = 2**16
1651
1654
    for pos in xrange(0, len(bytes), chunk_size):
1652
 
        until_no_eintr(socket.sendall, bytes[pos:pos+chunk_size])
 
1655
        block = bytes[pos:pos+chunk_size]
 
1656
        if report_activity is not None:
 
1657
            report_activity(len(block), 'write')
 
1658
        until_no_eintr(socket.sendall, block)
1653
1659
 
1654
1660
 
1655
1661
def dereference_path(path):