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.1 2001/01/11 17:16:44 js Exp $ + // $Id: URI.pike,v 1.2 2001/01/11 22:17:42 js Exp $      //! 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.   string path;   
pike.git/lib/modules/Standards.pmod/URI.pike:207:    scheme = 0;    if(!base_uri)    error("Standards.URI: got a relative URI (no scheme) lacking a base_uri!\n");    }    debug("Found scheme %O", scheme);       // Parse authority/login    if(sscanf(uri, "//%[^/]%s", authority, uri))    {    debug("Found authority %O", authority); -  parse_authority(); +     }       // 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);
pike.git/lib/modules/Standards.pmod/URI.pike:232:    // absolute URI and we are done. Otherwise, the reference URI's    // scheme is inherited from the base URI's scheme component.    if(scheme)    {    debug("Scheme found! RFC 2396, §5.2, step 3 says we're absolute. Done!", 0);    return;    }    scheme = 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 = base_uri->authority;    debug("Inherited authority %O from base URI", authority);    parse_authority();