Roxen.git / server / base_server / hosts.pike

version» Context lines:

Roxen.git/server/base_server/hosts.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: hosts.pike,v 1.40 2010/03/16 13:47:01 jonasw Exp $ + // $Id$      #include <roxen.h>      #ifdef NO_DNS   // Don't do ANY DNS lookups.   string blocking_ip_to_host(string ip) { return ip; }   string blocking_host_to_ip(string host) { return host; }   string quick_ip_to_host(string ip) { return ip; }   string quick_host_to_ip(string host) { return host; }   void ip_to_host(string ipnumber, function callback, mixed ... args)
Roxen.git/server/base_server/hosts.pike:108:    ipnumber=(ipnumber/" ")[0]; // ?    mapping cache_ctx = ([]);    if(mixed foo = cache_lookup("hosts", ipnumber, cache_ctx)) return foo;    LOOKUP(IP_TO_HOST,ipnumber,0,0, cache_ctx);    return ipnumber;   }         string quick_host_to_ip(string h)   { +  if (!stringp (h) || !sizeof (h)) return h; +     if(h[-1] == '.') h=h[..strlen(h)-2];    ISIP(h,return h);    mapping cache_ctx = ([]);    if(mixed foo = cache_lookup("hosts", h, cache_ctx)) return foo;    LOOKUP(HOST_TO_IP,h,0,0, cache_ctx);    return h;   }      void ip_to_host(string ipnumber, function callback, mixed ... args)   {