diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/s_bsd.c | 1 | ||||
-rw-r--r-- | src/send.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/s_bsd.c b/src/s_bsd.c index cace7a5..aee198c 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -173,6 +173,7 @@ close_connection(struct Client *client_p) * even if it is marked as blocked (COMM_SELECT_READ handler is called * before COMM_SELECT_WRITE). Let's try, nothing to lose.. -adx */ + DelFlag(client_p, FLAGS_BLOCKED); send_queued_write(client_p); } @@ -194,6 +194,8 @@ void sendq_unblocked(fde_t *fd, struct Client *client_p) { assert(fd == &client_p->localClient->fd); + + DelFlag(client_p, FLAGS_BLOCKED); send_queued_write(client_p); } @@ -213,7 +215,7 @@ send_queued_write(struct Client *to) ** Once socket is marked dead, we cannot start writing to it, ** even if the error is removed... */ - if (IsDead(to)) + if (IsDead(to) || HasFlag(to, FLAGS_BLOCKED)) return; /* no use calling send() now */ /* Next, lets try to write some data */ @@ -263,6 +265,7 @@ send_queued_write(struct Client *to) if ((retlen < 0) && (ignoreErrno(errno))) { + AddFlag(to, FLAGS_BLOCKED); /* we have a non-fatal error, reschedule a write */ comm_setselect(&to->localClient->fd, COMM_SELECT_WRITE, (PF *)sendq_unblocked, to, 0); |