Bug 27121 - Use libproxy to autofill proxy list
Summary: Use libproxy to autofill proxy list
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: butterfly (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/jo...
Whiteboard:
Keywords: patch
Depends on: 22508
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-16 19:22 UTC by Jonny Lamb
Modified: 2010-04-08 13:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jonny Lamb 2010-03-16 19:22:07 UTC
See branch.

I based this on my HTTP branch for obvious reasons, and made this bug depend on that one.
Comment 1 Olivier Le Thanh Duong 2010-04-05 06:18:04 UTC
+        # libproxy documentation states:
+        #
+        #  * The format of the returned proxy strings are as follows:
+        #  *   - http://[username:password@]proxy:port
+        #  *   - socks://[username:password@]proxy:port
+        #  *   - direct://
+        #
+        # We've already removed socks proxies, and dealt with direct://
+        # above, so the only other option is http://.
Actually, the documentation on the website state there maybe other proxying protocols returned such as rstp:// see http://code.google.com/p/libproxy/wiki/HowTo
So it maybe best to filter the list to only keep http:// here instead :
+        # Remove socks proxies that papyon doesn't support.
+        proxies = [p for p in proxies if not proxy.startswith('socks')]

Also, be sure to mention in the NEWS file and announce the suggested dependency on python-libproxy
Comment 2 Jonny Lamb 2010-04-06 11:28:04 UTC
(In reply to comment #1)
> Actually, the documentation on the website state there maybe other proxying
> protocols returned such as rstp:// see
> http://code.google.com/p/libproxy/wiki/HowTo
> So it maybe best to filter the list to only keep http:// here instead :

Good catch, I clearly didn't read it well enough. I've appended another commit to fix this.

> Also, be sure to mention in the NEWS file and announce the suggested dependency
> on python-libproxy

I will when I merge the branch. There has already been another release since I wrote it and I don't want to deal with NEWS conflicts.
Comment 3 Olivier Le Thanh Duong 2010-04-07 09:54:44 UTC
Directly when trying to connect :

ERROR:Butterfly.Connection:Failed to create Connection
Traceback (most recent call last):
  File "/home/olivier/Projects/telepathy-butterfly/butterfly/connection.py", line 104, in __init__
    self._use_next_proxy()
  File "/home/olivier/Projects/telepathy-butterfly/butterfly/connection.py", line 174, in _use_next_proxy
    del self._proxies['http']
KeyError: 'http'
Erreur de segmentation
Comment 4 Jonny Lamb 2010-04-07 10:09:26 UTC
(In reply to comment #3)
> KeyError: 'http'

sigh, fixed.
Comment 5 Jonny Lamb 2010-04-08 13:33:13 UTC
I merged this and updated NEWS.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.