cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

inconsistent http_listener::close

Open garethsb opened this issue 3 years ago • 0 comments

The different constructors for web::http::experimental::listener::details::http_listener_impl initialize the m_close_task differently.

https://github.com/microsoft/cpprestsdk/blob/07cf589108f50ee40e56c56dc43bfab1022604e0/Release/include/cpprest/http_listener.h#L203-L205

The default constructor that is visible to SDK users since it is inline in the header initializes it like so:

https://github.com/microsoft/cpprestsdk/blob/07cf589108f50ee40e56c56dc43bfab1022604e0/Release/include/cpprest/http_listener.h#L170

However, the other constructors leave the task default initialized:

https://github.com/microsoft/cpprestsdk/blob/07cf589108f50ee40e56c56dc43bfab1022604e0/Release/src/http/listener/http_listener.cpp#L57-L66

A default constructed task behaves quite differently, so this seems like an oversight.

garethsb avatar May 05 '22 08:05 garethsb