microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.91k stars 1.64k forks source link

Program hangs in CPPREST when http client socket is closed via DLL_THREAD_DETACH #1704

Open jpvollaro opened 2 years ago

jpvollaro commented 2 years ago

We are running version "2.10.12.1" of CPPREST. The Windows SDK Version is 8.1 Platform Toolset is Visual Studio 2017 (v141)

Our program connects and sends messages to a web site hosted in AWS (gpcs.3m.com)\ On Windows Server 20122 R2 OS, this program hangs. Seee attached stack trace

In the stack trace you can see that ~http_client() happens with Loader Lock (i.e. DLL_THREAD_DTEATCH) This is only an issue with Windows Server 2012 R2. We suggested to client to upgrade OS, but the client says that that OS is still supported by Microsoft.

What can we do. Is it possible to disconnect the http_client prior to a thread detach occurs?

MicrosoftTeams-image