diff options
Diffstat (limited to 'src/net.cpp')
| -rw-r--r-- | src/net.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/net.cpp b/src/net.cpp index 395092d..2581578 100644 --- a/src/net.cpp +++ b/src/net.cpp | |||
| @@ -783,12 +783,17 @@ void ThreadBtfAccept(void* parg) | |||
| 783 | LogPrint("net", "rendezvous: registered at %s, waiting for a dial\n", | 783 | LogPrint("net", "rendezvous: registered at %s, waiting for a dial\n", |
| 784 | strMeeting.c_str()); | 784 | strMeeting.c_str()); |
| 785 | 785 | ||
| 786 | // Now block for someone to arrive. | 786 | // Now wait for someone to arrive -- but not forever. This used to have |
| 787 | if (!btf::RvServiceWaitPaired(rv)) | 787 | // no bound, and a registration whose path died quietly left the thread |
| 788 | // parked in recv() with nothing to wake it: the loop never came back | ||
| 789 | // here, the node stopped being reachable, and nothing in the log said | ||
| 790 | // so. Re-registering every few minutes when nobody has dialled costs | ||
| 791 | // one reconnect and removes the whole failure mode. | ||
| 792 | if (!btf::RvServiceWaitPaired(rv, BTF_RENDEZVOUS_WAIT_SECS)) | ||
| 788 | { | 793 | { |
| 789 | btf::RvClose(rv); | 794 | btf::RvClose(rv); |
| 790 | LogPrint("net", "rendezvous: %s dropped us before any dial, re-registering\n", | 795 | LogPrint("net", "rendezvous: no dial at %s within %ds (or it dropped us), " |
| 791 | strMeeting.c_str()); | 796 | "re-registering\n", strMeeting.c_str(), BTF_RENDEZVOUS_WAIT_SECS); |
| 792 | continue; | 797 | continue; |
| 793 | } | 798 | } |
| 794 | 799 | ||