VirtualBox

Changeset 73977 in vbox


Ignore:
Timestamp:
Aug 30, 2018 12:13:02 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: More request array and map setter methods. Fixed string defaults. Safer copying and resetToDefaults. bugref:9167

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/restbase.h

    r73968 r73977  
    267267    /**
    268268     * Resets the object to all default values.
    269      */
    270     virtual void resetToDefault() = 0;
     269     * @returns IPRT status code.
     270     */
     271    virtual int resetToDefault() = 0;
    271272
    272273    /**
     
    370371    /** Copy assignment operator. */
    371372    RTCRestBool &operator=(RTCRestBool const &a_rThat);
     373    /** Safe copy assignment method. */
     374    int assignCopy(RTCRestBool const &a_rThat);
    372375
    373376    /* Overridden methods: */
    374     virtual void resetToDefault() RT_OVERRIDE;
     377    virtual int resetToDefault() RT_OVERRIDE;
    375378    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    376379    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    405408    /** Copy assignment operator. */
    406409    RTCRestInt64 &operator=(RTCRestInt64 const &a_rThat);
     410    /** Safe copy assignment method. */
     411    int assignCopy(RTCRestInt64 const &a_rThat);
    407412
    408413    /* Overridden methods: */
    409     virtual void resetToDefault() RT_OVERRIDE;
     414    virtual int resetToDefault() RT_OVERRIDE;
    410415    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    411416    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    440445    /** Copy assignment operator. */
    441446    RTCRestInt32 &operator=(RTCRestInt32 const &a_rThat);
     447    /** Safe copy assignment method. */
     448    int assignCopy(RTCRestInt32 const &a_rThat);
    442449
    443450    /* Overridden methods: */
    444     virtual void resetToDefault() RT_OVERRIDE;
     451    virtual int resetToDefault() RT_OVERRIDE;
    445452    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    446453    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    475482    /** Copy assignment operator. */
    476483    RTCRestInt16 &operator=(RTCRestInt16 const &a_rThat);
     484    /** Safe copy assignment method. */
     485    int assignCopy(RTCRestInt16 const &a_rThat);
    477486
    478487    /* Overridden methods: */
    479     virtual void resetToDefault() RT_OVERRIDE;
     488    virtual int resetToDefault() RT_OVERRIDE;
    480489    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    481490    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    510519    /** Copy assignment operator. */
    511520    RTCRestDouble &operator=(RTCRestDouble const &a_rThat);
     521    /** Safe copy assignment method. */
     522    int assignCopy(RTCRestDouble const &a_rThat);
    512523
    513524    /* Overridden methods: */
    514     virtual void resetToDefault() RT_OVERRIDE;
     525    virtual int resetToDefault() RT_OVERRIDE;
    515526    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    516527    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    537548    /** Default destructor. */
    538549    RTCRestString();
     550    /** Destructor. */
     551    virtual ~RTCRestString();
     552
    539553    /** Copy constructor. */
    540554    RTCRestString(RTCRestString const &a_rThat);
     
    543557    /** From value constructor. */
    544558    RTCRestString(const char *a_pszSrc);
    545     /** Destructor. */
    546     virtual ~RTCRestString();
     559    /** Safe copy assignment method. */
     560    int assignCopy(RTCString const &a_rThat);
     561    /** Safe copy assignment method. */
     562    int assignCopy(const char *a_pszThat);
    547563
    548564    /* Overridden methods: */
    549     virtual void resetToDefault() RT_OVERRIDE;
     565    virtual int resetToDefault() RT_OVERRIDE;
    550566    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    551567    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    572588
    573589    /* Overridden methods: */
    574     virtual void resetToDefault() RT_OVERRIDE;
     590    virtual int resetToDefault() RT_OVERRIDE;
    575591    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    576592    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    718734    }
    719735
     736    /** Safe copy assignment method. */
     737    int assignCopy(RTCRestArray const &a_rThat)
     738    {
     739        return copyArrayWorker(a_rThat, false /*fThrow*/);
     740    }
     741
    720742    virtual const char *getType(void) RT_OVERRIDE
    721743    {
     
    759781    int insertCopy(size_t a_idx, ElementType const &a_rThat)
    760782    {
    761         return insertCopyWorker(a_idx, &a_rThat, false /*a_fReplace*/);
     783        return insertCopyWorker(a_idx, a_rThat, false /*a_fReplace*/);
    762784    }
    763785
     
    783805    int appendCopy(ElementType const &a_rThat)
    784806    {
    785         return insertCopyWorker(~(size_t)0, &a_rThat, false /*a_fReplace*/);
     807        return insertCopyWorker(~(size_t)0, a_rThat, false /*a_fReplace*/);
    786808    }
    787809
     
    807829    int prependCopy(ElementType const &a_rThat)
    808830    {
    809         return insertCopyWorker(0, &a_rThat, false /*a_fReplace*/);
     831        return insertCopyWorker(0, a_rThat, false /*a_fReplace*/);
    810832    }
    811833
     
    833855    int replaceCopy(size_t a_idx, ElementType const &a_rThat)
    834856    {
    835         return insertCopyWorker(a_idx, &a_rThat, true /*a_fReplace*/);
     857        return insertCopyWorker(a_idx, a_rThat, true /*a_fReplace*/);
    836858    }
    837859
     
    907929    virtual RTCRestObjectBase *createValueCopy(RTCRestObjectBase const *a_pSrc) RT_OVERRIDE
    908930    {
    909         return new (std::nothrow) ElementType(*(ElementType const *)a_pSrc);
     931        ElementType *pCopy = new (std::nothrow) ElementType();
     932        if (pCopy)
     933        {
     934            int rc = pCopy->assignCopy(*(ElementType const *)a_pSrc);
     935            if (RT_SUCCESS(rc))
     936                return pCopy;
     937            delete pCopy;
     938        }
     939        return NULL;
    910940    }
    911941};
     
    928958
    929959    /* Overridden methods: */
    930     virtual void resetToDefault() RT_OVERRIDE;
     960    virtual int resetToDefault() RT_OVERRIDE;
    931961    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    932962    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    10981128    }
    10991129
     1130    /** Safe copy assignment method. */
     1131    int assignCopy(RTCRestStringMap const &a_rThat)
     1132    {
     1133        return copyMapWorker(a_rThat, false /*a_fThrow*/);
     1134    }
     1135
    11001136    virtual const char *getType(void) RT_OVERRIDE
    11011137    {
     
    12251261    virtual RTCRestObjectBase *createValueCopy(RTCRestObjectBase const *a_pSrc) RT_OVERRIDE
    12261262    {
    1227         return new (std::nothrow) ValueType(*(ValueType const *)a_pSrc);
     1263        ValueType *pCopy = new (std::nothrow) ValueType();
     1264        if (pCopy)
     1265        {
     1266            int rc = pCopy->assignCopy(*(ValueType const *)a_pSrc);
     1267            if (RT_SUCCESS(rc))
     1268                return pCopy;
     1269            delete pCopy;
     1270        }
     1271        return NULL;
    12281272    }
    12291273};
     
    12411285    /** Default destructor. */
    12421286    RTCRestObject();
    1243     /** Copy constructor. */
    1244     RTCRestObject(RTCRestBool const &a_rThat);
    12451287    /** Destructor. */
    12461288    virtual ~RTCRestObject();
     1289
     1290    /** Copy constructor. */
     1291    RTCRestObject(RTCRestObject const &a_rThat);
    12471292    /** Copy assignment operator. */
    1248     RTCRestBool &operator=(RTCRestObject const &a_rThat);
     1293    RTCRestObject &operator=(RTCRestObject const &a_rThat);
     1294    /** Safe Safe copy assignment method. */
     1295    int assignCopy(RTCRestObject const &a_rThat);
    12491296
    12501297    /* Overridden methods: */
    1251     virtual void resetToDefault() RT_OVERRIDE;
     1298    virtual int resetToDefault() RT_OVERRIDE;
    12521299    virtual RTCRestOutputBase &serializeAsJson(RTCRestOutputBase &a_rDst) const RT_OVERRIDE;
    12531300    virtual int deserializeFromJson(RTCRestJsonCursor const &a_rCursor) RT_OVERRIDE;
     
    12731320    RTCRestClientRequestBase();
    12741321    virtual ~RTCRestClientRequestBase();
     1322    RTCRestClientRequestBase(RTCRestClientRequestBase const &a_rThat);
     1323    RTCRestClientRequestBase &operator=(RTCRestClientRequestBase const &a_rThat);
    12751324
    12761325    /**
    12771326     * Reset all members to default values.
    1278      */
    1279     virtual void resetToDefault() = 0;
     1327     * @returns IPRT status code.
     1328     */
     1329    virtual int resetToDefault() = 0;
    12801330
    12811331    /**
     
    12981348    virtual void xmitComplete(int a_rcStatus, RTHTTP a_hHttp) const = 0;
    12991349
     1350    /**
     1351     * Checks if there are were any assignment errors.
     1352     */
     1353    bool hasAssignmentErrors() const { return m_fErrorSet != 0; }
     1354
    13001355protected:
     1356    /** Set of fields that have been explicitly assigned a value. */
     1357    uint64_t m_fIsSet;
     1358    /** Set of fields where value assigning failed. */
     1359    uint64_t m_fErrorSet;
     1360
    13011361    /** Path replacement entry. */
    13021362    typedef struct
     
    15911651     * @param   a_enmHttpMethod The HTTP request method.
    15921652     * @param   a_pResponse     Pointer to the response object.
     1653     * @param   a_pszMethod     The method name, for logging purposes.
    15931654     */
    15941655    virtual void doCall(RTCRestClientRequestBase const &a_rRequest, RTHTTPMETHOD a_enmHttpMethod,
    1595                         RTCRestClientResponseBase *a_pResponse);
     1656                        RTCRestClientResponseBase *a_pResponse, const char *a_pszMethod);
    15961657
    15971658};
  • trunk/include/iprt/http.h

    r73967 r73977  
    210210
    211211/**
     212 * Returns the name of the HTTP method.
     213 * @returns Read only string.
     214 * @param   enmMethod       The HTTP method to name.
     215 */
     216RTR3DECL(const char *) RTHttpMethodName(RTHTTPMETHOD enmMethod);
     217
     218/**
    212219 * Performs generic blocking HTTP request, optionally returning the body and headers.
    213220 *
  • trunk/include/iprt/log.h

    r72426 r73977  
    6161    RTLOGGROUP_HTTP,
    6262    RTLOGGROUP_LDR,
     63    RTLOGGROUP_LOCALIPC,
    6364    RTLOGGROUP_PATH,
    6465    RTLOGGROUP_PROCESS,
     66    RTLOGGROUP_REST,
    6567    RTLOGGROUP_SYMLINK,
    6668    RTLOGGROUP_THREAD,
    6769    RTLOGGROUP_TIME,
    6870    RTLOGGROUP_TIMER,
    69     RTLOGGROUP_LOCALIPC,
    7071    RTLOGGROUP_VFS,
    7172    RTLOGGROUP_ZIP = 31,
     
    8788 */
    8889#define RT_LOGGROUP_NAMES \
    89     "DEFAULT",      \
    90     "RT_CRYPTO",    \
    91     "RT_DBG",       \
     90    "DEFAULT", \
     91    "RT_CRYPTO", \
     92    "RT_DBG", \
    9293    "RT_DBG_DWARF", \
    93     "RT_DIR",       \
    94     "RT_FILE",      \
    95     "RT_FS",        \
     94    "RT_DIR", \
     95    "RT_FILE", \
     96    "RT_FS", \
    9697    "RT_HTTP", \
    97     "RT_LDR",       \
    98     "RT_PATH",      \
    99     "RT_PROCESS",   \
    100     "RT_SYMLINK",   \
    101     "RT_THREAD",    \
    102     "RT_TIME",      \
    103     "RT_TIMER",     \
     98    "RT_LDR", \
    10499    "RT_LOCALIPC", \
     100    "RT_PATH", \
     101    "RT_PROCESS", \
     102    "RT_REST", \
     103    "RT_SYMLINK", \
     104    "RT_THREAD", \
     105    "RT_TIME", \
     106    "RT_TIMER", \
    105107    "RT_VFS", \
    106     "RT_17", \
    107108    "RT_18", \
    108109    "RT_19", \
     
    129130
    130131/** @def LOG_FN_FMT
    131  * You can use this to specify you desired way of printing __PRETTY_FUNCTION__
     132 * You can use this to specify your desired way of printing __PRETTY_FUNCTION__
    132133 * if you dislike the default one.
    133134 */
  • trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp

    r73968 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
     
    8384*********************************************************************************************************************************/
    8485
    85 void RTCRestArrayBase::resetToDefault()
     86int RTCRestArrayBase::resetToDefault()
    8687{
    8788    /* The default state of an array is empty. At least for now. */
    8889    clear();
     90    return VINF_SUCCESS;
    8991}
    9092
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBase.cpp

    r73967 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
    3334#include <iprt/err.h>
    3435#include <iprt/http.h>
     36#include <iprt/log.h>
    3537
    3638
     
    6264
    6365void RTCRestClientApiBase::doCall(RTCRestClientRequestBase const &a_rRequest, RTHTTPMETHOD a_enmHttpMethod,
    64                                   RTCRestClientResponseBase *a_pResponse)
     66                                  RTCRestClientResponseBase *a_pResponse, const char *a_pszMethod)
    6567{
     68    LogFlow(("doCall: %s %s\n", a_pszMethod, RTHttpMethodName(a_enmHttpMethod)));
     69
    6670    /*
    6771     * Initialize the HTTP instance.
     
    155159    }
    156160    a_pResponse->receiveComplete(rc, hHttp);
     161    RT_NOREF_PV(a_pszMethod);
    157162}
    158163
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp

    r73918 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
     
    3738/**
    3839 * Default constructor.
    39  *  */
     40 */
    4041RTCRestClientRequestBase::RTCRestClientRequestBase()
     42    : m_fIsSet(0)
     43    , m_fErrorSet(0)
    4144{
    42     /* nothing to do */
     45}
     46
     47
     48/**
     49 * Copy constructor.
     50 */
     51RTCRestClientRequestBase::RTCRestClientRequestBase(RTCRestClientRequestBase const &a_rThat)
     52    : m_fIsSet(a_rThat.m_fIsSet)
     53    , m_fErrorSet(a_rThat.m_fErrorSet)
     54{
    4355}
    4456
     
    5062{
    5163    /* nothing to do */
     64}
     65
     66
     67/**
     68 * Copy assignment operator.
     69 */
     70RTCRestClientRequestBase &RTCRestClientRequestBase::operator=(RTCRestClientRequestBase const &a_rThat)
     71{
     72    m_fIsSet    = a_rThat.m_fIsSet;
     73    m_fErrorSet = a_rThat.m_fErrorSet;
     74    return *this;
    5275}
    5376
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientResponseBase.cpp

    r73968 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
  • trunk/src/VBox/Runtime/common/rest/RTCRestJsonPrimaryCursor.cpp

    r73875 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
  • trunk/src/VBox/Runtime/common/rest/RTCRestOutputToString.cpp

    r73956 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
  • trunk/src/VBox/Runtime/common/rest/RTCRestStringMapBase.cpp

    r73965 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
     
    7273*********************************************************************************************************************************/
    7374
    74 void RTCRestStringMapBase::resetToDefault()
     75int RTCRestStringMapBase::resetToDefault()
    7576{
    7677    /* Default is an empty map. */
    7778    clear();
     79    return VINF_SUCCESS;
    7880}
    7981
  • trunk/src/VBox/Runtime/common/rest/rest-primary-object-types.cpp

    r73956 r73977  
    2929*   Header Files                                                                                                                 *
    3030*********************************************************************************************************************************/
     31#define LOG_GROUP RTLOGGROUP_REST
    3132#include <iprt/cpp/restbase.h>
    3233
     
    143144
    144145
    145 void RTCRestBool::resetToDefault()
     146int RTCRestBool::assignCopy(RTCRestBool const &a_rThat)
     147{
     148    m_fValue = a_rThat.m_fValue;
     149    return VINF_SUCCESS;
     150}
     151
     152
     153int RTCRestBool::resetToDefault()
    146154{
    147155    m_fValue = false;
     156    return VINF_SUCCESS;
    148157}
    149158
     
    265274
    266275
    267 void RTCRestInt64::resetToDefault()
     276int RTCRestInt64::assignCopy(RTCRestInt64 const &a_rThat)
     277{
     278    m_iValue = a_rThat.m_iValue;
     279    return VINF_SUCCESS;
     280}
     281
     282
     283int RTCRestInt64::resetToDefault()
    268284{
    269285    m_iValue = 0;
     286    return VINF_SUCCESS;
    270287}
    271288
     
    375392
    376393
    377 void RTCRestInt32::resetToDefault()
     394int RTCRestInt32::assignCopy(RTCRestInt32 const &a_rThat)
     395{
     396    m_iValue = a_rThat.m_iValue;
     397    return VINF_SUCCESS;
     398}
     399
     400
     401int RTCRestInt32::resetToDefault()
    378402{
    379403    m_iValue = 0;
     404    return VINF_SUCCESS;
    380405}
    381406
     
    491516
    492517
    493 void RTCRestInt16::resetToDefault()
     518int RTCRestInt16::assignCopy(RTCRestInt16 const &a_rThat)
     519{
     520    m_iValue = a_rThat.m_iValue;
     521    return VINF_SUCCESS;
     522}
     523
     524
     525int RTCRestInt16::resetToDefault()
    494526{
    495527    m_iValue = 0;
     528    return VINF_SUCCESS;
    496529}
    497530
     
    598631
    599632
    600 void RTCRestDouble::resetToDefault()
     633/** Copy assignment operator. */
     634RTCRestDouble &RTCRestDouble::operator=(RTCRestDouble const &a_rThat)
     635{
     636    m_rdValue = a_rThat.m_rdValue;
     637    return *this;
     638}
     639
     640
     641int RTCRestDouble::assignCopy(RTCRestDouble const &a_rThat)
     642{
     643    m_rdValue = a_rThat.m_rdValue;
     644    return VINF_SUCCESS;
     645}
     646
     647
     648int RTCRestDouble::resetToDefault()
    601649{
    602650    m_rdValue = 0.0;
     651    return VINF_SUCCESS;
    603652}
    604653
     
    715764
    716765
    717 void RTCRestString::resetToDefault()
     766int RTCRestString::assignCopy(RTCString const &a_rThat)
     767{
     768    return assignNoThrow(a_rThat);
     769}
     770
     771
     772int RTCRestString::assignCopy(const char *a_pszThat)
     773{
     774    return assignNoThrow(a_pszThat);
     775}
     776
     777
     778int RTCRestString::resetToDefault()
    718779{
    719780    setNull();
     781    return VINF_SUCCESS;
    720782}
    721783
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r73967 r73977  
    22/** @file
    33 * IPRT - HTTP client API, cURL based.
     4 *
     5 * Logging groups:
     6 *      Log4 - request headers.
     7 *      Log5 - request body.
     8 *      Log6 - response headers.
     9 *      Log7 - response body.
    410 */
    511
     
    28742880    AssertPtrReturn(pszUrl, VERR_INVALID_POINTER);
    28752881
     2882#ifdef LOG_ENABLED
     2883    if (LogIs6Enabled() && pThis->pHeaders)
     2884    {
     2885        Log4(("RTHttpPerform: headers:\n"));
     2886        for (struct curl_slist const *pCur = pThis->pHeaders; pCur; pCur = pCur->next)
     2887            Log4(("%s", pCur->data));
     2888    }
     2889    if (pvReqBody && cbReqBody)
     2890        Log5(("RTHttpPerform: request body:\n%.*Rhxd\n", cbReqBody, pvReqBody));
     2891#endif
     2892
    28762893    /*
    28772894     * Set the busy flag (paranoia).
     
    28872904    if (RT_SUCCESS(rc))
    28882905    {
    2889 
    2890         /* HTTP method. */
     2906        /* Set the HTTP method. */
    28912907        int rcCurl = 1;
    28922908        switch (enmMethod)
     
    29702986                if (ppvHeaders)
    29712987                {
     2988                    Log(("RTHttpPerform: headers: %zx bytes (allocated %zx)\n",
     2989                         pThis->HeadersOutput.uData.Mem.cb, pThis->HeadersOutput.uData.Mem.cbAllocated));
     2990                    Log6(("RTHttpPerform: headers blob:\n%.*Rhxd\n", pThis->HeadersOutput.uData.Mem.cb, pThis->HeadersOutput.uData.Mem.pb));
    29722991                    *ppvHeaders = pThis->HeadersOutput.uData.Mem.pb;
    29732992                    *pcbHeaders = pThis->HeadersOutput.uData.Mem.cb;
    29742993                    pThis->HeadersOutput.uData.Mem.pb = NULL;
    2975                     Log(("RTHttpPerform: headers: %zx bytes (allocated %zx)\n",
    2976                          pThis->HeadersOutput.uData.Mem.cb, pThis->HeadersOutput.uData.Mem.cbAllocated));
    29772994                }
    29782995                if (ppvBody)
    29792996                {
     2997                    Log(("RTHttpPerform: body: %zx bytes (allocated %zx)\n",
     2998                         pThis->BodyOutput.uData.Mem.cb, pThis->BodyOutput.uData.Mem.cbAllocated));
     2999                    Log7(("RTHttpPerform: body blob:\n%.*Rhxd\n", pThis->BodyOutput.uData.Mem.cb, pThis->BodyOutput.uData.Mem.pb));
    29803000                    *ppvBody = pThis->BodyOutput.uData.Mem.pb;
    29813001                    *pcbBody = pThis->BodyOutput.uData.Mem.cb;
    29823002                    pThis->BodyOutput.uData.Mem.pb = NULL;
    2983                     Log(("RTHttpPerform: body: %zx bytes (allocated %zx)\n",
    2984                          pThis->HeadersOutput.uData.Mem.cb, pThis->HeadersOutput.uData.Mem.cbAllocated));
    29853003                }
    29863004            }
     
    30043022
    30053023
     3024RTR3DECL(const char *) RTHttpMethodName(RTHTTPMETHOD enmMethod)
     3025{
     3026    switch (enmMethod)
     3027    {
     3028        case RTHTTPMETHOD_INVALID:  return "invalid";
     3029        case RTHTTPMETHOD_GET:      return "GET";
     3030        case RTHTTPMETHOD_PUT:      return "PUT";
     3031        case RTHTTPMETHOD_POST:     return "POST";
     3032        case RTHTTPMETHOD_PATCH:    return "PATCH";
     3033        case RTHTTPMETHOD_DELETE:   return "DELETE";
     3034        case RTHTTPMETHOD_HEAD:     return "HEAD";
     3035        case RTHTTPMETHOD_OPTIONS:  return "OPTIONS";
     3036        case RTHTTPMETHOD_TRACE:    return "TRACE";
     3037
     3038        case RTHTTPMETHOD_END:
     3039        case RTHTTPMETHOD_32BIT_HACK:
     3040            break;
     3041    }
     3042    return "unknown";
     3043}
     3044
     3045
    30063046/*********************************************************************************************************************************
    30073047*   Callback APIs.                                                                                                               *
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