-
Notifications
You must be signed in to change notification settings - Fork 138
Avoid holding locks in winhttp_http_task completion callback handling when calling into websocket event functions #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid holding locks in winhttp_http_task completion callback handling when calling into websocket event functions #580
Conversation
…ividual callback type handlers to avoid holding onto lock when calling into externally provided event handlers
| HRESULT hr = HCHttpCallRequestGetUrl(pRequestContext->m_call, &method, &url); | ||
| if (SUCCEEDED(hr)) | ||
| { | ||
| win32_cs_autolock autoCriticalSection(&pRequestContext->m_lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be release prior to calling complete_task? Does that synchronously call back into client's code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it can, but XSAPI doesn't currently use this. I've updated the PR to not hold locks for complete_task.
| _In_ winhttp_http_task* pRequestContext, | ||
| _In_ void* statusInfo) | ||
| { | ||
| win32_cs_autolock autoCriticalSection(&pRequestContext->m_lock); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above
…code synchronously
…atiskan/libHttpClient into user/natiskan/callbackdeadlock
… when calling into websocket event functions (#580) * Move winhttp_http_task completion_callback lock handling into the individual callback type handlers to avoid holding onto lock when calling into externally provided event handlers * Move duplicate XAsyncComplete checking to compete_task * tabs -> spaces * don't hold lock for complete_task since it can call back into client code synchronously
Avoid holding locks in winhttp_http_task when calling into externally provided event handler functions on completion callback.