Skip to content

inconsistent http_listener::close #1700

@garethsb

Description

@garethsb

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

// Used to record that the listener is closed.
bool m_closed;
pplx::task<void> m_close_task;

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

http_listener_impl() : m_closed(true), m_close_task(pplx::task_from_result()) {}

However, the other constructors leave the task default initialized:

details::http_listener_impl::http_listener_impl(http::uri address) : m_uri(std::move(address)), m_closed(true)
{
check_listener_uri(m_uri);
}
details::http_listener_impl::http_listener_impl(http::uri address, http_listener_config config)
: m_uri(std::move(address)), m_config(std::move(config)), m_closed(true)
{
check_listener_uri(m_uri);
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions