diff options
Diffstat (limited to 'runtime/shims/winhttp_offline.cpp')
| -rw-r--r-- | runtime/shims/winhttp_offline.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/shims/winhttp_offline.cpp b/runtime/shims/winhttp_offline.cpp index 284f19eb1..10854d5f2 100644 --- a/runtime/shims/winhttp_offline.cpp +++ b/runtime/shims/winhttp_offline.cpp | |||
| @@ -15,7 +15,8 @@ | |||
| 15 | // WinHttpWriteData fail with ERROR_WINHTTP_INCORRECT_HANDLE_STATE: no request ever got that far. | 15 | // WinHttpWriteData fail with ERROR_WINHTTP_INCORRECT_HANDLE_STATE: no request ever got that far. |
| 16 | // - Options, timeouts and request headers are accepted. WINHTTP_OPTION_CONTEXT_VALUE is kept per handle and | 16 | // - Options, timeouts and request headers are accepted. WINHTTP_OPTION_CONTEXT_VALUE is kept per handle and |
| 17 | // WINHTTP_OPTION_HANDLE_TYPE answered; WinHttpQueryOption reports ERROR_WINHTTP_INVALID_OPTION for the rest. | 17 | // WINHTTP_OPTION_HANDLE_TYPE answered; WinHttpQueryOption reports ERROR_WINHTTP_INVALID_OPTION for the rest. |
| 18 | // - A status callback set on a handle is inherited by the handles created under it, as in WinHTTP. | 18 | // - A status callback set on a handle is inherited by the handles created under it, as in WinHTTP, and so is |
| 19 | // the handle's WINHTTP_OPTION_CONTEXT_VALUE as it is when the child is made. | ||
| 19 | // WINHTTP_CALLBACK_STATUS_HANDLE_CREATED is reported when a child handle is made, and | 20 | // WINHTTP_CALLBACK_STATUS_HANDLE_CREATED is reported when a child handle is made, and |
| 20 | // WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING once per handle, last, after WinHttpCloseHandle and any callback still | 21 | // WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING once per handle, last, after WinHttpCloseHandle and any callback still |
| 21 | // running for it. | 22 | // running for it. |
| @@ -122,10 +123,12 @@ HINTERNET make_handle(Kind kind, Handle* parent, bool async) { | |||
| 122 | h->parent = parent; | 123 | h->parent = parent; |
| 123 | h->async = async; | 124 | h->async = async; |
| 124 | if (parent) { | 125 | if (parent) { |
| 125 | // A callback set on a handle is inherited by the handles created under it. | 126 | // A callback set on a handle is inherited by the handles created under it, and so is the context value |
| 127 | // (WINHTTP_OPTION_CONTEXT_VALUE), as the host's winhttp.dll does: what the parent has at this moment. | ||
| 126 | std::lock_guard lock(parent->mutex); | 128 | std::lock_guard lock(parent->mutex); |
| 127 | h->callback = parent->callback; | 129 | h->callback = parent->callback; |
| 128 | h->notifications = parent->notifications; | 130 | h->notifications = parent->notifications; |
| 131 | h->context = parent->context; | ||
| 129 | } | 132 | } |
| 130 | { | 133 | { |
| 131 | std::lock_guard lock(live_mutex()); | 134 | std::lock_guard lock(live_mutex()); |