Merge pull request #569 from majestrate/make-function-static

Make function static
pull/570/head
Jeff 5 years ago committed by GitHub
commit 9d9b65413c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,7 +13,7 @@ namespace llarp
static constexpr size_t EncryptedFrameOverheadSize = static constexpr size_t EncryptedFrameOverheadSize =
PUBKEYSIZE + TUNNONCESIZE + SHORTHASHSIZE; PUBKEYSIZE + TUNNONCESIZE + SHORTHASHSIZE;
static constexpr size_t EncryptedFrameBodySize = 1024; static constexpr size_t EncryptedFrameBodySize = 128 * 6;
static constexpr size_t EncryptedFrameSize = static constexpr size_t EncryptedFrameSize =
EncryptedFrameOverheadSize + EncryptedFrameBodySize; EncryptedFrameOverheadSize + EncryptedFrameBodySize;

@ -244,7 +244,7 @@ namespace llarp
// store it into netdb if we don't have it // store it into netdb if we don't have it
if(!n->Has(rc.pubkey)) if(!n->Has(rc.pubkey))
{ {
std::function< void(std::shared_ptr< LRCMFrameDecrypt >) > cb = static std::function< void(std::shared_ptr< LRCMFrameDecrypt >) > cb =
[](std::shared_ptr< LRCMFrameDecrypt > ctx) { [](std::shared_ptr< LRCMFrameDecrypt > ctx) {
ctx->context->ForwardLRCM(ctx->hop->info.upstream, ctx->context->ForwardLRCM(ctx->hop->info.upstream,
ctx->frames); ctx->frames);

@ -255,9 +255,6 @@ namespace llarp
{ {
if(sendq.size() >= MaxSendQueueSize) if(sendq.size() >= MaxSendQueueSize)
return false; return false;
// preemptive pump
if(sendq.size() >= MaxSendQueueSize / 8)
PumpWrite();
size_t sz = buf.sz; size_t sz = buf.sz;
byte_t* ptr = buf.base; byte_t* ptr = buf.base;
uint32_t msgid = m_NextTXMsgID++; uint32_t msgid = m_NextTXMsgID++;
@ -273,6 +270,7 @@ namespace llarp
ptr += s; ptr += s;
sz -= s; sz -= s;
} }
PumpWrite();
return true; return true;
} }

Loading…
Cancel
Save