Roxen.git / server / etc / modules / Roxen.pmod

version» Context lines:

Roxen.git/server/etc/modules/Roxen.pmod:1:   // This is a roxen pike module. Copyright © 1999 - 2001, Roxen IS.   // - // $Id: Roxen.pmod,v 1.178 2004/05/17 17:46:10 mast Exp $ + // $Id: Roxen.pmod,v 1.179 2004/06/08 12:50:07 noring Exp $      #include <roxen.h>   #include <config.h>   #include <version.h>   #include <module.h>   #include <variables.h>   #include <stat.h>   #define roxen roxenp()      #ifdef HTTP_DEBUG
Roxen.git/server/etc/modules/Roxen.pmod:3061:   //! numeric form is used (since it's understood better than the   //! hexadecimal form by at least Netscape 4).   {    if (string chref = inverse_charref_table[char]) return "&" + chref + ";";    return sprintf ("&#%d;", char[0]);   }         // RXML complementary stuff shared between configurations.    + class ScopeRequestHeader { +  inherit RXML.Scope; +  +  mixed `[] (string var, void|RXML.Context c, void|string scope, void|RXML.Type type) { +  string|array(string) val = (c || RXML_CONTEXT)->id->request_headers[var]; +  if(!val) +  return RXML.nil; +  if(type) +  { +  if(arrayp(val) && type->subtype_of (RXML.t_any_text)) +  val *= "\0"; +  return type->encode(val); +  } +  return val; +  } +  +  array(string) _indices(void|RXML.Context c) { +  return indices((c || RXML_CONTEXT)->id->request_headers); +  } +  +  array(string) _values(void|RXML.Context c) { +  return values((c || RXML_CONTEXT)->id->request_headers); +  } +  +  string _sprintf() { return "RXML.Scope(request-header)"; } + } +    class ScopeRoxen {    inherit RXML.Scope;       string pike_version=predef::version();    int ssl_strength=0;      #if constant(SSL)    void create() {    ssl_strength=40;   #if constant(SSL.constants.CIPHER_des)
Roxen.git/server/etc/modules/Roxen.pmod:3333:    if(!c->id->cookies[var]) return;    // Note: The same applies here as in `[]= above.    predef::m_delete(c->id->cookies, var);    add_http_header(c->misc[" _extra_heads"], "Set-Cookie",    http_encode_cookie(var)+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/");    }       string _sprintf() { return "RXML.Scope(Cookie)"; }   }    + RXML.Scope scope_request_header=ScopeRequestHeader();   RXML.Scope scope_roxen=ScopeRoxen();   RXML.Scope scope_page=ScopePage();   RXML.Scope scope_cookie=ScopeCookie();      class ScopeModVar   {    class Modules( mapping module, string sname )    {    class ModVars( RoxenModule mod )    {
Roxen.git/server/etc/modules/Roxen.pmod:3504:   }      FormScope scope_form = FormScope();      RXML.TagSet entities_tag_set = class   // This tag set always has the lowest priority.   {    inherit RXML.TagSet;       void entities_prepare_context (RXML.Context c) { +  c->add_scope("request-header", scope_request_header);    c->misc->scope_roxen=([]);    c->add_scope("roxen",scope_roxen);    c->misc->scope_page=([]);    c->add_scope("page",scope_page);    c->add_scope("cookie", scope_cookie);    c->add_scope("modvar", scope_modvar);    c->add_scope("form", scope_form );    c->add_scope("client", c->id->client_var);    c->add_scope("var", ([]) );    }