Branch: Tag:

2008-12-11

2008-12-11 15:32:54 by 0

Fix IPv6 bugs.

Rev: server/base_server/module.pike:1.233
Rev: server/base_server/prototypes.pike:1.221
Rev: server/base_server/roxen.pike:1.1001
Rev: server/config_interface/sites/site_content.pike:1.153
Rev: server/etc/modules/Roxen.pmod:1.261
Rev: server/etc/modules/RoxenRPC.pmod/HTTP.pmod/Client.pike:1.11
Rev: server/modules/proxies/gopher.pike:1.28
Rev: server/modules/proxies/relay2.pike:1.39
Rev: server/modules/proxies/wais.pike:1.29
Rev: server/modules/tags/html_wash.pike:1.34
Rev: server/protocols/http.pike:1.572

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2004, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.571 2008/12/09 12:44:38 stewa Exp $"; + constant cvs_version = "$Id: http.pike,v 1.572 2008/12/11 15:32:22 jonasw Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
2486:    sscanf(raw_url[sizeof(port_obj->url_prefix)..], "%[^/]%s",    misc->host, raw_url);    } -  if (misc->host) { +  if (string h = misc->host) {    // Parse and canonicalize the host header.    misc->port = port_obj->default_port; -  sscanf(lower_case(misc->host), "%[^:]:%d", misc->hostname, misc->port); +  if (has_prefix(h, "[")) { +  // IPv6 address +  sscanf(lower_case(h), "[%s]:%d", misc->hostname, misc->port); +  misc->hostname = "[" + misc->hostname + "]"; +  } else { +  sscanf(lower_case(h), "%[^:]:%d", misc->hostname, misc->port); +  }    misc->host = misc->hostname + ":" + misc->port;    }    if( !conf || !(path = port_obj->path ) ||