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

version» Context lines:

pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:177:       if( user || password )    {    if( !request_headers )    proxy_headers = ([]);    else    proxy_headers = request_headers + ([]);       proxy_headers["Proxy-Authorization"] = "Basic "    + MIME.encode_base64((user || "") + ":" + (password || ""), 1); +  if (has_value(proxy->host, ":")) { +  proxy_headers["host"] = "[" + proxy->host + "]:" + proxy->port; +  } else { +  proxy_headers["host"] = proxy->host + ":" + proxy->port;    } -  +  }       if (url->scheme == "http") {    if( query_variables )    url->set_query_variables( url->get_query_variables() +    query_variables );    string web_url = (string)url;       // Note: url object is wrecked here    url->scheme = proxy->scheme;    url->host = proxy->host;
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:204:   #endif    if (!con || (con->host != url->host) || (con->port != url->port)) {    // Make a CONNECT request to the proxy,    // and use keep-alive to stack the real request on top.    proxy->path = url->host + ":" + url->port;    if (!proxy_headers) proxy_headers = ([]);    proxy_headers->connection = "keep-alive";    m_delete(proxy_headers, "authorization"); // Keep the proxy in the dark.    con = do_method("CONNECT", proxy, 0, proxy_headers);    con->data(0); -  if (con->status/100 > 2) { +  if (con->status >= 300) { +  // Proxy did not like us or failed to connect to the remote.    return con;    }    con->headers["connection"] = "keep-alive";    con->headers["content-length"] = "0";    con->host = url->host;    con->port = url->port;    con->https = 1;    con->start_tls(1);    }    proxy_headers = request_headers;
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:447:    con->request_fail(con, @con->extra_args);   }      protected void https_proxy_connect_ok(Protocols.HTTP.Query con,    array(mixed) orig_cb_info,    Standards.URI url, string method,    mapping(string:string) query_variables,    mapping(string:string) request_headers,    string data)   { +  if (con->status >= 300) { +  // Proxy did not like us or failed to connect to the remote. +  https_proxy_connect_fail(con, orig_cb_info, url, method, +  query_variables, request_headers, +  data); +  return; +  }    con->set_callbacks(@orig_cb_info);       // Install the timeout handler for the interval until    // the TLS connection is up.    con->init_async_timeout();    con->con->set_nonblocking(0,    lambda() {    // Remove the timeout handler; it will be    // reinstated by do_async_method() below.    con->remove_async_timeout();
pike.git/lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:534:       if( user || password )    {    if( !request_headers )    proxy_headers = ([]);    else    proxy_headers = request_headers + ([]);       proxy_headers["Proxy-Authorization"] = "Basic "    + MIME.encode_base64((user || "") + ":" + (password || ""), 1); +  if (has_value(proxy->host, ":")) { +  proxy_headers["host"] = "[" + proxy->host + "]:" + proxy->port; +  } else { +  proxy_headers["host"] = proxy->host + ":" + proxy->port;    } -  +  }       if (url->scheme == "http") {    if( query_variables )    url->set_query_variables( url->get_query_variables() +    query_variables );    string web_url = (string)url;       // Note: url object is wrecked here    url->scheme = proxy->scheme;    url->host = proxy->host;