mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
null exception with null extensions list
I was under the impression extensions could be null, so heres a patch to fix this error in libwebsockets. Cheers! Signed-off-by: Andrew Chambers <andrewchamberss@gmail.com> --
This commit is contained in:
parent
13f7791d0c
commit
d5512179fc
1 changed files with 8 additions and 5 deletions
|
@ -2946,11 +2946,14 @@ libwebsocket_create_context(int port, const char *interf,
|
|||
m = LWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT;
|
||||
if (port)
|
||||
m = LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT;
|
||||
while (extensions->callback) {
|
||||
debug(" Extension: %s\n", extensions->name);
|
||||
extensions->callback(context, extensions,
|
||||
NULL, m, NULL, NULL, 0);
|
||||
extensions++;
|
||||
|
||||
if (extensions) {
|
||||
while (extensions->callback) {
|
||||
debug(" Extension: %s\n", extensions->name);
|
||||
extensions->callback(context, extensions,
|
||||
NULL, m, NULL, NULL, 0);
|
||||
extensions++;
|
||||
}
|
||||
}
|
||||
|
||||
return context;
|
||||
|
|
Loading…
Add table
Reference in a new issue