File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ class http_listener_impl
139
139
140
140
http_listener_impl ()
141
141
: m_closed(true )
142
+ , m_close_task(pplx::task_from_result())
142
143
{
143
144
}
144
145
@@ -176,6 +177,7 @@ class http_listener_impl
176
177
177
178
// Used to record that the listener is closed.
178
179
bool m_closed;
180
+ pplx::task<void > m_close_task;
179
181
};
180
182
181
183
} // namespace details
@@ -315,4 +317,4 @@ class http_listener
315
317
} // namespace http
316
318
} // namespace web
317
319
318
- #endif /* _CASA_HTTP_LISTENER_H */
320
+ #endif /* _CASA_HTTP_LISTENER_H */
Original file line number Diff line number Diff line change @@ -131,10 +131,12 @@ pplx::task<void> details::http_listener_impl::close()
131
131
{
132
132
// Do nothing if the close operation was already attempted
133
133
// Not thread safe.
134
- if (m_closed) return pplx::task_from_result ();
134
+ // Note: Return the previous close task
135
+ if (m_closed) return m_close_task;
135
136
136
137
m_closed = true ;
137
- return web::http::experimental::details::http_server_api::unregister_listener (this );
138
+ m_close_task = web::http::experimental::details::http_server_api::unregister_listener (this );
139
+ return m_close_task;
138
140
}
139
141
140
142
void details::http_listener_impl::handle_request (http_request msg)
You can’t perform that action at this time.
0 commit comments