1
0
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:
Falk Werner
2020-04-07 20:37:50 +02:00
parent 36f2b82a67
commit 3eb5dc89a7
7 changed files with 61 additions and 5 deletions

View File

@@ -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

View File

@@ -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(

View File

@@ -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);
}
}

View File

@@ -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