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:
parent
32ec9d0299
commit
377188189a
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue