VirtualBox

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


Ignore:
Timestamp:
Jun 29, 2020 4:14:57 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138889
Message:

IPRT/http: Consistently use CURLcode rcCurl;

File:
1 edited

Legend:

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

    r84509 r84994  
    524524    if (pThis->cMaxRedirects != cMaxRedirects)
    525525    {
    526         int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_MAXREDIRS, (long)cMaxRedirects);
     526        CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_MAXREDIRS, (long)cMaxRedirects);
    527527        AssertMsgReturn(rcCurl == CURLE_OK, ("CURLOPT_MAXREDIRS=%u: %d (%#x)\n", cMaxRedirects, rcCurl, rcCurl),
    528528                        VERR_HTTP_CURL_ERROR);
     
    578578                                   uint32_t uPort, const char *pszUsername, const char *pszPassword)
    579579{
    580     int rcCurl;
     580    CURLcode rcCurl;
    581581    AssertReturn(pszHost, VERR_INVALID_PARAMETER);
    582582    Log(("rtHttpUpdateProxyConfig: pThis=%p type=%d host='%s' port=%u user='%s'%s\n",
     
    20782078        if (pThis->fHaveSetUserAgent)
    20792079        {
    2080             int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_USERAGENT, (char *)NULL);
     2080            CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_USERAGENT, (char *)NULL);
    20812081            Assert(CURL_SUCCESS(rcCurl)); NOREF(rcCurl);
    20822082            pThis->fHaveSetUserAgent = false;
     
    21662166        pThis->pHeaders = &pHdr->Core;
    21672167
    2168         int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pThis->pHeaders);
     2168        CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pThis->pHeaders);
    21692169        if (CURL_SUCCESS(rcCurl))
    21702170            return rtHttpUpdateUserAgentHeader(pThis, pHdr);
     
    22452245    if (!pThis->pHeaders)
    22462246    {
    2247         int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pHeaders);
     2247        CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pHeaders);
    22482248        if (CURL_FAILURE(rcCurl))
    22492249        {
     
    25252525                            pThis->pHeaders = &pHdr->Core;
    25262526
    2527                             int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pThis->pHeaders);
     2527                            CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pThis->pHeaders);
    25282528                            if (CURL_SUCCESS(rcCurl))
    25292529                                return VINF_SUCCESS;
     
    27152715    if (pThis->fVerifyPeer != fVerify)
    27162716    {
    2717         int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_SSL_VERIFYPEER, (long)fVerify);
     2717        CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_SSL_VERIFYPEER, (long)fVerify);
    27182718        AssertMsgReturn(rcCurl == CURLE_OK, ("CURLOPT_SSL_VERIFYPEER=%RTbool: %d (%#x)\n", fVerify, rcCurl, rcCurl),
    27192719                        VERR_HTTP_CURL_ERROR);
     
    27402740 *                          the HTTP statuses are not translated to IPRT status codes.
    27412741 */
    2742 static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pThis, int rcCurl, uint32_t *puHttpStatus)
     2742static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pThis, CURLcode rcCurl, uint32_t *puHttpStatus)
    27432743{
    27442744    int rc = VERR_HTTP_CURL_ERROR;
     
    28912891     * The URL.
    28922892     */
    2893     int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_URL, pszUrl);
     2893    CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_URL, pszUrl);
    28942894    if (CURL_FAILURE(rcCurl))
    28952895        return VERR_INVALID_PARAMETER;
     
    33643364    {
    33653365        RT_ZERO(pThis->BodyOutput.uData.Mem);
    3366         int rcCurl = rtHttpSetWriteCallback(pThis, &rtHttpWriteBodyData, pThis);
     3366        CURLcode rcCurl = rtHttpSetWriteCallback(pThis, &rtHttpWriteBodyData, pThis);
    33673367        if (fNoBody)
    33683368        {
     
    35053505    {
    35063506        pThis->BodyOutput.uData.hFile = NIL_RTFILE;
    3507         int rcCurl = rtHttpSetWriteCallback(pThis, &rtHttpWriteDataToFile, (void *)&pThis->BodyOutput);
     3507        CURLcode rcCurl = rtHttpSetWriteCallback(pThis, &rtHttpWriteDataToFile, (void *)&pThis->BodyOutput);
    35083508        if (CURL_SUCCESS(rcCurl))
    35093509        {
     
    35883588    {
    35893589        /* Set the HTTP method. */
    3590         int rcCurl = 1;
     3590        CURLcode rcCurl = CURLE_BAD_FUNCTION_ARGUMENT;
    35913591        switch (enmMethod)
    35923592        {
     
    37543754    {
    37553755        AssertCompile(sizeof(curl_off_t) == sizeof(uint64_t));
    3756         int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_INFILESIZE_LARGE, cbContent);
     3756        CURLcode rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_INFILESIZE_LARGE, cbContent);
    37573757        AssertMsgReturn(CURL_SUCCESS(rcCurl), ("%d (%#x)\n", rcCurl, rcCurl), VERR_HTTP_CURL_ERROR);
    37583758    }
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