Make lws_create_context() to fail if unable to bind 72/264872/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 1 Oct 2021 10:07:20 +0000 (19:07 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 1 Oct 2021 10:13:10 +0000 (19:13 +0900)
If libwebsocket fails to bind as shown below, the lws_context
should not be created at all in order to retry again.

websocket.cpp: log_func(389) > LEVEL : 1 , ERROR on binding fd 103 to port 7681 (-1 98)
websocket.cpp: log_func(389) > LEVEL : 1 , VH default: iface (null) port 7681 DOESN'T EXIST

Change-Id: I781420d4ed5c3daef01a9e4b05acf2024f2b9683

src/legacy_support/websocket.cpp

index 50e24e1..3b9d735 100644 (file)
@@ -449,7 +449,7 @@ bool CWebHelperAgentWebSocket::init()
     info.ssl_private_key_filepath = NULL;
     info.gid = -1;
     info.uid = -1;
-    info.options = 0;
+    info.options = LWS_SERVER_OPTION_FAIL_UPON_UNABLE_TO_BIND;
 
     ecore_init();