VirtualBox

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


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

IPRT/http: Provide curl with an error buffer (fixed size array in
RTHTTPINTERNAL) where it can write error details that are otherwise
all hidden behind a single CURLcode.

File:
1 edited

Legend:

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

    r84995 r85000  
    268268    /** @} */
    269269
     270    /** Buffer for human readable error messages from curl on failures or problems. */
     271    char szErrorBuffer[CURL_ERROR_SIZE];
    270272} RTHTTPINTERNAL;
    271273/** Pointer to an internal HTTP client instance. */
     
    398400                pThis->offUploadContent         = 0;
    399401
     402                /* ask curl to give us back error messages */
     403                curl_easy_setopt(pThis->pCurl, CURLOPT_ERRORBUFFER, pThis->szErrorBuffer);
    400404
    401405                *phHttp = (RTHTTP)pThis;
     
    28412845                break;
    28422846        }
    2843         Log(("rtHttpGetCalcStatus: rc=%Rrc rcCurl=%u\n", rc, rcCurl));
     2847        Log(("%s: %Rrc: %u = %s%s%.*s\n",
     2848             __FUNCTION__,
     2849             rc, rcCurl, curl_easy_strerror((CURLcode)rcCurl),
     2850             pThis->szErrorBuffer[0] != '\0' ? ": " : "",
     2851             (int) sizeof(pThis->szErrorBuffer),
     2852             pThis->szErrorBuffer[0] != '\0' ? pThis->szErrorBuffer : ""));
    28442853    }
    28452854
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