1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Adding header table free function to make sure we free cleanly everywhere.

This commit is contained in:
Andrew Canaday 2014-11-07 11:20:59 +08:00 committed by Andy Green
parent 32ec9d0299
commit 377188189a
2 changed files with 12 additions and 0 deletions

View file

@ -73,6 +73,15 @@ int lws_allocate_header_table(struct libwebsocket *wsi)
return 0;
}
int lws_free_header_table(struct libwebsocket *wsi)
{
if (wsi->u.hdr.ah) {
free(wsi->u.hdr.ah);
wsi->u.hdr.ah = NULL;
}
return 0;
};
LWS_VISIBLE int lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h)
{
int n;

View file

@ -1013,6 +1013,9 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd);
LWS_EXTERN int
lws_allocate_header_table(struct libwebsocket *wsi);
LWS_EXTERN int
lws_free_header_table(struct libwebsocket *wsi);
LWS_EXTERN char *
lws_hdr_simple_ptr(struct libwebsocket *wsi, enum lws_token_indexes h);