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

ws: ext header is already delimited if present

This commit is contained in:
Andy Green 2025-03-05 07:10:25 +00:00
parent a656eb5f1b
commit ef4a85d0e1

View file

@ -737,6 +737,7 @@ handshake_0405(struct lws_context *context, struct lws *wsi)
LWS_CPYAPP(p, "\x0d\x0aSec-WebSocket-Protocol: "); LWS_CPYAPP(p, "\x0d\x0aSec-WebSocket-Protocol: ");
p += lws_snprintf(p, 128, "%s", prot); p += lws_snprintf(p, 128, "%s", prot);
LWS_CPYAPP(p, "\x0d\x0a");
} }
#if !defined(LWS_WITHOUT_EXTENSIONS) #if !defined(LWS_WITHOUT_EXTENSIONS)
@ -744,13 +745,13 @@ handshake_0405(struct lws_context *context, struct lws *wsi)
* Figure out which extensions the client has that we want to * Figure out which extensions the client has that we want to
* enable on this connection, and give him back the list. * enable on this connection, and give him back the list.
* *
* Give him a limited write bugdet * Give him a limited write bugdet.
*
* This appends a closing CRLF before returning, if h1
*/ */
LWS_CPYAPP(p, "\x0d\x0a");
if (lws_extension_server_handshake(wsi, &p, 190)) if (lws_extension_server_handshake(wsi, &p, 190))
goto bail; goto bail;
#endif #endif
LWS_CPYAPP(p, "\x0d\x0a");
args.p = p; args.p = p;
args.max_len = lws_ptr_diff((char *)pt->serv_buf + args.max_len = lws_ptr_diff((char *)pt->serv_buf +