Merge remote-tracking branch 'origin/master' into debian/sid

ubuntu/groovy
Jason Rhinelander 5 years ago
commit 0031315e73

@ -1,3 +1,6 @@
#include <constants/version.hpp>
const char Version::LLARP_NET_ID[] = "testnet";
#ifndef LLARP_DEFAULT_NETID
#define LLARP_DEFAULT_NETID "testnet"
#endif
const char Version::LLARP_NET_ID[] = LLARP_DEFAULT_NETID;

@ -6,11 +6,11 @@
#endif
#ifndef LLARP_VERSION_MIN
#define LLARP_VERSION_MIN "4"
#define LLARP_VERSION_MIN "5"
#endif
#ifndef LLARP_VERSION_PATCH
#define LLARP_VERSION_PATCH "3"
#define LLARP_VERSION_PATCH "0"
#endif
#ifndef LLARP_VERSION_NUM

@ -40,6 +40,12 @@ namespace llarp
~Session() = default;
std::shared_ptr< ILinkSession >
BorrowSelf() override
{
return shared_from_this();
}
void
Pump() override;

@ -157,7 +157,12 @@ namespace llarp
else
{
LogInfo("pending session at ", itr->first, " timed out");
itr->second->Close();
// defer call so we can acquire mutexes later
auto self = itr->second->BorrowSelf();
m_Logic->queue_func([&, self]() {
this->HandleTimeout(self.get());
self->Close();
});
itr = m_Pending.erase(itr);
}
}

@ -25,6 +25,11 @@ namespace llarp
eDeliveryDropped = 1
};
/// equiv of shared_from_this but for the interface type so
/// that each implementation can use shared_from_this
virtual std::shared_ptr< ILinkSession >
BorrowSelf() = 0;
/// hook for utp for when we have established a connection
virtual void
OnLinkEstablished(ILinkLayer *){};

@ -15,7 +15,8 @@ namespace llarp
{
struct LinkLayer;
struct Session : public ILinkSession
struct Session : public ILinkSession,
public std::enable_shared_from_this< Session >
{
/// remote router's rc
RouterContact remoteRC;
@ -155,6 +156,12 @@ namespace llarp
void
Pump() override;
std::shared_ptr< ILinkSession >
BorrowSelf() override
{
return shared_from_this();
}
bool
SendKeepAlive() override;

@ -1 +1 @@
just a lot of wind
breaking winds

Loading…
Cancel
Save