Entropy/SocketHostInterface:

- improve transmitter on SSL


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2357 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-08-31 10:37:32 +00:00
parent 0a4edd8b28
commit f34d98ca3c
+14 -5
View File
@@ -14190,7 +14190,20 @@ class SocketHostInterface:
def transmit(self, channel, data):
if self.SSL:
channel.send(self.append_eos(data))
mydata = self.append_eos(data)
encode_done = False
while 1:
try:
channel.send(mydata)
except (self.SSL_exceptions['WantWriteError'],):
continue
except UnicodeEncodeError:
if encode_done:
raise
mydata = mydata.encode('utf-8')
encode_done = True
continue
break
else:
channel.sendall(self.append_eos(data))
@@ -20558,10 +20571,6 @@ class RepositorySocketClientInterface:
try:
data = do_receive()
#print "---\\"
#print len(data),self.buffer_length
#print repr(data)
#print "---/"
if self.buffer_length == None:
self.buffered_data = ''
if len(data) < len(myeos):