VirtualBox

Changeset 57655 in vbox


Ignore:
Timestamp:
Sep 8, 2015 1:49:50 PM (9 years ago)
Author:
vboxsync
Message:

UINetworkReply.cpp: Reinterpret no user specified proxy config as a wish to use the system proxy config. This will work better for most users, I hope.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp

    r57624 r57655  
    278278    m_strContext = tr("During proxy configuration");
    279279
    280     /* Make sure proxy is enabled in Proxy Manager: */
     280    /* Get the proxymanager: */
    281281    UIProxyManager proxyManager(vboxGlobal().settings().proxySettings());
     282
     283    /* If the specific proxy settings aren't enabled, we'll use the
     284       system default proxy.  Otherwise assume it's configured. */
     285    int rc;
    282286    if (!proxyManager.proxyEnabled())
    283         return VINF_SUCCESS;
    284 
    285     /* Apply proxy rules: */
    286     return applyProxyRules(m_hHttp,
    287                            proxyManager.proxyHost(),
    288                            proxyManager.proxyPort().toUInt());
     287        rc = RTHttpUseSystemProxySettings(m_hHttp);
     288    else
     289        rc = RTHttpSetProxy(m_hHttp,
     290                            proxyManager.proxyHost().toUtf8().constData(),
     291                            proxyManager.proxyPort().toUInt(),
     292                            NULL /* pszProxyUser */, NULL /* pszProxyPwd */);
     293
     294    /** @todo This should be some kind of tristate:
     295     *      - system configured proxy ("proxyDisabled" as well as default "")
     296     *      - user configured proxy ("proxyEnabled").
     297     *      - user configured "no proxy" (currently missing).
     298     * In the two last cases, call RTHttpSetProxy.
     299     *
     300     * Alternatively, we could opt not to give the user a way of doing "no proxy",
     301     * that would require no real changes to the visible GUI... Just a thought.
     302     */
     303    return rc;
    289304}
    290305
     
    450465    const QDir homeDir(QDir::toNativeSeparators(vboxGlobal().homeFolder()));
    451466    return QDir::toNativeSeparators(homeDir.absoluteFilePath(s_strCertificateFileName));
    452 }
    453 
    454 /* static */
    455 int UINetworkReplyPrivateThread::applyProxyRules(RTHTTP hHttp, const QString &strHostName, int iPort)
    456 {
    457     /* Make sure HTTP is created: */
    458     if (hHttp == NIL_RTHTTP)
    459         return VERR_INVALID_HANDLE;
    460 
    461     /* Apply HTTP proxy: */
    462     return RTHttpSetProxy(hHttp,
    463                           strHostName.toAscii().constData(),
    464                           iPort,
    465                           0 /* login */, 0 /* password */);
    466467}
    467468
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette