aboutsummaryrefslogtreecommitdiff
path: root/test/test_p2p_tls.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-10-13 14:05:29 -0400
committerDeterminant <[email protected]>2019-10-13 14:05:29 -0400
commit3505e9d33eab6d341185773c1da315b2dc833a21 (patch)
treea67629fea47ee83f5c05d781198469f135882eeb /test/test_p2p_tls.cpp
parent8270af53b2e4741fcacab49a21823597cc31d88c (diff)
WIP: bounded recv buffer
Diffstat (limited to 'test/test_p2p_tls.cpp')
-rw-r--r--test/test_p2p_tls.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_p2p_tls.cpp b/test/test_p2p_tls.cpp
index 698bbac..93cefac 100644
--- a/test/test_p2p_tls.cpp
+++ b/test/test_p2p_tls.cpp
@@ -29,6 +29,7 @@
#include <unordered_map>
#include <unordered_set>
#include <unistd.h>
+#include <signal.h>
#include "salticidae/msg.h"
#include "salticidae/event.h"
@@ -69,6 +70,13 @@ struct MsgText {
const uint8_t MsgText::opcode;
+void masksigs() {
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigfillset(&mask);
+ pthread_sigmask(SIG_BLOCK, &mask, NULL);
+}
+
std::unordered_set<uint256_t> valid_certs;
struct Net {
@@ -124,6 +132,7 @@ struct Net {
this->id, std::string(claimed_addr).c_str());
});
th = std::thread([=](){
+ masksigs();
try {
net->start();
net->listen(NetAddr(listen_addr));