From 42d609f65a9dfd911d6d833444c419e1d2433f20 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 15 Jan 2009 20:08:46 +0300 Subject: [PATCH] [ratbox3 svn r26397] Make it more likely that error messages on ssld connections get through. When ssld reports a connection closure because of "Remote host closed the connection" and the connection is any server or a registered client, try a read_packet() on the client. This should mainly help LIBRB_USE_IOTYPE=poll which iterates over the ready file descriptors in numerical order, processing the ssld control connection before the closing data connection. --- src/sslproc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sslproc.c b/src/sslproc.c index 73c28b41..56acce8e 100644 --- a/src/sslproc.c +++ b/src/sslproc.c @@ -377,6 +377,14 @@ ssl_process_dead_fd(ssl_ctl_t * ctl, ssl_ctl_buf_t * ctl_buf) client_p = find_cli_fd_hash(fd); if(client_p == NULL) return; + if(IsAnyServer(client_p) || IsRegistered(client_p)) + { + /* read any last moment ERROR, QUIT or the like -- jilles */ + if (!strcmp(reason, "Remote host closed the connection")) + read_packet(client_p->localClient->F, client_p); + if (IsAnyDead(client_p)) + return; + } if(IsAnyServer(client_p)) { sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) && !IsServer(client_p) ? L_NETWIDE : L_ALL, "ssld error for %s: %s", client_p->name, reason);