Date: Wed, 19 Jun 2013 13:40:18 GMT From: Steve Wills <swills@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: sylvio@FreeBSD.org Subject: ports/179720: [PATCH] irc/bip: add patch which helps avoid flooding issues Message-ID: <201306191340.r5JDeISr067228@meatwad.mouf.net> Resent-Message-ID: <201306191450.r5JEo09E032647@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 179720 >Category: ports >Synopsis: [PATCH] irc/bip: add patch which helps avoid flooding issues >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 19 14:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Steve Wills >Release: FreeBSD 10.0-CURRENT amd64 >Organization: >Environment: System: FreeBSD meatwad.mouf.net 10.0-CURRENT FreeBSD 10.0-CURRENT #5 r251046: Tue May 28 22:52:00 UTC >Description: - Add a patch which helps avoid flooding issues. This patch is from upstream bug database, see: https://projects.duckcorp.org/issues/191 Port maintainer (sylvio@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: SVN) >How-To-Repeat: >Fix: --- bip-0.8.8_2.patch begins here --- Index: Makefile =================================================================== --- Makefile (revision 321249) +++ Makefile (working copy) @@ -1,13 +1,9 @@ -# New ports collection makefile for: bip -# Date created: 23 October 2007 -# Whom: Chess Griffin <chess@chessgriffin.com> -# +# Created by: Chess Griffin <chess@chessgriffin.com> # $FreeBSD$ -# PORTNAME= bip PORTVERSION= 0.8.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc MASTER_SITES= https://projects.duckcorp.org/attachments/download/39/ Index: files/patch-bip-191 =================================================================== --- files/patch-bip-191 (revision 0) +++ files/patch-bip-191 (working copy) @@ -0,0 +1,66 @@ +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 + Property changes on: files/patch-bip-191 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property --- bip-0.8.8_2.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306191340.r5JDeISr067228>