summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-06-06 20:38:39 +0200
committerGitHub <noreply@github.com>2018-06-06 20:38:39 +0200
commitaaf93f92d8ba9bef29f42b590782fc6f0fad6fdc (patch)
tree259592b4e9dfd03ec9a58678a9a31facfcf53110
parentaf15a1f10e9928d545065952b123b3eaa6f4b036 (diff)
parent6cda58a12fde6a0232e84b1f7463f1aba836fd6b (diff)
Merge pull request #19397 from Faless/ws_get_ip_port
Fix LWSPeer get_connected_[host/port]
-rw-r--r--modules/websocket/lws_peer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/websocket/lws_peer.cpp b/modules/websocket/lws_peer.cpp
index 3855a39aef..96acb99cc4 100644
--- a/modules/websocket/lws_peer.cpp
+++ b/modules/websocket/lws_peer.cpp
@@ -191,8 +191,8 @@ IP_Address LWSPeer::get_connected_host() const {
IP_Address ip;
int port = 0;
- socklen_t len = 0;
struct sockaddr_storage addr;
+ socklen_t len = sizeof(addr);
int fd = lws_get_socket_fd(wsi);
ERR_FAIL_COND_V(fd == -1, IP_Address());
@@ -212,8 +212,8 @@ uint16_t LWSPeer::get_connected_port() const {
IP_Address ip;
int port = 0;
- socklen_t len = 0;
struct sockaddr_storage addr;
+ socklen_t len = sizeof(addr);
int fd = lws_get_socket_fd(wsi);
ERR_FAIL_COND_V(fd == -1, 0);