summaryrefslogtreecommitdiff
path: root/lib/ws.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-09-20 10:54:22 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-09-21 09:19:42 +0200
commita2fa5f86d6e33582ae4c0a1fd9ff5fd820126f26 (patch)
treea51d98a86c4efb1b9ca268158b77768aa8aa67c1 /lib/ws.c
parent6fbf7d34b535ab19b69da491687f574f336ac94a (diff)
downloadcurl-a2fa5f86d6e33582ae4c0a1fd9ff5fd820126f26.tar.gz
ws: fix a C89 compliance nit
Closes #9541
Diffstat (limited to 'lib/ws.c')
-rw-r--r--lib/ws.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ws.c b/lib/ws.c
index e68d0f4ff..cec3162d9 100644
--- a/lib/ws.c
+++ b/lib/ws.c
@@ -56,7 +56,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
size_t randlen;
char keyval[40];
struct SingleRequest *k = &data->req;
- const struct wsfield heads[]= {
+ struct wsfield heads[]= {
{
/* The request MUST contain an |Upgrade| header field whose value
MUST include the "websocket" keyword. */
@@ -79,9 +79,10 @@ CURLcode Curl_ws_request(struct Curl_easy *data, REQTYPE *req)
consisting of a randomly selected 16-byte value that has been
base64-encoded (see Section 4 of [RFC4648]). The nonce MUST be
selected randomly for each connection. */
- "Sec-WebSocket-Key:", &keyval[0]
+ "Sec-WebSocket-Key:", NULL,
}
};
+ heads[3].val = &keyval[0];
/* 16 bytes random */
result = Curl_rand(data, (unsigned char *)rand, sizeof(rand));