core: tcp - reset connection write flag if io_watch_chg() for pollout fails
authorDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 22 Sep 2015 13:22:32 +0000 (15:22 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 22 Sep 2015 13:22:32 +0000 (15:22 +0200)
- it can loop otherwise in trying to see if write can be done

tcp_main.c

index df778ba..578f7d2 100644 (file)
@@ -4113,6 +4113,7 @@ inline static int handle_tcpconn_ev(struct tcp_connection* tcpconn, short ev,
                        if (unlikely(io_watch_chg(&io_h, tcpconn->s, POLLOUT, fd_i)==-1)){
                                LM_ERR("io_watch_chg(2) failed: for %p, fd %d\n",
                                                        tcpconn, tcpconn->s);
+                               tcpconn->flags&=~F_CONN_WRITE_W;
                                goto error;
                        }
                }else