diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-04-15 11:41:24 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-04-15 11:41:24 +0000 |
commit | a67597944d9a667c10c2e845199bc14ed2b662fe (patch) | |
tree | 4659671511f3787758085256233a35fb178be957 | |
parent | 82750c14c81b5a63373107267cda4fa6de1c2ff9 (diff) |
- Readded FLAGS_BLOCKED
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@3310 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | include/client.h | 2 | ||||
-rw-r--r-- | src/s_bsd.c | 1 | ||||
-rw-r--r-- | src/send.c | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/include/client.h b/include/client.h index 8646520..beed244 100644 --- a/include/client.h +++ b/include/client.h @@ -123,7 +123,7 @@ struct MaskItem; #define FLAGS_FLOODDONE 0x00008000 /**< Flood grace period has been ended. */ #define FLAGS_EOB 0x00010000 /**< server has sent us an EOB */ #define FLAGS_HIDDEN 0x00020000 /**< a hidden server. not shown in /links */ -#define FLAGS_UNUSED___ 0x00040000 /**< */ +#define FLAGS_BLOCKED 0x00040000 /**< must wait for COMM_SELECT_WRITE */ #define FLAGS_USERHOST 0x00080000 /**< client is in userhost hash */ #define FLAGS_BURSTED 0x00100000 /**< user was already bursted */ #define FLAGS_EXEMPTRESV 0x00200000 /**< client is exempt from RESV */ 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); |