diff options
author | feld <feld@FreeBSD.org> | 2014-03-06 21:04:17 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2014-03-06 21:04:17 +0800 |
commit | 10dc01cdc3a1a5fdd499feb9d2d6c75c5c53cb1d (patch) | |
tree | 2ce0caa85662b5eb13afc06b7f83706ee9f4af3d /irc/bip/files | |
parent | 3acb93b9fc3816919bd3b3fb4aa7fe69b0e4a710 (diff) | |
download | freebsd-ports-gnome-10dc01cdc3a1a5fdd499feb9d2d6c75c5c53cb1d.tar.gz freebsd-ports-gnome-10dc01cdc3a1a5fdd499feb9d2d6c75c5c53cb1d.tar.zst freebsd-ports-gnome-10dc01cdc3a1a5fdd499feb9d2d6c75c5c53cb1d.zip |
Update to 0.8.9
Support STAGE
Diffstat (limited to 'irc/bip/files')
-rw-r--r-- | irc/bip/files/patch-bip-191 | 66 | ||||
-rw-r--r-- | irc/bip/files/patch-bip-269 | 139 |
2 files changed, 0 insertions, 205 deletions
diff --git a/irc/bip/files/patch-bip-191 b/irc/bip/files/patch-bip-191 deleted file mode 100644 index 426c6340cdc5..000000000000 --- a/irc/bip/files/patch-bip-191 +++ /dev/null @@ -1,66 +0,0 @@ -From 284c7a8020b664ecc6cb1f326af55325a46f7d3a Mon Sep 17 00:00:00 2001 -From: Nathan Phillip Brink <binki@gentoo.org> -Date: Mon, 12 Sep 2011 23:25:09 +0000 -Subject: [PATCH] Throttle almost everything (except PING, PONG, and certain QUIT messages) sent to the IRCd. - -Fixes being killed for Excess Flooding on freenode by using the existing -fakelag mechanism. The existing fakelag works great but was just not hooked -into earlier. ---- - src/connection.c | 14 +++++++++++--- - 1 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/src/connection.c b/src/connection.c -index c793e18..e226f92 100644 ---- a/src/connection.c -+++ b/src/connection.c -@@ -23,6 +23,7 @@ static SSL_CTX *sslctx = NULL; - static int ssl_cx_idx; - static BIO *errbio = NULL; - extern char *conf_ssl_certfile; -+static int cn_want_write(connection_t *cn); - static int SSLize(connection_t *cn, int *nc); - static SSL_CTX *SSL_init_context(void); - /* SSH like trust management */ -@@ -326,6 +327,11 @@ static int real_write_all(connection_t *cn) - return 0; - } - -+/* -+ * May only be used when writing to the client or when sending -+ * timing-sensitive data to the server (PONG, PING for lagtest, QUIT) -+ * because fakelag is not enforced. -+ */ - void write_line_fast(connection_t *cn, char *line) - { - int r; -@@ -353,13 +359,15 @@ void write_line_fast(connection_t *cn, char *line) - void write_lines(connection_t *cn, list_t *lines) - { - list_append(cn->outgoing, lines); -- real_write_all(cn); -+ if (cn_want_write(cn)) -+ real_write_all(cn); - } - - void write_line(connection_t *cn, char *line) - { - list_add_last(cn->outgoing, bip_strdup(line)); -- real_write_all(cn); -+ if (cn_want_write(cn)) -+ real_write_all(cn); - } - - list_t *read_lines(connection_t *cn, int *error) -@@ -718,7 +726,7 @@ static int check_event_write(fd_set *fds, connection_t *cn, int *nc) - /* token generation interval: 1200ms */ - #define TOKEN_INTERVAL 1200 - --int cn_want_write(connection_t *cn) -+static int cn_want_write(connection_t *cn) - { - if (cn->anti_flood) { - struct timeval tv; --- -1.7.3.4 - diff --git a/irc/bip/files/patch-bip-269 b/irc/bip/files/patch-bip-269 deleted file mode 100644 index 053583dd4174..000000000000 --- a/irc/bip/files/patch-bip-269 +++ /dev/null @@ -1,139 +0,0 @@ -commit 222a33cb84a2e52ad55a88900b7895bf9dd0262c -Author: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> -Date: Sat Jan 7 11:41:02 2012 +0100 - - Buffer Overflow: check against the implicit size of select() arrays - - Reported by Julien Tinnes (Fix #269) - exit is called when the listening socket can not be created - -diff --git a/src/bip.c b/src/bip.c -index d46ee2b..b4ac706 100644 ---- a/src/bip.c -+++ b/src/bip.c -@@ -1311,7 +1311,7 @@ int main(int argc, char **argv) - close(fd); - - bip.listener = listen_new(conf_ip, conf_port, conf_css); -- if (!bip.listener) -+ if (!bip.listener || bip.listener->connected == CONN_ERROR) - fatal("Could not create listening socket"); - - for (;;) { -commit 222a33cb84a2e52ad55a88900b7895bf9dd0262c -Author: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> -Date: Sat Jan 7 11:41:02 2012 +0100 - - Buffer Overflow: check against the implicit size of select() arrays - - Reported by Julien Tinnes (Fix #269) - exit is called when the listening socket can not be created - -diff --git a/src/connection.c b/src/connection.c -index 07ab431..5c4c24a 100644 ---- a/src/connection.c -+++ b/src/connection.c -@@ -124,6 +124,18 @@ static void connect_trynext(connection_t *cn) - continue; - } - -+ if (cn->handle >= FD_SETSIZE) { -+ mylog(LOG_WARN, "too many fd used, close socket %d", -+ cn->handle); -+ -+ if (close(cn->handle) == -1) -+ mylog(LOG_WARN, "Error on socket close: %s", -+ strerror(errno)); -+ -+ cn->handle = -1; -+ break; -+ } -+ - socket_set_nonblock(cn->handle); - - if (cn->connecting_data->src) { -@@ -789,13 +801,8 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) - /* - * This shouldn't happen ! just in case... - */ -- if (cn->handle < 0) { -- mylog(LOG_WARN, "wait_event invalid socket %d", -- cn->handle); -- if (cn_is_connected(cn)) -- cn->connected = CONN_ERROR; -- continue; -- } -+ if (cn->handle < 0 || cn->handle >= FD_SETSIZE) -+ fatal("wait_event invalid socket %d", cn->handle); - - /* exceptions are OOB and disconnections */ - FD_SET(cn->handle, &fds_except); -@@ -966,6 +973,18 @@ static void create_listening_socket(char *hostname, char *port, - continue; - } - -+ if (cn->handle >= FD_SETSIZE) { -+ mylog(LOG_WARN, "too many fd used, close listening socket %d", -+ cn->handle); -+ -+ if (close(cn->handle) == -1) -+ mylog(LOG_WARN, "Error on socket close: %s", -+ strerror(errno)); -+ -+ cn->handle = -1; -+ break; -+ } -+ - if (setsockopt(cn->handle, SOL_SOCKET, SO_REUSEADDR, - (char *)&multi_client, - sizeof(multi_client)) < 0) { -@@ -1113,10 +1132,21 @@ connection_t *accept_new(connection_t *cn) - - mylog(LOG_DEBUG, "Trying to accept new client on %d", cn->handle); - err = accept(cn->handle, &sa, &sa_len); -+ - if (err < 0) { -- mylog(LOG_ERROR, "accept failed: %s", strerror(errno)); -+ fatal("accept failed: %s", strerror(errno)); -+ } -+ -+ if (err >= FD_SETSIZE) { -+ mylog(LOG_WARN, "too many client connected, close %d", err); -+ -+ if (close(err) == -1) -+ mylog(LOG_WARN, "Error on socket close: %s", -+ strerror(errno)); -+ - return NULL; - } -+ - socket_set_nonblock(err); - - conn = connection_init(cn->anti_flood, cn->ssl, cn->timeout, 0); -commit 222a33cb84a2e52ad55a88900b7895bf9dd0262c -Author: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr> -Date: Sat Jan 7 11:41:02 2012 +0100 - - Buffer Overflow: check against the implicit size of select() arrays - - Reported by Julien Tinnes (Fix #269) - exit is called when the listening socket can not be created - -diff --git a/src/irc.c b/src/irc.c -index ebc1b34..147a315 100644 ---- a/src/irc.c -+++ b/src/irc.c -@@ -2439,9 +2439,10 @@ void bip_on_event(bip_t *bip, connection_t *conn) - - if (conn == bip->listener) { - struct link_client *n = irc_accept_new(conn); -- assert(n); -- list_add_last(&bip->conn_list, CONN(n)); -- list_add_last(&bip->connecting_client_list, n); -+ if (n) { -+ list_add_last(&bip->conn_list, CONN(n)); -+ list_add_last(&bip->connecting_client_list, n); -+ } - return; - } - |