diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-11 08:28:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-11 08:28:47 +0200 |
commit | be446038bb8231a16c1f1a915bab89f1b7e45368 (patch) | |
tree | c40d28f088ed4844d9e1bb0e9848b415438e73f9 /modules/websocket/wsl_peer.cpp | |
parent | be0da31f7a2e91b211b556ead5f1529f4427441a (diff) | |
parent | 2c557787c119ac629085cba2455132f5b82553dc (diff) |
Merge pull request #32683 from Faless/ws/improve_pr
WebSocket improvements, SSL server, custom headers.
Diffstat (limited to 'modules/websocket/wsl_peer.cpp')
-rw-r--r-- | modules/websocket/wsl_peer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 74fb901232..32beccde5d 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -208,7 +208,6 @@ void WSLPeer::make_context(PeerData *p_data, unsigned int p_in_buf_size, unsigne _data = p_data; _data->peer = this; _data->valid = true; - _connection = Ref<StreamPeer>(_data->conn); if (_data->is_server) wslay_event_context_server_init(&(_data->ctx), &wsl_callbacks, _data); @@ -302,18 +301,16 @@ void WSLPeer::close(int p_code, String p_reason) { IP_Address WSLPeer::get_connected_host() const { - ERR_FAIL_COND_V(!is_connected_to_host(), IP_Address()); + ERR_FAIL_COND_V(!is_connected_to_host() || _data->tcp.is_null(), IP_Address()); - IP_Address ip; - return ip; + return _data->tcp->get_connected_host(); } uint16_t WSLPeer::get_connected_port() const { - ERR_FAIL_COND_V(!is_connected_to_host(), 0); + ERR_FAIL_COND_V(!is_connected_to_host() || _data->tcp.is_null(), 0); - uint16_t port = 0; - return port; + return _data->tcp->get_connected_port(); } void WSLPeer::invalidate() { |