diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/http_client.cpp | 4 | ||||
-rw-r--r-- | core/io/packet_peer.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 46e45500bf..a25413b21b 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -96,6 +96,10 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, void HTTPClient::set_connection(const Ref<StreamPeer> &p_connection) { ERR_FAIL_COND_MSG(p_connection.is_null(), "Connection is not a reference to a valid StreamPeer object."); + if (connection == p_connection) { + return; + } + close(); connection = p_connection; status = STATUS_CONNECTED; diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index 92cdbc4151..fb4dc181db 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -31,8 +31,8 @@ #ifndef PACKET_PEER_H #define PACKET_PEER_H +#include "core/class_db.h" #include "core/io/stream_peer.h" -#include "core/object.h" #include "core/ring_buffer.h" class PacketPeer : public Reference { |