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

removed unused code

This commit is contained in:
Falk Werner
2020-06-25 22:08:48 +02:00
parent e465265f3a
commit 3ca4d89fa7
4 changed files with 108 additions and 35 deletions

View File

@@ -31,11 +31,8 @@ static void wfp_impl_client_protocol_respond(
struct wfp_client_protocol * protocol = (struct wfp_client_protocol *) user_data;
struct wfp_message * message = wfp_message_create(response);
if (NULL != message)
{
wfp_slist_append(&protocol->messages, &message->item);
lws_callback_on_writable(protocol->wsi);
}
wfp_slist_append(&protocol->messages, &message->item);
lws_callback_on_writable(protocol->wsi);
}
static void wfp_impl_client_protocol_process(
@@ -223,18 +220,13 @@ static bool wfp_impl_client_protocol_send(
json_t * request,
void * user_data)
{
bool result = false;
struct wfp_client_protocol * protocol = user_data;
struct wfp_message * message = wfp_message_create(request);
if (NULL != message)
{
wfp_slist_append(&protocol->messages, &message->item);
lws_callback_on_writable(protocol->wsi);
result = true;
}
wfp_slist_append(&protocol->messages, &message->item);
lws_callback_on_writable(protocol->wsi);
return result;
return true;
}
void wfp_impl_client_protocol_init(

View File

@@ -5,18 +5,14 @@
extern struct wfp_message * wfp_message_create(json_t const * value)
{
struct wfp_message * message = NULL;
size_t const length = json_dumpb(value, NULL, 0, JSON_COMPACT);
if (0 < length)
{
char * data = malloc(sizeof(struct wfp_message) + LWS_PRE + length);
message = (struct wfp_message *) data;
message->data = &data[sizeof(struct wfp_message) + LWS_PRE];
message->length = length;
char * data = malloc(sizeof(struct wfp_message) + LWS_PRE + length);
struct wfp_message * message = (struct wfp_message *) data;
message->data = &data[sizeof(struct wfp_message) + LWS_PRE];
message->length = length;
json_dumpb(value, message->data, length, JSON_COMPACT);
}
json_dumpb(value, message->data, length, JSON_COMPACT);
return message;
}