040c109d0adcb41c0a4e1dc50c4e8b36c5193821
[packages/trusty/python-eventlet.git] / debian / patches / greenio_send_was_running_empty_loop_on_ENOTCONN.patch
1 Description: greenio: send() was running empty loop on ENOTCONN
2  Thanks to Seyeong Kim
3  https://github.com/eventlet/eventlet/issues/192
4 Author: Sergey Shepelev <temotor@gmail.com>
5 Date: Fri, 15 May 2015 03:56:04 +0300
6
7 diff --git a/AUTHORS b/AUTHORS
8 index e0ab0e2..c57f010 100644
9 --- a/AUTHORS
10 +++ b/AUTHORS
11 @@ -119,3 +119,4 @@ Thanks To
12  * Sean Dague, wsgi: Provide python logging compatibility
13  * Tim Simmons, Use _socket_nodns and select in dnspython support
14  * Antonio Cuni, fix fd double close on PyPy
15 +* Seyeong Kim
16 diff --git a/eventlet/greenio/base.py b/eventlet/greenio/base.py
17 index 8da51ca..1e43176 100644
18 --- a/eventlet/greenio/base.py
19 +++ b/eventlet/greenio/base.py
20 @@ -358,7 +358,8 @@ def send(self, data, flags=0):
21              try:
22                  total_sent += fd.send(data[total_sent:], flags)
23              except socket.error as e:
24 -                if get_errno(e) not in SOCKET_BLOCKING:
25 +                eno = get_errno(e)
26 +                if eno == errno.ENOTCONN or eno not in SOCKET_BLOCKING:
27                      raise
28  
29              if total_sent == len_data: