summaryrefslogtreecommitdiff
path: root/bin/tiny_socket.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2011-01-19 00:50:33 +0100
committerAntony Lesuisse <al@openerp.com>2011-01-19 00:50:33 +0100
commit62e28bf1afc9b72a27bde19190df56b4dbf44fe9 (patch)
tree018e2105f20cdaaf77bd69aa350a6728a0bf47a0 /bin/tiny_socket.py
parent13380e334a32651e9ad54f258169b2f6ba533312 (diff)
revert commit 3298, 3299. This will be revised after 6.0.
bzr revid: al@openerp.com-20110118235033-r3n38tu482krm173
Diffstat (limited to 'bin/tiny_socket.py')
-rw-r--r--bin/tiny_socket.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/tiny_socket.py b/bin/tiny_socket.py
index 44f7db04f01..6a0d9371ef5 100644
--- a/bin/tiny_socket.py
+++ b/bin/tiny_socket.py
@@ -61,7 +61,15 @@ class mysocket:
def mysend(self, msg, exception=False, traceback=None):
msg = cPickle.dumps([msg,traceback])
- self.sock.sendall('%8d%s%s' % (len(msg), exception and "1" or "0", msg))
+ size = len(msg)
+ self.sock.send('%8d' % size)
+ self.sock.send(exception and "1" or "0")
+ totalsent = 0
+ while totalsent < size:
+ sent = self.sock.send(msg[totalsent:])
+ if sent == 0:
+ raise RuntimeError, "socket connection broken"
+ totalsent = totalsent + sent
def myreceive(self):
buf=''