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.1003 2008/12/11 17:14:02 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1004 2008/12/11 17:17:58 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 +  if (i == "::1") return "::1"; // IPv6 loopback    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 +  if (i == "0000:0000:0000:0000:0000:0000:0000:0001") return "::1"; // loopback       // 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;