pike.git / lib / modules / Protocols.pmod / HTTP.pmod / Session.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike:12:   //! and all header, query, post or put information is dropped.   //!   //! Default is 20 redirects. A negative number will mean infinity.   //! @bugs   //! Loops will currently not be detected, only the limit   //! works to stop loops.   //! @seealso   //! @[Request.follow_redirects]   int follow_redirects=20;    - #define RUNTIME_RESOLV(X) master().resolv(#X) + #define RUNTIME_RESOLV(X) master()->resolv(#X)      //! Default HTTP headers.   mapping default_headers = ([    "user-agent":"Mozilla/5.0 (compatible; MSIE 6.0; Pike HTTP client)"    " Pike/"+__REAL_MAJOR__+"."+__REAL_MINOR__+"."+__REAL_BUILD__,   ]);      //! Request   class Request   {
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike:91:    "protocol than HTTP\n",    url->scheme);   #endif /* constant(SSL.File) */    mapping request_headers = copy_value(default_headers);    if (url->referer)    request_headers->referer=(string)url->referer;       if(url->user || url->password)    request_headers->authorization = "Basic "    + MIME.encode_base64((url->user || "") + ":" + -  (url->password || "")); +  (url->password || ""), 1);       request_headers->connection=    (time_to_keep_unused_connections<=0)?"Close":"Keep-Alive";       request_headers->host=url->host;       if (url->scheme == "http" && url->port != 80) {    request_headers->host += ":" + url->port;    }    else if (url->scheme == "https" && url->port != 443) {
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/Session.pike:365:    void check_for_cookies()    {    if (!con->ok || !con->headers || !cookie_encountered) return;       foreach (con->headers["set-cookie"]||({});;string cookie)    cookie_encountered(cookie,url_requested);    }      // ----------------    - //! @[destroy] is called when an object is destructed. +    //! But since this clears the HTTP connection from the Request object,   //! it can also be used to reuse a @[Request] object.    void destroy()    {    if (con) return_connection(url_requested,con);    con=0;    }    -  + //! @[_destruct] is called when an object is destructed. +  protected void _destruct() +  { +  destroy(); +  } +    // ----------------       string _sprintf(int t)    {    if (t=='O')    return sprintf("Request(%O",(string)url_requested)+    (!con?" - no connection"    :((con->con?" - connected":"")+    (!con->ok?" - failed"    :" - "+(sizeof(con->buf)+" bytes received"))))+