Skip to content

Commit

Permalink
add fprints
Browse files Browse the repository at this point in the history
  • Loading branch information
laduke committed Nov 3, 2023
1 parent 1f0a184 commit 7dc4723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node/Peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,10 @@ unsigned int Peer::doPingAndKeepalive(void *tPtr,int64_t now)

performMultipathStateCheck(tPtr, now);

char buf[64];
const bool sendFullHello = ((now - _lastSentFullHello) >= ZT_PEER_PING_PERIOD);
if (sendFullHello) {
fprintf(stderr, "sendFullHello %s \n", _id.address().toString(buf));
_lastSentFullHello = now;
}

Expand Down
4 changes: 4 additions & 0 deletions service/OneService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ class OneServiceImpl : public OneService

// Refresh bindings in case device's interfaces have changed, and also sync routes to update any shadow routes (e.g. shadow default)
if (((now - lastBindRefresh) >= (_node->bondController()->inUse() ? ZT_BINDER_REFRESH_PERIOD / 4 : ZT_BINDER_REFRESH_PERIOD))||restarted) {
fprintf(stderr, "binder refresh\n");

// If secondary port is not configured to a constant value and we've been offline for a while,
// bind a new secondary port. This is a workaround for a "coma" issue caused by buggy NATs that stop
Expand All @@ -1189,6 +1190,9 @@ class OneServiceImpl : public OneService
else if (now - lastOnline > (ZT_PEER_PING_PERIOD * 2) || restarted) {
lastOnline = now; // don't keep changing the port before we have a chance to connect
_ports[1] = _getRandomPort();

// TODO delete
fprintf(stderr, "randomized secondary port. Now it's %d\n", _ports[1]);
}
}

Expand Down

0 comments on commit 7dc4723

Please sign in to comment.