mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
add-user-allocation-for-client-connects.patch
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
bd96d8092e
commit
864d9026a8
1 changed files with 13 additions and 0 deletions
|
@ -507,6 +507,19 @@ check_accept:
|
|||
strcpy(p, magic_websocket_04_masking_guid);
|
||||
SHA1((unsigned char *)buf, strlen(buf), wsi->masking_key_04);
|
||||
|
||||
/* allocate the per-connection user memory (if any) */
|
||||
|
||||
if (wsi->protocol->per_session_data_size) {
|
||||
wsi->user_space = malloc(
|
||||
wsi->protocol->per_session_data_size);
|
||||
if (wsi->user_space == NULL) {
|
||||
fprintf(stderr, "Out of memory for "
|
||||
"conn user space\n");
|
||||
goto bail2;
|
||||
}
|
||||
} else
|
||||
wsi->user_space = NULL;
|
||||
|
||||
/* okay he is good to go */
|
||||
|
||||
this->fds[this->fds_count].fd = wsi->sock;
|
||||
|
|
Loading…
Add table
Reference in a new issue