Roxen.git/
server/
protocols/
http.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2000-05-14
2000-05-14 16:10:09 by Francesco Chemolli <li@kinkie.it>
bdd308d31e029ef7ec72ea8276d8f6cbf1a08985 (
13
lines) (+
11
/-
2
)
[
Show
|
Annotate
]
Branch:
5.2
Added some throttling-related bread crumbs.
Rev: server/protocols/http.pike:1.232
2:
// Modified by Francesco Chemolli to add throttling capabilities. // Copyright © 1996 - 2000, Roxen IS.
-
constant cvs_version = "$Id: http.pike,v 1.
231
2000/05/
08
00
:
08
:
23
nilsson
Exp $";
+
constant cvs_version = "$Id: http.pike,v 1.
232
2000/05/
14
16
:
10
:
09
kinkie
Exp $";
#define MAGIC_ERROR
37:
#define MARK_FD(X) REQUEST_WERR(X) #endif
+
#ifdef THROTTLING_DEBUG
+
#undef THROTTLING_DEBUG
+
#define THROTTLING_DEBUG(X) werror("Throttling: "+X+"\n")
+
#else
+
#define THROTTLING_DEBUG(X)
+
#endif
+
constant decode = MIME.decode_base64; constant find_supports_and_vars = roxen.find_supports_and_vars; constant version = roxen.version;
311:
pipe=roxen->fastpipe(); } }
-
if (throttle->doit) {
+
if (throttle->doit) {
//we are sure that pipe is really a slowpipe.
throttle->rate=max(throttle->rate, conf->query("req_throttle_min")); //if conf=0 => throttle=0 pipe->throttle(throttle->rate, (int)(throttle->rate*conf->query("req_throttle_depth_mult")), 0);
-
+
THROTTLING_DEBUG("throtting request at "+throttle->rate);
} if (conf && conf->throttler) { pipe->assign_throttler(conf->throttler);