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

h2: reply with selected extension

This commit is contained in:
Andy Green 2023-11-22 06:48:24 +00:00
parent 8eb89bafb1
commit 24c37d1ea1
3 changed files with 14 additions and 1 deletions

View file

@ -2777,6 +2777,17 @@ lws_h2_ws_handshake(struct lws *wsi)
}
}
#if !defined(LWS_WITHOUT_EXTENSIONS)
/*
* Figure out which extensions the client has that we want to
* enable on this connection, and give him back the list.
*
* Give him a limited write bugdet
*/
if (lws_extension_server_handshake(wsi, (char **)&p, 192))
return -1;
#endif
if (lws_finalize_http_header(wsi, &p, end))
return -1;

View file

@ -180,6 +180,8 @@ lws_ext_cb_active(struct lws *wsi, int reason, void *buf, int len);
LWS_EXTERN int
lws_ext_cb_all_exts(struct lws_context *context, struct lws *wsi, int reason,
void *arg, int len);
LWS_EXTERN int
lws_extension_server_handshake(struct lws *wsi, char **p, int budget);
#endif
int

View file

@ -27,7 +27,7 @@
#define LWS_CPYAPP(ptr, str) { strcpy(ptr, str); ptr += strlen(str); }
#if !defined(LWS_WITHOUT_EXTENSIONS)
static int
int
lws_extension_server_handshake(struct lws *wsi, char **p, int budget)
{
struct lws_context *context = wsi->a.context;