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

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1: - // $Id: module.pmod,v 1.110 2008/09/25 22:51:37 mast Exp $ + // $Id: module.pmod,v 1.111 2008/12/11 11:00:06 jonasw Exp $      #include <module.h>   #include <roxen.h>      // Locale macros   //<locale-token project="roxen_config"> LOCALE </locale-token>      #define LOCALE(X,Y) \    ([string](mixed)Locale.translate("roxen_config",roxenp()->locale->get(),X,Y))   
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1876:    return res;    }       string transform_from_form( string v, mapping va )    {    if( v == "" ) return "http://*/";    v = v[strlen(path())..];    if( strlen( va[v+"path"] ) && va[v+"path"][-1] != '/' )    va[v+"path"]+="/";    -  return (string)Standards.URI(va[v+"prot"]+"://"+va[v+"host"]+ +  // Handle IPv6 addresses +  string host = va[v + "host"]; +  if (has_value(host, ":") && !has_prefix(host, "[")) +  host = "[" + host + "]"; +  +  return (string)Standards.URI(va[v+"prot"]+"://"+ host +    (va[v+"port"] && sizeof (va[v+"port"]) ?    ":"+ va[v+"port"] : "") +"/"+va[v+"path"]+"#"    // all options below this point    "ip="+va[v+"ip"]+";"    "nobind="+va[v+"nobind"]+";"    );    }       array verify_set_from_form( array(string) new_value )    {
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:2000: Inside #if constant(SSL.sslfile)
  #if constant(SSL.sslfile)    // All is A-OK   #else    if( (protocol == "https" || protocol == "ftps") )    warning +=    LOCALE(339,"SSL support not available in this Pike version.")+"\n"+    sprintf(LOCALE(340,"Please use %s instead."),    protocol[..strlen(protocol)-2])+"\n";   #endif    int pno; -  if( sscanf( host, "%s:%d", host, pno ) == 2) -  if( roxenp()->protocols[ lower_case( protocol ) ] -  && (pno == roxenp()->protocols[ lower_case( protocol ) ]->default_port )) -  warning += sprintf(LOCALE(341,"Removed the default port number " -  "(%d) from %s"),pno,port)+"\n"; -  else -  host = host+":"+pno; -  -  +  int default_pno = +  (roxenp()->protocols[lower_case(protocol)] || ([ ]) )->default_port; +  if (has_value(host, "[")) { +  // IPv6 address +  Standards.URI uri = Standards.URI(port); +  pno = uri->port; +  port = (string) uri; +  } else { +  if (sscanf(host, "%s:%d", host, pno) == 2) +  if (pno != default_pno) +  host = host + ":" + pno;    port = protocol+"://"+host+path; -  +  } +  if (default_pno && (pno == default_pno)) +  warning += sprintf(LOCALE(341, "Removed the default port number " +  "(%d) from %s"), pno, port) + "\n";       if( !roxenp()->protocols[ protocol ] )    warning += sprintf(LOCALE(342,"Warning: The protocol %s is not known "    "by roxen"),protocol)+"\n";    return ({ (strlen(warning)?warning:0), port });   }      string input(string name, string value, int size,    void|mapping(string:string) args, void|int noxml)   {