summaryrefslogtreecommitdiff
path: root/src/libutp/utp_internal.cpp
diff options
context:
space:
mode:
authorHanjie Wu <wu@x-nagi.com>2023-12-16 01:45:41 -0800
committerHanjie Wu <wu@x-nagi.com>2023-12-16 01:45:41 -0800
commit9525e06932a7e8d99bd90f9b9af2e72302acccb4 (patch)
tree5bb81d6491b5fa6c6b164d4b959b80b4fe5cffbf /src/libutp/utp_internal.cpp
parent25f9426b6e45e4bd2cdee8d872dab3ff0f9d7417 (diff)
more C++11 compatibility issues
Diffstat (limited to 'src/libutp/utp_internal.cpp')
-rw-r--r--src/libutp/utp_internal.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libutp/utp_internal.cpp b/src/libutp/utp_internal.cpp
index 93117e97..90d281a4 100644
--- a/src/libutp/utp_internal.cpp
+++ b/src/libutp/utp_internal.cpp
@@ -2867,7 +2867,8 @@ int utp_process_udp(utp_context *ctx, const byte *buffer, size_t len, const stru
const byte flags = pf1->type();
if (flags == ST_RESET) {
- if (auto* conn = LookupAdjacent(ctx, addr, id); conn != nullptr) {
+ auto* conn = LookupAdjacent(ctx, addr, id);
+ if (conn != nullptr) {
#if UTP_DEBUG_LOGGING
ctx->log(UTP_LOG_DEBUG, NULL, "recv RST for existing connection");
#endif
@@ -2890,10 +2891,11 @@ int utp_process_udp(utp_context *ctx, const byte *buffer, size_t len, const stru
}
else if (flags != ST_SYN) {
UTPSocket* conn = NULL;
+ UTPSocket* lookup;
if (ctx->last_utp_socket && ctx->last_utp_socket->addr == addr && ctx->last_utp_socket->conn_id_recv == id) {
conn = ctx->last_utp_socket;
- } else if (auto* lookup = ctx->utp_sockets.lookup(UTPSocketKey{ addr, id }); lookup != nullptr) {
+ } else if (lookup = ctx->utp_sockets.lookup(UTPSocketKey{ addr, id }); lookup != nullptr) {
conn = ctx->last_utp_socket = lookup;
}
@@ -3047,7 +3049,8 @@ static UTPSocket* parse_icmp_payload(utp_context *ctx, const byte *buffer, size_
return NULL;
}
- if (auto* const conn = LookupAdjacent(ctx, addr, id); conn != nullptr)
+ auto* const conn = LookupAdjacent(ctx, addr, id);
+ if (conn != nullptr)
return conn;
#if UTP_DEBUG_LOGGING