mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
added implementation of wfp_client_disconnect
This commit is contained in:
@@ -202,6 +202,12 @@ void wfp_client_protocol_connect(
|
||||
wfp_impl_client_protocol_connect(protocol, context, url);
|
||||
}
|
||||
|
||||
void wfp_client_protocol_disconnect(
|
||||
struct wfp_client_protocol * protocol)
|
||||
{
|
||||
wfp_impl_client_protocol_disconnect(protocol);
|
||||
}
|
||||
|
||||
|
||||
// client
|
||||
|
||||
|
||||
@@ -79,9 +79,7 @@ void wfp_impl_client_connect(
|
||||
void wfp_impl_client_disconnect(
|
||||
struct wfp_client * client)
|
||||
{
|
||||
(void) client;
|
||||
|
||||
// ToDo: implement me
|
||||
wfp_impl_client_protocol_disconnect(&client->protocol);
|
||||
}
|
||||
|
||||
bool wfp_impl_client_is_connected(
|
||||
|
||||
@@ -324,3 +324,17 @@ void wfp_impl_client_protocol_connect(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void wfp_impl_client_protocol_disconnect(
|
||||
struct wfp_client_protocol * protocol)
|
||||
{
|
||||
if (protocol->is_connected)
|
||||
{
|
||||
protocol->is_shutdown_requested = true;
|
||||
lws_callback_on_writable(protocol->wsi);
|
||||
}
|
||||
else
|
||||
{
|
||||
protocol->provider.disconnected(protocol->user_data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,9 @@ extern void wfp_impl_client_protocol_connect(
|
||||
struct lws_context * context,
|
||||
char const * url);
|
||||
|
||||
extern void wfp_impl_client_protocol_disconnect(
|
||||
struct wfp_client_protocol * protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user