Changeset 74250 in vbox for trunk/src/VBox/Runtime/generic/http-curl.cpp
- Timestamp:
- Sep 13, 2018 4:33:17 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/http-curl.cpp
r74222 r74250 3041 3041 if (pThis->pfnHeaderCallback) 3042 3042 { 3043 /* Find the end of the field name first. Since cURL gives us the3044 "HTTP/{version} {code} {status}" line too, we slap a fictitious3045 field name ':http-status-line' in front of it.*/3043 /* 3044 * Find the end of the field name first. 3045 */ 3046 3046 uint32_t uMatchWord; 3047 3047 size_t cchField; … … 3063 3063 cchValue = cbToAppend - cchField - 1; 3064 3064 } 3065 else if (pchBuf[0] == 'H' && pchBuf[1] == 'T' && pchBuf[2] == 'T' && pchBuf[1] == 'P') 3065 /* Since cURL gives us the "HTTP/{version} {code} {status}" line too, 3066 we slap a fictitious field name ':http-status-line' in front of it. */ 3067 else if (cbToAppend > 5 && pchBuf[0] == 'H' && pchBuf[1] == 'T' && pchBuf[2] == 'T' && pchBuf[3] == 'P' && pchBuf[4] == '/') 3066 3068 { 3067 3069 pchField = ":http-status-line"; … … 3071 3073 cchValue = cbToAppend; 3072 3074 } 3075 /* cURL also gives us the empty line before the body, so we slap another 3076 fictitious field name ':end-of-headers' in front of it as well. */ 3077 else if (cbToAppend == 2 && pchBuf[0] == '\r' && pchBuf[1] == '\n') 3078 { 3079 pchField = ":end-of-headers"; 3080 cchField = 15; 3081 uMatchWord = RTHTTP_MAKE_HDR_MATCH_WORD(15, ':', 'e', 'n'); 3082 pchValue = pchBuf; 3083 cchValue = cbToAppend; 3084 } 3073 3085 else 3074 3086 AssertMsgFailedReturn(("pchBuf=%.*s\n", cbToAppend, pchBuf), cbToAppend); 3075 3087 3076 /* Determin the field value, stripping one leading blank and all 3077 trailing spaces. */ 3088 /* 3089 * Determin the field value, stripping one leading blank and all 3090 * trailing spaces. 3091 */ 3078 3092 if (cchValue > 0 && RT_C_IS_BLANK(*pchValue)) 3079 3093 pchValue++, cchValue--; … … 3081 3095 cchValue--; 3082 3096 3083 /* Pass it to the callback. */ 3097 /* 3098 * Pass it to the callback. 3099 */ 3100 Log6(("rtHttpWriteHeaderData: %.*s: %.*s\n", cchField, pchBuf, cchValue, pchValue)); 3084 3101 int rc = pThis->pfnHeaderCallback(pThis, uMatchWord, pchBuf, cchField, 3085 3102 pchValue, cchValue, pThis->pvHeaderCallbackUser); … … 3087 3104 return cbToAppend; 3088 3105 3106 /* Abort on error. */ 3089 3107 if (RT_SUCCESS(pThis->rcOutput)) 3090 3108 pThis->rcOutput = rc; … … 3547 3565 3548 3566 /* Headers. */ 3549 if ( ppvHeaders &&CURL_SUCCESS(rcCurl))3567 if (CURL_SUCCESS(rcCurl)) 3550 3568 { 3551 3569 RT_ZERO(pThis->HeadersOutput.uData.Mem);
Note:
See TracChangeset
for help on using the changeset viewer.