summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ircd.c1
-rw-r--r--src/packet.c19
-rw-r--r--src/s_bsd.c1
-rw-r--r--src/send.c19
4 files changed, 12 insertions, 28 deletions
diff --git a/src/ircd.c b/src/ircd.c
index 1148821..0812e63 100644
--- a/src/ircd.c
+++ b/src/ircd.c
@@ -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);
}
diff --git a/src/send.c b/src/send.c
index 5808423..fcf2d91 100644
--- a/src/send.c
+++ b/src/send.c
@@ -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);
}