summaryrefslogtreecommitdiff
path: root/core/io/stream_peer_tcp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/stream_peer_tcp.cpp')
-rw-r--r--core/io/stream_peer_tcp.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index fd7ffa8458..cce728c30a 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -117,8 +117,9 @@ Error StreamPeerTCP::write(const uint8_t *p_data, int p_bytes, int &r_sent, bool
}
}
- if (!_sock->is_open())
+ if (!_sock->is_open()) {
return FAILED;
+ }
Error err;
int data_to_send = p_bytes;
@@ -257,8 +258,9 @@ StreamPeerTCP::Status StreamPeerTCP::get_status() {
}
void StreamPeerTCP::disconnect_from_host() {
- if (_sock.is_valid() && _sock->is_open())
+ if (_sock.is_valid() && _sock->is_open()) {
_sock->close();
+ }
timeout = 0;
status = STATUS_NONE;
@@ -308,8 +310,9 @@ Error StreamPeerTCP::_connect(const String &p_address, int p_port) {
ip = p_address;
} else {
ip = IP::get_singleton()->resolve_hostname(p_address);
- if (!ip.is_valid())
+ if (!ip.is_valid()) {
return ERR_CANT_RESOLVE;
+ }
}
return connect_to_host(ip, p_port);