[MERGE] Report network activity of smart media.

Martin Pool mbp at canonical.com
Mon Jan 26 20:22:03 GMT 2009


Martin Pool has voted tweak.
Status is now: Conditionally approved
Comment:
-def send_all(socket, bytes):
+def send_all(socket, bytes, report_activity=None, direction='write'):
      """Send all bytes on a socket.

      Regular socket.sendall() can give socket error 10053 on Windows. 
This
      implementation sends no more than 64k at a time, which avoids this 
problem.
+
+    :param report_activity: Call this as bytes are read, see
+        Transport._report_activity
+    :param direction: Will be passed to report_activity
      """

Since the method is send_all it's not really possible for the direction 
to be 'read' :-)

(I wondered if it should be more descriptive, perhaps being the 
transport op or rpc method we're currently doing, but I don't think 
it'll be a good ui, and for higher level operations we have the progress 
bar.  So, just read/write.)

If there is an appropriate test for SmartMedium it'd be nice to add 
something there, just checking that it does fire events, as John did.

Aside from that it looks good, thanks very much!

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C20090126072506.GA30864%40steerpike.home.puzzling.org%3E
Project: Bazaar



More information about the bazaar mailing list