|
|
|
@ -575,7 +575,12 @@ namespace stream
@@ -575,7 +575,12 @@ namespace stream
|
|
|
|
|
const i2p::data::LeaseSet * StreamingDestination::GetLeaseSet () |
|
|
|
|
{ |
|
|
|
|
if (!m_Pool) return nullptr; |
|
|
|
|
if (!m_LeaseSet || m_LeaseSet->HasExpiredLeases ()) |
|
|
|
|
if (!m_LeaseSet) |
|
|
|
|
UpdateLeaseSet (); |
|
|
|
|
return m_LeaseSet; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void StreamingDestination::UpdateLeaseSet () |
|
|
|
|
{ |
|
|
|
|
auto newLeaseSet = new i2p::data::LeaseSet (*m_Pool); |
|
|
|
|
if (!m_LeaseSet) |
|
|
|
@ -586,11 +591,14 @@ namespace stream
@@ -586,11 +591,14 @@ namespace stream
|
|
|
|
|
*m_LeaseSet = *newLeaseSet; |
|
|
|
|
delete newLeaseSet; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void StreamingDestination::SetLeaseSetUpdated () |
|
|
|
|
{ |
|
|
|
|
UpdateLeaseSet (); |
|
|
|
|
for (auto it: m_Streams) |
|
|
|
|
it.second->SetLeaseSetUpdated (); |
|
|
|
|
} |
|
|
|
|
return m_LeaseSet; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void StreamingDestination::Sign (const uint8_t * buf, int len, uint8_t * signature) const |
|
|
|
|
{ |
|
|
|
|