Patch info for bandwidth-limiting-2_dj
Patch info for bandwidth-limiting-2_dj
Author Comments
Date: Sun, 23 Mar 2003 11:29:24 -0500 (EST)
From: David A Jenkins <dj@wnmail.att.com>
Subject: Patch submission
Folks,
A while ago I posted a patch to 3.14 to enable bandwidth limits
per-connection. The bandwidth limit was hard-coded to 200 kbps, but
with overhead it was always something less than that. I've ported
the same patch to 4.04. The bandwidth limit is still per-connection
and still hard-coded. The patch is attached.
I could make this patch more polished, but I don't think people
usually want their stunnel to run slower, so I doubt anyone is using
this patch. Why am I using it? Let's say I have a small dial-up
service with a small news server. Then I decide to allow people
to access the news server from the (much faster) internet backbone.
I use this patch to slow down news readers to the point where
they seem like dial-up news readers, and then I don't have to buy
a new news server.
How does it work? Since stunnel has a thread for each connection,
all we have to do is have the thread nanosleep the right amount
of time after each write. The amount of time to sleep is a function
of the number of bytes written. The table of sleep times is computed
only once.
Build Notes:
You also have to change line 125 of src/Makefile to include -lposix4.
Since that is a generated file, I can't patch it, and I'm too lazy
to add this to configure correctly.
Dave
This website makes patches available for use by the
Internet community. However it does not endorse any of the patches
contained herein. They could be work perfectly, or totally foul up
everything. We don't know. Contact the authors if you have any
questions. Use at your own risk.
The Stunnel software package does not contain any
cryptography itself, however please remember that import and/or export of
cryptographic software, code providing hooks to cryptographic
algorithms, and discussion about cryptography is illegal in some countries.
It is imperative for you to know your local laws governing cryptography.
We're not liable for anything you do that violates your local laws.
|