Question about nnrp authentication
Forrest J. Cavalier III
Forrest.J.Cavalier.III at bngr209-74-53ppp79.epix.net
Thu Dec 30 16:47:42 UTC 1999
> Sort of on the same topic, anyone have hacks to nntpd that can limit the
> amount of bandwidth a connection gets?
You mean nnrpd? This is inn-workers. (There is an NNTPD, but that
is something totally different.)
You could easily do the mod yourself. Just off the top
of my head, (so not tested) this function....
void bwlimit(int cb)
{
static time_t tStart;
static long cbCumulative;
if (!tStart) {
tStart = time(NULL);
}
cbCumulative += cb;
while (cbCumulative / (time(NULL)+1 - tstart ) > BW_LIMIT_BYTES_PER_SECOND) {
sleep(1);
}
}
...call it each time data is written or read, with the number
of bytes written or read. It will sleep() appropriately. If
you expect the total connection to overflow a long, then add
some code to whach cbCumulative (and tstart) to 0.)
I do provide INN customization and consulting, if you need that
type of service.
Forrest J. Cavalier III, Mib Software
http://www.mibsoftware.com
More information about the inn-workers
mailing list