mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
move thread naming to util
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
aace200899
commit
3100d4f902
12 changed files with 63 additions and 39 deletions
|
@ -11,7 +11,6 @@
|
|||
#include <vector>
|
||||
#include <boost/asio.hpp>
|
||||
#include <stdexcept>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "I2PEndian.h"
|
||||
#include "Base.h"
|
||||
|
@ -27,6 +26,7 @@
|
|||
#include "ECIESX25519AEADRatchetSession.h"
|
||||
#include "Config.h"
|
||||
#include "NetDb.hpp"
|
||||
#include "util.h"
|
||||
|
||||
using namespace i2p::transport;
|
||||
|
||||
|
@ -89,7 +89,7 @@ namespace data
|
|||
|
||||
void NetDb::Run ()
|
||||
{
|
||||
pthread_setname_np(pthread_self(), "NetDB");
|
||||
i2p::util::SetThreadName("NetDB");
|
||||
|
||||
uint32_t lastSave = 0, lastPublish = 0, lastExploratory = 0, lastManageRequest = 0, lastDestinationCleanup = 0;
|
||||
while (m_IsRunning)
|
||||
|
@ -116,7 +116,7 @@ namespace data
|
|||
break;
|
||||
case eI2NPDeliveryStatus:
|
||||
HandleDeliveryStatusMsg (msg);
|
||||
break;
|
||||
break;
|
||||
case eI2NPDummyMsg:
|
||||
// plain RouterInfo from NTCP2 with flags for now
|
||||
HandleNTCP2RouterInfoMsg (msg);
|
||||
|
@ -158,12 +158,12 @@ namespace data
|
|||
if (!m_HiddenMode && i2p::transport::transports.IsOnline ())
|
||||
{
|
||||
bool publish = false;
|
||||
if (m_PublishReplyToken)
|
||||
{
|
||||
if (m_PublishReplyToken)
|
||||
{
|
||||
if (ts - lastPublish >= NETDB_PUBLISH_CONFIRMATION_TIMEOUT) publish = true;
|
||||
}
|
||||
else if (i2p::context.GetLastUpdateTime () > lastPublish ||
|
||||
ts - lastPublish >= NETDB_PUBLISH_INTERVAL) publish = true;
|
||||
ts - lastPublish >= NETDB_PUBLISH_INTERVAL) publish = true;
|
||||
if (publish) // update timestamp and publish
|
||||
{
|
||||
i2p::context.UpdateTimestamp (ts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue