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 ChiliMoon protocol module. // Modified by Francesco Chemolli to add throttling capabilities. // Copyright © 1996 - 2001, Roxen IS.
-
constant cvs_version = "$Id: http.pike,v 1.
384
2002/10/23 20:
05
:
56
nilsson Exp $";
+
constant cvs_version = "$Id: http.pike,v 1.
385
2002/10/23 20:
58
:
21
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:120:
} } int `!( ) { return !realauth; } } AuthEmulator auth;
-
array(string) output_charset = ({});
-
string input_charset;
-
-
void set_output_charset( string|function to, int|void mode )
-
{
-
if( has_value( output_charset, to ) ) // Already done.
-
return;
-
-
switch( mode )
-
{
-
case 0: // Really set.
-
output_charset = ({ to });
-
break;
-
-
case 1: // Only set if not already set.
-
if( !sizeof( output_charset ) )
-
output_charset = ({ to });
-
break;
-
-
case 2: // Join.
-
output_charset |= ({ to });
-
break;
-
}
-
}
-
+
string charset_name( function|string what ) { switch( f ) { case string_to_unicode: return "ISO10646-1"; case string_to_utf8: return "UTF-8"; default: return upper_case((string)what); } } function charset_function( function|string what, int allow_entities ) {
-
switch(
f
)
+
switch(
what
)
{ case "ISO-10646-1": case "ISO10646-1": case string_to_unicode: return string_to_unicode; case "UTF-8": case string_to_utf8: return string_to_utf8; default: catch {
Roxen.git/server/plugins/protocols/http.pike:1843:
else call_out( roxen.handle, file->try_again_later, handle_request ); return; } else if( file->pipe ) return; TIMER_END(handle_request); send_result(); }
-
void adjust_for_config_path( string p )
-
{
-
if( not_query ) not_query = not_query[ strlen(p).. ];
-
raw_url = raw_url[ strlen(p).. ];
-
misc->site_prefix_path = p;
-
}
-
+
string url_base() // See the RequestID class for doc. { // Note: Code duplication in server_core/prototypes.pike. if (!cached_url_base) { // First look at the host header in the request. if (string tmp = misc->host) { int scanres = sscanf (tmp, "%[^:]:%d", string host, int port); if (scanres < 2)