diff options
-rw-r--r-- | include/client.h | 6 | ||||
-rw-r--r-- | include/fdlist.h | 3 | ||||
-rw-r--r-- | src/ircd.c | 1 | ||||
-rw-r--r-- | src/packet.c | 19 | ||||
-rw-r--r-- | src/s_bsd.c | 1 | ||||
-rw-r--r-- | src/send.c | 19 |
6 files changed, 13 insertions, 36 deletions
diff --git a/include/client.h b/include/client.h index 9fce88c..ad9c69b 100644 --- a/include/client.h +++ b/include/client.h @@ -121,7 +121,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_BLOCKED 0x00040000 /**< must wait for COMM_SELECT_WRITE */ +#define FLAGS_UNUSED___ 0x00040000 /**< */ #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 */ @@ -275,10 +275,6 @@ struct MaskItem; #define IsHidden(x) ((x)->flags & FLAGS_HIDDEN) #define SetHidden(x) ((x)->flags |= FLAGS_HIDDEN) -#define IsSendqBlocked(x) ((x)->flags & FLAGS_BLOCKED) -#define SetSendqBlocked(x) ((x)->flags |= FLAGS_BLOCKED) -#define ClearSendqBlocked(x) ((x)->flags &= ~FLAGS_BLOCKED) - /*! \brief addr_mask_type enumeration */ enum addr_mask_type diff --git a/include/fdlist.h b/include/fdlist.h index 4487ca0..a23c5c1 100644 --- a/include/fdlist.h +++ b/include/fdlist.h @@ -78,9 +78,6 @@ typedef struct _fde { unsigned int open:1; unsigned int is_socket:1; -#ifdef HAVE_LIBCRYPTO - unsigned int pending_read:1; -#endif } flags; struct @@ -233,7 +233,6 @@ io_loop(void) comm_select(); exit_aborted_clients(); free_exited_clients(); - send_queued_all(); /* Check to see whether we have to rehash the configuration .. */ if (dorehash) diff --git a/src/packet.c b/src/packet.c index 0d23553..82c0a17 100644 --- a/src/packet.c +++ b/src/packet.c @@ -294,23 +294,20 @@ read_packet(fde_t *fd, void *data) /* translate openssl error codes, sigh */ if (length < 0) switch (SSL_get_error(fd->ssl, length)) - { + { case SSL_ERROR_WANT_WRITE: - fd->flags.pending_read = 1; - SetSendqBlocked(client_p); - comm_setselect(fd, COMM_SELECT_WRITE, (PF *) sendq_unblocked, - client_p, 0); - return; - case SSL_ERROR_WANT_READ: - errno = EWOULDBLOCK; + comm_setselect(fd, COMM_SELECT_WRITE, (PF *)sendq_unblocked, client_p, 0); + return; + case SSL_ERROR_WANT_READ: + errno = EWOULDBLOCK; case SSL_ERROR_SYSCALL: - break; + break; case SSL_ERROR_SSL: if (errno == EAGAIN) break; default: - length = errno = 0; - } + length = errno = 0; + } } else #endif diff --git a/src/s_bsd.c b/src/s_bsd.c index 8307a02..5efb317 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -171,7 +171,6 @@ 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 */ - ClearSendqBlocked(client_p); send_queued_write(client_p); } @@ -113,9 +113,7 @@ send_message(struct Client *to, char *buf, int len) ++to->localClient->send.messages; ++me.localClient->send.messages; - if (dbuf_length(&to->localClient->buf_sendq) > - (IsServer(to) ? (unsigned int) 1024 : (unsigned int) 4096)) - send_queued_write(to); + send_queued_write(to); } /* send_message_remote() @@ -193,16 +191,8 @@ send_message_remote(struct Client *to, struct Client *from, void sendq_unblocked(fde_t *fd, struct Client *client_p) { - ClearSendqBlocked(client_p); - /* let send_queued_write be executed by send_queued_all */ - -#ifdef HAVE_LIBCRYPTO - if (fd->flags.pending_read) - { - fd->flags.pending_read = 0; - read_packet(fd, client_p); - } -#endif + assert(fd == &client_p->localClient->fd); + send_queued_write(client_p); } /* @@ -221,7 +211,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) || IsSendqBlocked(to)) + if (IsDead(to)) return; /* no use calling send() now */ /* Next, lets try to write some data */ @@ -272,7 +262,6 @@ send_queued_write(struct Client *to) if ((retlen < 0) && (ignoreErrno(errno))) { /* we have a non-fatal error, reschedule a write */ - SetSendqBlocked(to); comm_setselect(&to->localClient->fd, COMM_SELECT_WRITE, (PF *)sendq_unblocked, to, 0); } |