Changeset 74071 in vbox
- Timestamp:
- Sep 4, 2018 3:32:56 PM (6 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/http-curl.cpp
r74070 r74071 2041 2041 if (!(fFlags & RTHTTPADDHDR_F_FRONT)) 2042 2042 { 2043 bool const fDone = pThis->pHeaders != NULL; 2044 ASMCompilerBarrier(); /* aliasing paranoia */ 2045 2043 2046 *pThis->ppHeadersTail = &pHdr->Core; 2044 2047 pThis->ppHeadersTail = &pHdr->Core.next; 2045 if ( pThis->pHeaders != NULL)2048 if (fDone) 2046 2049 return rtHttpUpdateUserAgentHeader(pThis, pHdr); 2047 2050 … … 2052 2055 pHdr->Core.next = pThis->pHeaders; 2053 2056 if (!pThis->pHeaders) 2054 pThis->ppHeadersTail 2057 pThis->ppHeadersTail = &pHdr->Core.next; 2055 2058 } 2056 2059 pThis->pHeaders = &pHdr->Core; -
trunk/src/VBox/Runtime/tools/RTHttp.cpp
r73334 r74071 32 32 33 33 #include <iprt/assert.h> 34 #include <iprt/ctype.h> 34 35 #include <iprt/err.h> 35 36 #include <iprt/getopt.h> … … 68 69 { "--quiet", 'q', RTGETOPT_REQ_NOTHING }, 69 70 { "--verbose", 'v', RTGETOPT_REQ_NOTHING }, 71 { "--set-header", 's', RTGETOPT_REQ_STRING }, 70 72 }; 71 73 … … 111 113 RTPrintf("$Revision$\n"); 112 114 return RTEXITCODE_SUCCESS; 115 116 case 's': 117 { 118 char *pszColon = (char *)strchr(ValueUnion.psz, ':'); 119 if (!pszColon) 120 return RTMsgErrorExit(RTEXITCODE_FAILURE, "No colon in --set-header value: %s", ValueUnion.psz); 121 *pszColon = '\0'; /* evil */ 122 const char *pszValue = pszColon + 1; 123 if (RT_C_IS_BLANK(*pszValue)) 124 pszValue++; 125 int rc = RTHttpAddHeader(hHttp, ValueUnion.psz, pszValue, RTSTR_MAX, RTHTTPADDHDR_F_BACK); 126 *pszColon = ':'; 127 if (RT_FAILURE(rc)) 128 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTHttpAddHeader failed: %Rrc (on %s)", rc, ValueUnion.psz); 129 break; 130 } 113 131 114 132 case VINF_GETOPT_NOT_OPTION:
Note:
See TracChangeset
for help on using the changeset viewer.