1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

removes shutdown method (#27)

This commit is contained in:
Falk Werner
2019-04-26 20:51:24 +02:00
committed by GitHub
parent 9130f00289
commit 09df34debc
10 changed files with 46 additions and 81 deletions

View File

@@ -13,7 +13,6 @@
#define WF_DISABLE_LWS_LOG 0
#define WF_SERVER_PROTOCOL_COUNT 3
#define WF_SERVER_TIMEOUT (1 * 1000)
struct wf_server
{
@@ -21,7 +20,6 @@ struct wf_server
struct wf_server_protocol protocol;
struct lws_protocols ws_protocols[WF_SERVER_PROTOCOL_COUNT];
struct lws_context * context;
volatile bool shutdown_requested;
struct lws_http_mount mount;
struct lws_context_creation_info info;
};
@@ -109,7 +107,6 @@ struct wf_server * wf_impl_server_create(
if (NULL != server)
{
wf_impl_server_protocol_init(&server->protocol, config->mount_point);
server->shutdown_requested = false;
wf_impl_server_config_clone(config, &server->config);
wf_impl_authenticators_move(&server->config.authenticators, &server->protocol.authenticators);
server->context = wf_impl_server_context_create(server);
@@ -128,19 +125,9 @@ void wf_impl_server_dispose(
free(server);
}
void wf_impl_server_run(
struct wf_server * server)
void wf_impl_server_service(
struct wf_server * server,
int timeout_ms)
{
int n = 0;
while ((0 <= n) && (!server->shutdown_requested))
{
n = lws_service(server->context, WF_SERVER_TIMEOUT);
}
lws_service(server->context, timeout_ms);
}
void wf_impl_server_shutdown(
struct wf_server * server)
{
server->shutdown_requested = true;
}

View File

@@ -15,11 +15,9 @@ extern struct wf_server * wf_impl_server_create(
extern void wf_impl_server_dispose(
struct wf_server * server);
extern void wf_impl_server_run(
struct wf_server * server);
extern void wf_impl_server_shutdown(
struct wf_server * server);
extern void wf_impl_server_service(
struct wf_server * server,
int timeout_ms);
#ifdef __cplusplus
}