pike.git / lib / modules / Standards.pmod / URI.pike

version» Context lines:

pike.git/lib/modules/Standards.pmod/URI.pike:1:   //! This class implements URI parsing and resolving of relative references to   //! absolute form, as defined in RFC 2396      // Implemented by Johan Sundström and Johan Schön.   // Copyright (c) Roxen Internet Software 2001 - // $Id: URI.pike,v 1.3 2001/01/12 23:52:23 grubba Exp $ + // $Id: URI.pike,v 1.4 2001/01/13 00:09:52 grubba Exp $      #pragma strict_types      //! Scheme component of URI   string scheme;      //! Authority component of URI (formerly called net_loc, from RFC 2396 known as authority)   string authority;      //! Path component of URI. May be empty, but not undefined.
pike.git/lib/modules/Standards.pmod/URI.pike:220:       // Parse query information    sscanf(uri, "%s?%s", uri, query);    if(query && !sizeof(query)) query = 0;    debug("Found query %O", query);       // Parse path:    path = uri;    debug("Found path %O", path);    -  if(authority) -  parse_authority(); -  +     // 3) If the scheme component is defined, indicating that the reference    // starts with a scheme name, then the reference is interpreted as an    // absolute URI and we are done. Otherwise, the reference URI's    // scheme is inherited from the base URI's scheme component.    if(scheme)    { -  +  if(authority) +  parse_authority(); +     debug("Scheme found! RFC 2396, §5.2, step 3 says we're absolute. Done!", 0);    return;    }    scheme = local::base_uri->scheme;    debug("Inherited scheme %O from base URI", scheme);    -  +  if(authority) +  parse_authority();    -  +     // 4) If the authority component is defined, then the reference is a    // network-path and we skip to step 7. Otherwise, the reference    // URI's authority is inherited from the base URI's authority    // component, which will also be undefined if the URI scheme does not    // use an authority component.    if(!authority || !sizeof(authority))    {    authority = local::base_uri->authority;    debug("Inherited authority %O from base URI", authority);    parse_authority();