Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.1001 2008/12/11 15:32:28 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1002 2008/12/11 15:58:42 jonasw Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:2020:    }    return segments;    }       string canonical_ip(string i)    {    if (!i) return 0;    if (has_value(i, ":")) {    // IPv6    if (i == "::") return "::"; // IPv6 ANY. +  if (i == "::1") return "::1"; // IPv6 localhost    array(string) partitions = i/"::";    array(int) sections = get_ipv6_sequence(partitions[0]);    if (sizeof(partitions) > 1) {    array(int) tail = get_ipv6_sequence(partitions[1]);    sections += allocate(8 - sizeof(sections) - sizeof(tail)) + tail;    } else if (sizeof(sections) < 8) {    sections += allocate(8 - sizeof(sections));    }    i = sprintf("%04.4x:%04.4x:%04.4x:%04.4x:"    "%04.4x:%04.4x:%04.4x:%04.4x",    @sections);    // Common case.    if (i == "0000:0000:0000:0000:0000:0000:0000:0000") return "::"; // ANY -  +  if (i == "0000:0000:0000:0000:0000:0000:0000:0001") return "::1"; // localhost       // Compress the longest sequence of zeros.    partitions = i/":";    int start;    int max;    int best;    foreach(partitions + ({ "SENTINEL" }); int ind; string part) {    if (part != "0000") {    if ((ind - start) > max) {    best = start;
Roxen.git/server/base_server/roxen.pike:2543:    return 0; // FAIL   }      string normalize_url(string url)   {    if (!sizeof (url - " " - "\t")) return "";       url = lower_case( url );    Standards.URI ui = Standards.URI(url);    ui->fragment = 0; -  if (ui->host == "any") +  if (ui->host == "any" || ui->host == "::")    ui->host = "*";       string host = ui->host;    string protocol = ui->scheme;    if (!host || !sizeof(host) || !protocols[protocol])    return "";    if (!ui->port)    ui->port = protocols[protocol]->default_port;    return (string) ui;   }
Roxen.git/server/base_server/roxen.pike:2617:    }    ui->fragment = 0;       if( (int)opts->nobind )    {    report_warning(    LOC_M(61,"Not binding the port %O, disabled in configuration")+"\n",    (string) ui );    return 0;    } -  if (ui->host == "any") +  if (ui->host == "any" || ui->host == "::")    ui->host = "*";       protocol = ui->scheme;    host = ui->host;    if (!sizeof(host || "") || !protocols[protocol]) {    report_error(LOC_M(19,"Bad URL '%s' for server `%s'")+"\n",    (string) ui, conf->query_name());    }    if (!ui->port)    ui->port = protocols[protocol]->default_port;