VirtualBox

Changeset 74076 in vbox


Ignore:
Timestamp:
Sep 5, 2018 8:27:18 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/http: Simplified the append-to-empty-list case in rtHttpAddHeaderWorker. bugref:9167

File:
1 edited

Legend:

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

    r74071 r74076  
    20362036
    20372037        /*
    2038          * Append or prepend the header.
     2038         * Appending to an existing list requires no cURL interaction.
    20392039         */
    20402040        AssertCompile(RTHTTPADDHDR_F_FRONT != 0);
    2041         if (!(fFlags & RTHTTPADDHDR_F_FRONT))
    2042         {
    2043             bool const fDone = pThis->pHeaders != NULL;
    2044             ASMCompilerBarrier(); /* aliasing paranoia */
    2045 
     2041        if (   !(fFlags & RTHTTPADDHDR_F_FRONT)
     2042            && pThis->pHeaders != NULL)
     2043        {
    20462044            *pThis->ppHeadersTail = &pHdr->Core;
    20472045            pThis->ppHeadersTail  = &pHdr->Core.next;
    2048             if (fDone)
    2049                 return rtHttpUpdateUserAgentHeader(pThis, pHdr);
    2050 
    2051             /* Need to update curl about the new list head. */
    2052         }
    2053         else
    2054         {
    2055             pHdr->Core.next = pThis->pHeaders;
    2056             if (!pThis->pHeaders)
    2057                 pThis->ppHeadersTail = &pHdr->Core.next;
    2058         }
     2046            return rtHttpUpdateUserAgentHeader(pThis, pHdr);
     2047        }
     2048
     2049        /*
     2050         * When prepending or adding the first header we need to inform cURL
     2051         * about the new list head.
     2052         */
     2053        pHdr->Core.next = pThis->pHeaders;
     2054        if (!pThis->pHeaders)
     2055            pThis->ppHeadersTail = &pHdr->Core.next;
    20592056        pThis->pHeaders = &pHdr->Core;
    20602057
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