From owner-svn-ports-head@FreeBSD.ORG Sun Feb 2 17:02:37 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 013FFBA7; Sun, 2 Feb 2014 17:02:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5FE51C87; Sun, 2 Feb 2014 17:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s12H2aPi041035; Sun, 2 Feb 2014 17:02:36 GMT (envelope-from swills@svn.freebsd.org) Received: (from swills@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s12H2ajC041033; Sun, 2 Feb 2014 17:02:36 GMT (envelope-from swills@svn.freebsd.org) Message-Id: <201402021702.s12H2ajC041033@svn.freebsd.org> From: Steve Wills Date: Sun, 2 Feb 2014 17:02:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r342339 - in head/irc/bip: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 17:02:37 -0000 Author: swills Date: Sun Feb 2 17:02:36 2014 New Revision: 342339 URL: http://svnweb.freebsd.org/changeset/ports/342339 QAT: https://qat.redports.org/buildarchive/r342339/ Log: - Add a patch which helps avoid flooding issues PR: ports/179720 Submitted by: myself Obtained from: https://projects.duckcorp.org/issues/191 Added: head/irc/bip/files/patch-bip-191 (contents, props changed) Modified: head/irc/bip/Makefile Modified: head/irc/bip/Makefile ============================================================================== --- head/irc/bip/Makefile Sun Feb 2 16:54:09 2014 (r342338) +++ head/irc/bip/Makefile Sun Feb 2 17:02:36 2014 (r342339) @@ -3,7 +3,7 @@ PORTNAME= bip PORTVERSION= 0.8.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc MASTER_SITES= https://projects.duckcorp.org/attachments/download/39/ Added: head/irc/bip/files/patch-bip-191 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/irc/bip/files/patch-bip-191 Sun Feb 2 17:02:36 2014 (r342339) @@ -0,0 +1,66 @@ +From 284c7a8020b664ecc6cb1f326af55325a46f7d3a Mon Sep 17 00:00:00 2001 +From: Nathan Phillip Brink +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 +