summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-09-26 03:02:14 +0200
committerGitHub <noreply@github.com>2019-09-26 03:02:14 +0200
commitdcf0a60a52124b06b161cdaba7bce845b1f43f90 (patch)
treec0a7091b32caf50e792fe73be1a83076c18b3db1
parentedf9055b7f3fb16f9b927d09bc84be31c1076ce7 (diff)
parent5631850152a161e1fe2bb9678a3728403ee7e569 (diff)
Merge pull request #32228 from damianday/patch-1
TCP is_connected_to_host comparison error
-rw-r--r--core/io/stream_peer_tcp.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index 310bb12bc0..b9c5896b24 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -248,16 +248,7 @@ void StreamPeerTCP::set_no_delay(bool p_enabled) {
bool StreamPeerTCP::is_connected_to_host() const {
- if (status == STATUS_NONE || status == STATUS_ERROR) {
-
- return false;
- }
-
- if (status != STATUS_CONNECTED) {
- return true;
- }
-
- return _sock.is_valid() && _sock->is_open();
+ return _sock.is_valid() && _sock->is_open() && (status == STATUS_CONNECTED || status == STATUS_CONNECTING);
}
StreamPeerTCP::Status StreamPeerTCP::get_status() {