Proxy tunnel is running when not needed

Bug #985576 reported by Roman Yepishev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Triaged
High
Manuel de la Peña
ubuntuone-client (Ubuntu)
Triaged
Undecided
Manuel de la Peña

Bug Description

def check_proxy_enabled(host, port):
    """Check if the proxy is enabled."""
    port = int(port)
    if sys.platform.startswith("linux"):
        settings = gsettings.get_proxy_settings()
        enabled = len(settings) > 0
        if enabled:
            proxy = build_proxy(settings)
            QNetworkProxy.setApplicationProxy(proxy)
        else:
            logger.info("Proxy is disabled.")
        return enabled
    else:
        QNetworkProxyFactory.setUseSystemConfiguration(True)
        query = QNetworkProxyQuery(host, port)
        proxies = QNetworkProxyFactory.systemProxyForQuery(query)
        # This is wrong ------------------------------------.
        return len(proxies) and proxies[0].type() != QNetworkProxy.DefaultProxy

When proxy is not enabled:
>>> from PyQt4.QtNetwork import (QNetworkProxyFactory, QNetworkProxyQuery, QNetworkProxy)
>>> QNetworkProxyFactory.setUseSystemConfiguration(True)
>>> query = QNetworkProxyQuery("fs-1.one.ubuntu.com", 443)
>>> proxies = QNetworkProxyFactory.systemProxyForQuery(query)
>>> proxies
[<PyQt4.QtNetwork.QNetworkProxy object at 0x15e4d00>]
>>> proxies[0]
<PyQt4.QtNetwork.QNetworkProxy object at 0x15e4d00>
>>> proxies[0].type()
2

Where 2 = QNetworkProxy.NoProxy

Checked on Ubuntu and Windows

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: ubuntuone-client 3.0.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
Uname: Linux 3.2.0-23-generic x86_64
ApportVersion: 2.0.1-0ubuntu4
Architecture: amd64
Date: Thu Apr 19 14:15:36 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120225)
PackageArchitecture: all
SourcePackage: ubuntuone-client
UbuntuOneSyncdaemonExceptionsLog:

UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Roman Yepishev (rye) wrote :
Changed in ubuntuone-client (Ubuntu):
assignee: nobody → Manuel de la Peña (mandel)
Changed in ubuntuone-client:
assignee: nobody → Manuel de la Peña (mandel)
description: updated
summary: - Proxy started when not needed
+ Proxy tunnel started when not needed
Rick McBride (rmcbride)
Changed in ubuntuone-client:
status: New → Triaged
Changed in ubuntuone-client (Ubuntu):
status: New → Triaged
Changed in ubuntuone-client:
importance: Undecided → High
Leo Arias (elopio)
tags: added: desktop+
Revision history for this message
Roman Yepishev (rye) wrote : Re: Proxy tunnel started when not needed

I have to note that the original check indeed works on Ubuntu so this is not a simple "replace checks" task, needs to be investigated on both platforms.

Roman Yepishev (rye)
summary: - Proxy tunnel started when not needed
+ Proxy tunnel is running when not needed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.