mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ssl pendding buffered reads dont dereference first time
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
30edd910b6
commit
413b3a6c55
1 changed files with 10 additions and 7 deletions
17
lib/ssl.c
17
lib/ssl.c
|
@ -437,13 +437,16 @@ lws_ssl_capable_read(struct libwebsocket_context *context,
|
|||
* and if we don't realize, this data will sit there forever
|
||||
*/
|
||||
if (n == len && wsi->ssl && SSL_pending(wsi->ssl)) {
|
||||
assert(!wsi->pending_read_list_next && !wsi->pending_read_list_prev);
|
||||
/* add us to the linked list of guys with pending ssl */
|
||||
context->pending_read_list->pending_read_list_prev = wsi;
|
||||
wsi->pending_read_list_next = context->pending_read_list;
|
||||
wsi->pending_read_list_prev = NULL;
|
||||
context->pending_read_list = wsi;
|
||||
}
|
||||
if (!wsi->pending_read_list_next && !wsi->pending_read_list_prev) {
|
||||
/* add us to the linked list of guys with pending ssl */
|
||||
if (context->pending_read_list)
|
||||
context->pending_read_list->pending_read_list_prev = wsi;
|
||||
wsi->pending_read_list_next = context->pending_read_list;
|
||||
wsi->pending_read_list_prev = NULL;
|
||||
context->pending_read_list = wsi;
|
||||
}
|
||||
} else
|
||||
lws_ssl_remove_wsi_from_buffered_list(context, wsi);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue