Reviewers: ,
Please review this at http://codereview.tryton.org/34002/ Affected files: M tryton/pysocket.py Index: tryton/pysocket.py =================================================================== --- a/tryton/pysocket.py +++ b/tryton/pysocket.py @@ -177,15 +177,15 @@ + (gzip_p and "1" or "0") + msg size = len(msg) - totalsent = 0 - while totalsent < size: - if self.ssl: + if self.ssl: + totalsent = 0 + while totalsent < size: sent = self.ssl_sock.write(msg[totalsent:]) - else: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError, "socket connection broken" - totalsent = totalsent + sent + if sent == 0: + raise RuntimeError, "socket connection broken" + totalsent = totalsent + sent + else: + self.sock.sendall(msg) def receive(self): buf = self.buffer -- [email protected] mailing list
