ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/connection.C
(Generate patch)

Comparing gvpe/src/connection.C (file contents):
Revision 1.34 by pcg, Mon May 10 18:57:07 2004 UTC vs.
Revision 1.35 by pcg, Mon May 10 21:24:48 2004 UTC

202// only do action once every x seconds per host whole allowing bursts. 202// only do action once every x seconds per host whole allowing bursts.
203// this implementation ("splay list" ;) is inefficient, 203// this implementation ("splay list" ;) is inefficient,
204// but low on resources. 204// but low on resources.
205struct net_rate_limiter : list<net_rateinfo> 205struct net_rate_limiter : list<net_rateinfo>
206{ 206{
207# define NRL_ALPHA 1. - 1. / 600. // allow bursts 207# define NRL_ALPHA (1. - 1. / 600.) // allow bursts
208# define NRL_CUTOFF 10. // one event every CUTOFF seconds 208# define NRL_CUTOFF 10. // one event every CUTOFF seconds
209# define NRL_EXPIRE NRL_CUTOFF * 30. // expire entries after this time 209# define NRL_EXPIRE (NRL_CUTOFF * 30.) // expire entries after this time
210# define NRL_MAXDIF NRL_CUTOFF * (1. / (1. - NRL_ALPHA)) // maximum diff /count value 210# define NRL_MAXDIF (NRL_CUTOFF * (1. / (1. - NRL_ALPHA))) // maximum diff /count value
211 211
212 bool can (const sockinfo &si) { return can((u32)si.host); } 212 bool can (const sockinfo &si) { return can((u32)si.host); }
213 bool can (u32 host); 213 bool can (u32 host);
214}; 214};
215 215

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines