VirtualBox

Changeset 79840 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jul 17, 2019 4:09:05 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132227
Message:

IPRT/http-curl.cpp: Apparently cURL forgets proxy setup after curl_easy_reset(), so added flag to force updating it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r79835 r79840  
    171171    /** Set if we've detected no proxy necessary. */
    172172    bool                fNoProxy;
     173    /** Set if we've reset proxy info in cURL and need to reapply it.  */
     174    bool                fReapplyProxyInfo;
    173175    /** Proxy host name (RTStrFree). */
    174176    char               *pszProxyHost;
     
    433435    pThis->rcOutput                 = VINF_SUCCESS;
    434436
     437    /* Tell the proxy configuration code to reapply settings even if they
     438       didn't change as cURL has forgotten them: */
     439    pThis->fReapplyProxyInfo        = true;
     440
    435441    return VINF_SUCCESS;
    436442}
     
    586592#endif
    587593
    588     if (enmProxyType != pThis->enmProxyType)
     594    if (   pThis->fReapplyProxyInfo
     595        || enmProxyType != pThis->enmProxyType)
    589596    {
    590597        rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYTYPE, (long)enmProxyType);
     
    594601    }
    595602
    596     if (uPort != pThis->uProxyPort)
     603    if (   pThis->fReapplyProxyInfo
     604        || uPort != pThis->uProxyPort)
    597605    {
    598606        rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYPORT, (long)uPort);
     
    602610    }
    603611
    604     if (   pszUsername != pThis->pszProxyUsername
     612    if (   pThis->fReapplyProxyInfo
     613        || pszUsername != pThis->pszProxyUsername
    605614        || RTStrCmp(pszUsername, pThis->pszProxyUsername))
    606615    {
     
    620629    }
    621630
    622     if (   pszPassword != pThis->pszProxyPassword
     631    if (   pThis->fReapplyProxyInfo
     632        || pszPassword != pThis->pszProxyPassword
    623633        || RTStrCmp(pszPassword, pThis->pszProxyPassword))
    624634    {
     
    639649    }
    640650
    641     if (   pszHost != pThis->pszProxyHost
     651    if (   pThis->fReapplyProxyInfo
     652        || pszHost != pThis->pszProxyHost
    642653        || RTStrCmp(pszHost, pThis->pszProxyHost))
    643654    {
     
    657668    }
    658669
     670    pThis->fReapplyProxyInfo = false;
    659671    return VINF_SUCCESS;
    660672}
Note: See TracChangeset for help on using the changeset viewer.

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