1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/webfuse_provider/impl/message.c

24 lines
485 B
C
Raw Normal View History

2020-06-16 21:39:45 +00:00
#include "webfuse_provider/impl/message.h"
2019-03-26 22:04:53 +00:00
#include <stdlib.h>
#include <libwebsockets.h>
extern struct wfp_message * wfp_message_create(
char * data,
size_t length)
2019-03-26 22:04:53 +00:00
{
struct wfp_message * message = malloc(sizeof(struct wfp_message));
message->data = data;
2020-06-25 20:08:48 +00:00
message->length = length;
message->raw_data = data - LWS_PRE;
2019-03-26 22:04:53 +00:00
return message;
}
void wfp_message_dispose(
struct wfp_message * message)
2019-03-26 22:04:53 +00:00
{
2020-07-09 20:12:13 +00:00
free(message->raw_data);
2019-03-26 22:04:53 +00:00
free(message);
}