Browse Source

MT#56374 remove DTLS timer from poller_timer

Use a dedicated looper thread instead of using the 1 Hz poller timer.

Change-Id: If63b240274121642043999725c72164240421110
pull/1692/head
Richard Fuchs 2 years ago
parent
commit
ac7d5e8dc3
3 changed files with 9 additions and 6 deletions
  1. +7
    -4
      daemon/dtls.c
  2. +1
    -1
      daemon/main.c
  3. +1
    -1
      include/dtls.h

+ 7
- 4
daemon/dtls.c View File

@ -401,13 +401,13 @@ int dtls_init() {
return 0;
}
static void __dtls_timer(void *p) {
static enum thread_looper_action __dtls_timer(void) {
struct dtls_cert *c;
long int left;
c = dtls_cert();
if (!c)
return;
return TLA_BREAK;
left = c->expires - rtpe_now.tv_sec;
if (left > CERT_EXPIRY_TIME/2)
@ -417,10 +417,13 @@ static void __dtls_timer(void *p) {
out:
obj_put(c);
return TLA_CONTINUE;
}
void dtls_timer(struct poller *p) {
poller_add_timer(p, __dtls_timer, NULL);
void dtls_timer(void) {
thread_create_looper(__dtls_timer, rtpe_config.idle_scheduling,
rtpe_config.idle_priority, "DTLS refresh timer",
((long long) CERT_EXPIRY_TIME / 7) * 1000000);
}
static unsigned int generic_func(unsigned char *o, X509 *x, const EVP_MD *md) {


+ 1
- 1
daemon/main.c View File

@ -1134,7 +1134,7 @@ no_kernel:
if (!rtpe_poller_map)
die("poller map creation failed");
dtls_timer(rtpe_poller);
dtls_timer();
if (call_init())
abort();


+ 1
- 1
include/dtls.h View File

@ -63,7 +63,7 @@ struct dtls_connection {
int dtls_init(void);
void dtls_timer(struct poller *);
void dtls_timer(void);
int dtls_verify_cert(struct packet_stream *ps);
const struct dtls_hash_func *dtls_find_hash_func(const str *);


Loading…
Cancel
Save