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:
parent
8eb89bafb1
commit
24c37d1ea1
3 changed files with 14 additions and 1 deletions
|
@ -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))
|
if (lws_finalize_http_header(wsi, &p, end))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,8 @@ lws_ext_cb_active(struct lws *wsi, int reason, void *buf, int len);
|
||||||
LWS_EXTERN int
|
LWS_EXTERN int
|
||||||
lws_ext_cb_all_exts(struct lws_context *context, struct lws *wsi, int reason,
|
lws_ext_cb_all_exts(struct lws_context *context, struct lws *wsi, int reason,
|
||||||
void *arg, int len);
|
void *arg, int len);
|
||||||
|
LWS_EXTERN int
|
||||||
|
lws_extension_server_handshake(struct lws *wsi, char **p, int budget);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#define LWS_CPYAPP(ptr, str) { strcpy(ptr, str); ptr += strlen(str); }
|
#define LWS_CPYAPP(ptr, str) { strcpy(ptr, str); ptr += strlen(str); }
|
||||||
|
|
||||||
#if !defined(LWS_WITHOUT_EXTENSIONS)
|
#if !defined(LWS_WITHOUT_EXTENSIONS)
|
||||||
static int
|
int
|
||||||
lws_extension_server_handshake(struct lws *wsi, char **p, int budget)
|
lws_extension_server_handshake(struct lws *wsi, char **p, int budget)
|
||||||
{
|
{
|
||||||
struct lws_context *context = wsi->a.context;
|
struct lws_context *context = wsi->a.context;
|
||||||
|
|
Loading…
Add table
Reference in a new issue