Skip to content

Commit d12dc98

Browse files
Fix: timers dying when there are no sockets to connect
Improvement: Bump minimum TLS version to 1.3
1 parent 6e19fed commit d12dc98

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/dpp/socketengines/epoll.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ struct DPP_EXPORT socket_engine_epoll : public socket_engine_base {
7777

7878
void process_events() final {
7979
const int sleep_length = 1000;
80-
if (sockets == 0) {
81-
/* epoll_wait() on empty set waits forever (or until another thread inserts a socket into the set.
82-
* We can't trust that this is going to happen, and it may deadlock the cluster, so in the event the
83-
* set is empty, we wait a millisecond (so it isn't a busy-wait) and return.
84-
*/
85-
std::this_thread::sleep_for(std::chrono::milliseconds(1));
86-
return;
87-
}
8880
int i = epoll_wait(epoll_handle, events.data(), MAX_EVENTS, sleep_length);
8981

9082
for (int j = 0; j < i; j++) {

src/dpp/socketengines/kqueue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct DPP_EXPORT socket_engine_kqueue : public socket_engine_base {
6363

6464
int i = kevent(kqueue_handle, nullptr, 0, ke_list.data(), static_cast<int>(ke_list.size()), &ts);
6565
if (i < 0) {
66+
prune();
6667
return;
6768
}
6869

src/dpp/ssl_context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ wrapped_ssl_ctx* generate_ssl_context(uint16_t port, const std::string &private_
7373
}
7474

7575
/* This sets the allowed SSL/TLS versions for the connection.
76-
* Do not allow SSL 3.0, TLS 1.0 or 1.1
76+
* Do not allow SSL 3.0, TLS < 1.3
7777
* https://www.packetlabs.net/posts/tls-1-1-no-longer-secure/
7878
*/
79-
if (!SSL_CTX_set_min_proto_version(context->context, TLS1_2_VERSION)) {
79+
if (!SSL_CTX_set_min_proto_version(context->context, TLS1_3_VERSION)) {
8080
throw dpp::connection_exception(err_ssl_version, "Failed to set minimum SSL version!");
8181
}
8282

0 commit comments

Comments
 (0)