summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventlet/greenio/base.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/eventlet/greenio/base.py b/eventlet/greenio/base.py
index 18799af..ea091d4 100644
--- a/eventlet/greenio/base.py
+++ b/eventlet/greenio/base.py
@@ -351,28 +351,20 @@ class GreenSocket(object):
if self.act_non_blocking:
return fd.send(data, flags)
- # blocking socket behavior - sends all, blocks if the buffer is full
- total_sent = 0
- len_data = len(data)
while 1:
try:
- total_sent += fd.send(data[total_sent:], flags)
+ return fd.send(data, flags)
except socket.error as e:
eno = get_errno(e)
if eno == errno.ENOTCONN or eno not in SOCKET_BLOCKING:
raise
- if total_sent == len_data:
- break
-
try:
self._trampoline(self.fd, write=True, timeout=self.gettimeout(),
timeout_exc=socket.timeout("timed out"))
except IOClosed:
raise socket.error(errno.ECONNRESET, 'Connection closed by another thread')
- return total_sent
-
def sendall(self, data, flags=0):
tail = self.send(data, flags)
len_data = len(data)