From b2c011a23adfb2472f51a4c18bf8f29e6e37bb04 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 12 May 2005 00:36:20 +0000 Subject: Customizable by-byte-size recvq stuff git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1365 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a4e9b1934..cf68705cb 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -357,7 +357,7 @@ void readfile(file_cache &F, const char* fname) void ReadConfig(bool bail, userrec* user) { char dbg[MAXBUF],pauseval[MAXBUF],Value[MAXBUF],timeout[MAXBUF],NB[MAXBUF],flood[MAXBUF],MW[MAXBUF]; - char AH[MAXBUF],AP[MAXBUF],AF[MAXBUF],DNT[MAXBUF],pfreq[MAXBUF],thold[MAXBUF],sqmax[MAXBUF]; + char AH[MAXBUF],AP[MAXBUF],AF[MAXBUF],DNT[MAXBUF],pfreq[MAXBUF],thold[MAXBUF],sqmax[MAXBUF],rqmax[MAXBUF]; ConnectClass c; std::stringstream errstr; @@ -464,6 +464,7 @@ void ReadConfig(bool bail, userrec* user) ConfValue("connect","pingfreq",i,pfreq,&config_f); ConfValue("connect","threshold",i,thold,&config_f); ConfValue("connect","sendq",i,sqmax,&config_f); + ConfValue("connect","recvq",i,rqmax,&config_f); if (Value[0]) { strlcpy(c.host,Value,MAXBUF); @@ -476,6 +477,7 @@ void ReadConfig(bool bail, userrec* user) c.flood = atoi(flood); c.threshold = 5; c.sendqmax = 262144; // 256k + c.recvqmax = 4096; // 4k if (atoi(thold)>0) { c.threshold = atoi(thold); @@ -484,6 +486,10 @@ void ReadConfig(bool bail, userrec* user) { c.sendqmax = atoi(sqmax); } + if (atoi(rqmax)>0) + { + c.recvqmax = atoi(rqmax); + } if (atoi(timeout)>0) { c.registration_timeout = atoi(timeout); @@ -2540,6 +2546,7 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) int class_flood = 0; long class_threshold = 5; long class_sqmax = 262144; // 256kb + long class_rqmax = 4096; // 4k for (ClassVector::iterator i = Classes.begin(); i != Classes.end(); i++) { @@ -2550,6 +2557,7 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) clientlist[tempnick]->pingmax = i->pingtime; class_threshold = i->threshold; class_sqmax = i->sendqmax; + class_rqmax = i->recvqmax; break; } } @@ -2559,6 +2567,7 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) clientlist[tempnick]->flood = class_flood; clientlist[tempnick]->threshold = class_threshold; clientlist[tempnick]->sendqmax = class_sqmax; + clientlist[tempnick]->recvqmax = class_rqmax; for (int i = 0; i < MAXCHANS; i++) { -- cgit v1.2.3