summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutp/utp_internal.cpp9
-rw-r--r--src/uTPCore.cc3
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libutp/utp_internal.cpp b/src/libutp/utp_internal.cpp
index f2389395..93117e97 100644
--- a/src/libutp/utp_internal.cpp
+++ b/src/libutp/utp_internal.cpp
@@ -2808,15 +2808,18 @@ int utp_connect(utp_socket *conn, const struct sockaddr *to, socklen_t tolen)
// we have to check every case
UTPSocket* LookupAdjacent(utp_context *ctx, PackedSockAddr const& addr, uint32 const id) {
auto key = UTPSocketKey{ addr, id };
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr)
+ auto* conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr)
return conn;
key.recv_id = id + 1;
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr && conn->conn_id_send == id)
+ conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr && conn->conn_id_send == id)
return conn;
key.recv_id = id - 1;
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr && conn->conn_id_send == id)
+ conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr && conn->conn_id_send == id)
return conn;
return nullptr;
diff --git a/src/uTPCore.cc b/src/uTPCore.cc
index 964b0883..72cb32dc 100644
--- a/src/uTPCore.cc
+++ b/src/uTPCore.cc
@@ -5,6 +5,7 @@
#include "a2netcompat.h"
#include "a2io.h"
+#include "a2functional.h"
#include "a2time.h"
#include "message.h"
#include "DlRetryEx.h"
@@ -136,7 +137,7 @@ void setupContextAndSock(utp_context*& ctx, std::shared_ptr<SocketCore>& sock,
utp_set_callback(ctx, UTP_ON_READ, uTPCore::readCallback);
e->addRoutineCommand(
- std::make_unique<uTPListenCommand>(e->newCUID(), e, ctx, sock));
+ make_unique<uTPListenCommand>(e->newCUID(), e, ctx, sock));
}
} // namespace