View | Details | Raw Unified | Return to bug 179720
Collapse All | Expand All

(-)Makefile (-6 / +2 lines)
Lines 1-13 Link Here
1
# New ports collection makefile for:   bip
1
# Created by: Chess Griffin <chess@chessgriffin.com>
2
# Date created:        23 October 2007
3
# Whom:                Chess Griffin <chess@chessgriffin.com>
4
#
5
# $FreeBSD$
2
# $FreeBSD$
6
#
7
3
8
PORTNAME=	bip
4
PORTNAME=	bip
9
PORTVERSION=	0.8.8
5
PORTVERSION=	0.8.8
10
PORTREVISION=	1
6
PORTREVISION=	2
11
CATEGORIES=	irc
7
CATEGORIES=	irc
12
MASTER_SITES=	https://projects.duckcorp.org/attachments/download/39/
8
MASTER_SITES=	https://projects.duckcorp.org/attachments/download/39/
13
9
(-)files/patch-bip-191 (+66 lines)
Line 0 Link Here
1
From 284c7a8020b664ecc6cb1f326af55325a46f7d3a Mon Sep 17 00:00:00 2001
2
From: Nathan Phillip Brink <binki@gentoo.org>
3
Date: Mon, 12 Sep 2011 23:25:09 +0000
4
Subject: [PATCH] Throttle almost everything (except PING, PONG, and certain QUIT messages) sent to the IRCd.
5
6
Fixes being killed for Excess Flooding on freenode by using the existing
7
fakelag mechanism. The existing fakelag works great but was just not hooked
8
into earlier.
9
---
10
 src/connection.c |   14 +++++++++++---
11
 1 files changed, 11 insertions(+), 3 deletions(-)
12
13
diff --git a/src/connection.c b/src/connection.c
14
index c793e18..e226f92 100644
15
--- a/src/connection.c
16
+++ b/src/connection.c
17
@@ -23,6 +23,7 @@ static SSL_CTX *sslctx = NULL;
18
 static int ssl_cx_idx;
19
 static BIO *errbio = NULL;
20
 extern char *conf_ssl_certfile;
21
+static int cn_want_write(connection_t *cn);
22
 static int SSLize(connection_t *cn, int *nc);
23
 static SSL_CTX *SSL_init_context(void);
24
 /* SSH like trust management */
25
@@ -326,6 +327,11 @@ static int real_write_all(connection_t *cn)
26
 	return 0;
27
 }
28
 
29
+/*
30
+ * May only be used when writing to the client or when sending
31
+ * timing-sensitive data to the server (PONG, PING for lagtest, QUIT)
32
+ * because fakelag is not enforced.
33
+ */
34
 void write_line_fast(connection_t *cn, char *line)
35
 {
36
 	int r;
37
@@ -353,13 +359,15 @@ void write_line_fast(connection_t *cn, char *line)
38
 void write_lines(connection_t *cn, list_t *lines)
39
 {
40
 	list_append(cn->outgoing, lines);
41
-	real_write_all(cn);
42
+	if (cn_want_write(cn))
43
+		real_write_all(cn);
44
 }
45
 
46
 void write_line(connection_t *cn, char *line)
47
 {
48
 	list_add_last(cn->outgoing, bip_strdup(line));
49
-	real_write_all(cn);
50
+	if (cn_want_write(cn))
51
+		real_write_all(cn);
52
 }
53
 
54
 list_t *read_lines(connection_t *cn, int *error)
55
@@ -718,7 +726,7 @@ static int check_event_write(fd_set *fds, connection_t *cn, int *nc)
56
 /* token generation interval: 1200ms */
57
 #define TOKEN_INTERVAL 1200
58
 
59
-int cn_want_write(connection_t *cn)
60
+static int cn_want_write(connection_t *cn)
61
 {
62
 	if (cn->anti_flood) {
63
 		struct timeval tv;
64
-- 
65
1.7.3.4
66

Return to bug 179720