Review Request: Proxy overhaul Part 5: Add support for trying multiple proxies to KIO HTTP

Dawit Alemayehu adawit at kde.org
Tue Sep 27 22:12:42 BST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102696/
-----------------------------------------------------------

(Updated Sept. 27, 2011, 9:12 p.m.)


Review request for kdelibs.


Changes
-------

Found more proxy related issues and fixed those as well:

     * Remove support for 'PersistentProxyConnection' option since it serves no
       purpose other than causing unnecessary failures and bugs when using
       proxy servers.  To see these problems, simply disable the 'Use persistent proxy conneciton' 
       option in the proxy configuration dialog and use a proxy server, e.g. privoxy.
    
     * Cleaned up how m_request.isKeepAlive is used:
         - No point in calling httpCloseConnection based on the state of this flag
           in proceedUntilResponseHeader since sendQuery will always take care of that.
    
         - Do not reset m_request.ikeepAlive flag in httpCloseConnection. Otherwise,
           it will inadvertently set the flag to false since it gets called way too
           much. This flag now is initially set to true in resetSessionConfiguration
           and only updated based on how the remote sever responds.
    
         - If the server sends back a "keep-alive" header, but reports itself as a
           HTTP/1.0 server, make sure this flag is set to true.


Description
-------

This 5th patch in a serious of patches meant to improve proxy support in KDE deals with support at the kioslave level. More specifically the http ioslave. The patch is necessary to provide proper support for PAC script based proxy configuration. Namely allowing aleternate proxy servers to be specified and used as necessary. Here are the change this patch makes:

     * Add a new function in TCPSlaveBase to connect to the a remote server without 
        automatically sending error notitification to the client. [NEW API]
    
     * Move the proxy related code from 'resetSessionSettings' to 'httpOpenConnection'.
       Proxy information will now be only set from 'setHost' and reset from 
       'reparseConfiguration' as it should have been from the beginning. No need to 
       reparse proxy related information on every request.
    
     * Added a new variable, proxyUrls, to HTTPRequest to store the multiple proxy URLs
        obtained from the "ProxyUrls" meta-data.
    
     * Modified 'httpShouldCloseConnection' to account for multiple proxy addresses.
    
     * Modified 'sendQuery' to connect to the remote server before formatting the HTTP
       headers so that the headers can properly reflect the correct proxy settings.


Diffs (updated)
-----

  kio/kio/tcpslavebase.h 3f87ea8 
  kio/kio/tcpslavebase.cpp ec70559 
  kioslave/http/http.h d8c47c7 
  kioslave/http/http.cpp 6d41a13 

Diff: http://git.reviewboard.kde.org/r/102696/diff/diff


Testing (updated)
-------

- Tested changes using a real proxy server, privoxy.

- Tested changes using a poor man's SOCKS proxy setup: 
      ssh -D <port#> <ssh-server-address>
   and the following PAC script:

function FindProxyForURL( url, host )
{
    var resolved_ip = dnsResolve(host);
    
    if (isInNet(resolved_ip, "127.0.0.1", "255.255.255.0"))
        return "DIRECT";

    return "SOCKS 127.0.0.1:9999; DIRECT";
}


Thanks,

Dawit Alemayehu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110927/57d37767/attachment.htm>


More information about the kde-core-devel mailing list