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

key_b64 doesnt need to be in wsi

It's only used in some client code and never seen again

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-01-21 11:04:49 +08:00
parent f862463e2e
commit 80f168b4ee
2 changed files with 5 additions and 6 deletions

View file

@ -612,6 +612,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
struct libwebsocket *wsi, char *pkt)
{
char hash[20];
char key_b64[40];
char *p = pkt;
int n;
#ifndef LWS_NO_EXTENSIONS
@ -643,8 +644,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
return NULL;
}
lws_b64_encode_string(hash, 16, wsi->key_b64,
sizeof wsi->key_b64);
lws_b64_encode_string(hash, 16, key_b64, sizeof key_b64);
/*
* 00 example client handshake
@ -681,8 +681,8 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
p += sprintf(p, "Upgrade: websocket\x0d\x0a"
"Connection: Upgrade\x0d\x0a"
"Sec-WebSocket-Key: ");
strcpy(p, wsi->key_b64);
p += strlen(wsi->key_b64);
strcpy(p, key_b64);
p += strlen(key_b64);
p += sprintf(p, "\x0d\x0a");
if (wsi->c_origin) {
if (wsi->ietf_spec_revision == 13)
@ -761,7 +761,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
/* prepare the expected server accept response */
strcpy((char *)buf, wsi->key_b64);
strcpy((char *)buf, key_b64);
strcpy((char *)&buf[strlen((char *)buf)], magic_websocket_guid);
SHA1(buf, strlen((char *)buf), (unsigned char *)hash);

View file

@ -314,7 +314,6 @@ struct libwebsocket {
/* 04 protocol specific */
char key_b64[150];
unsigned char masking_key_04[20];
unsigned char frame_masking_nonce_04[4];
unsigned char frame_mask_04[20];