Roxen.git
/
server
/
plugins
/
protocols
/
http.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/plugins/protocols/http.pike:1:
// This is a roxen protocol module. // Modified by Francesco Chemolli to add throttling capabilities. // Copyright © 1996 - 2001, Roxen IS.
-
constant cvs_version = "$Id: http.pike,v 1.
377
2002/07/04
09
:
20
:
07
per
Exp $";
+
constant cvs_version = "$Id: http.pike,v 1.
378
2002/07/04
18
:
47
:
33
nilsson
Exp $";
// #define REQUEST_DEBUG #define MAGIC_ERROR // HTTP protocol module. #include <config.h> #define TIMER_PREFIX "http:" #include <timers.h> inherit RequestID;
Roxen.git/server/plugins/protocols/http.pike:1047:
<td><a href='http://www.roxen.com/'><img border='0' src='/internal-roxen-roxen-small'></a></td> <td><b><font size='+1'>" + title + #"</font></b></td> <td align='right'><font size='+1'>Internet Server " + Roxen.html_encode_string (roxen_version()) + #"</font></td> </tr></table> "; } string format_backtrace(int eid) {
+
array info = cache_lookup( "http_bt_error", eid);
+
if(!info)
+
return error_page_header("Unregistered Error");
[string msg, array(string) rxml_bt, array(array) bt,
-
string raw_bt_descr, string raw_url, string raw] =
-
cache_lookup( "http_bt_error", eid)
;
+
string raw_bt_descr, string raw_url, string raw] =
info
;
-
+
string res = error_page_header ("Internal Server Error") + "<h1>" + replace (Roxen.html_encode_string (msg), "\n", "<br />\n") + "</h1>\n"; if (rxml_bt && sizeof (rxml_bt)) { res += "<h3>RXML frame backtrace</h3>\n<ul>\n"; foreach (rxml_bt, string line) res += "<li>" + Roxen.html_encode_string (line) + "</li>\n"; res += "</ul>\n\n"; }
Roxen.git/server/plugins/protocols/http.pike:1116:
return what; } int store_error(mixed _err) { mixed err = _err; _err = 0; // hide in backtrace, they are bad enough anyway... int id; do {
-
id = random(
0xffffffff
);
+
id = random(
(1<<64
)
-1 )
;
// 64 bit random number
} while(!cache_lookup("http_bt_error", id)); string msg; array(string) rxml_bt; if (!err) msg = "Unknown error"; else { msg = describe_error (err); // Ugly, but it's hard to fix it better.. int i = search (msg, "\nRXML frame backtrace:\n");