Proxy tunnel is running when not needed

Bug #985576 reported by Roman Yepishev on 2012-04-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Manuel de la Peña
ubuntuone-client (Ubuntu)
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)
  "Proxy is disabled.")
        return enabled
        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("", 443)
>>> proxies = QNetworkProxyFactory.systemProxyForQuery(query)
>>> proxies
[<PyQt4.QtNetwork.QNetworkProxy object at 0x15e4d00>]
>>> proxies[0]
<PyQt4.QtNetwork.QNetworkProxy object at 0x15e4d00>
>>> proxies[0].type()

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

UpgradeStatus: No upgrade log present (probably fresh install)

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) on 2012-04-20
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) on 2012-04-27
tags: added: desktop+

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) on 2012-06-26
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  Edit
Everyone can see this information.

Other bug subscribers