summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/UTPexExtensionMessage.cc4
-rw-r--r--src/libutp/utp_internal.cpp2
-rw-r--r--src/libutp/utp_internal.h7
3 files changed, 7 insertions, 6 deletions
diff --git a/src/UTPexExtensionMessage.cc b/src/UTPexExtensionMessage.cc
index b825b4e5..f266c0f0 100644
--- a/src/UTPexExtensionMessage.cc
+++ b/src/UTPexExtensionMessage.cc
@@ -92,8 +92,8 @@ std::string UTPexExtensionMessage::getPayload()
}
namespace {
-const char PEX_FLAG_SEEDER = 0x20;
-const char PEX_FLAG_UTP = 0x40;
+const char PEX_FLAG_SEEDER = 0x02;
+const char PEX_FLAG_UTP = 0x04;
} // namespace
std::pair<std::pair<std::string, std::string>,
diff --git a/src/libutp/utp_internal.cpp b/src/libutp/utp_internal.cpp
index 8c1b2a86..34281fe9 100644
--- a/src/libutp/utp_internal.cpp
+++ b/src/libutp/utp_internal.cpp
@@ -3284,7 +3284,7 @@ void utp_check_timeouts(utp_context *ctx)
infos.shrink_to_fit();
ctx->utp_sockets.erase_if(
- [](auto& item){
+ [](const UTPSocketHT::Map::iterator & item){
auto& conn = item->second;
conn->check_timeouts();
return conn->state == CS_DESTROY;
diff --git a/src/libutp/utp_internal.h b/src/libutp/utp_internal.h
index 064ddfa3..1edb1aa2 100644
--- a/src/libutp/utp_internal.h
+++ b/src/libutp/utp_internal.h
@@ -113,8 +113,6 @@ extern void utp_socket_delete(UTPSocket*);
// Container that owns a set of UTPSockets.
// The sockets are destroyed when removed from the container.
class UTPSocketHT {
- using Key = UTPSocketKey;
- using Value = UTPSocket;
// UTPSocket is an opaque type, so we can't use it for V.
// Instead, use a unique_ptr<> which deletes via `utp_socket_delete()`.
@@ -123,10 +121,13 @@ class UTPSocketHT {
utp_socket_delete(conn);
}
};
+
+public:
+ using Key = UTPSocketKey;
+ using Value = UTPSocket;
using V = std::unique_ptr<Value, SocketDeleter>;
using Map = std::unordered_map<Key, V>;
-public:
[[nodiscard]] auto contains(Key const& key)->bool const {
return map_.count(key) != 0U;
}