Add monotonic clock for packet timestamps

This commit is contained in:
Mark Spanbroek 2020-09-16 14:21:10 +02:00 committed by markspanbroek
parent aae030c634
commit a73536c10f
3 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import std/monotimes
import ngtcp2
import ids
import encrypt
@ -48,6 +49,7 @@ proc clientDefaultSettings: ngtcp2_settings =
result.transport_params.stateless_reset_token_present = 0
result.transport_params.active_connection_id_limit = 8
result.initial_ts = getMonoTime().ticks.uint
result.log_printf = log_printf
proc setupClient*(path: ptr ngtcp2_path): ptr ngtcp2_conn =

View File

@ -1,3 +1,4 @@
import std/monotimes
import ngtcp2
import encrypt
import decrypt
@ -56,6 +57,7 @@ proc serverDefaultSettings: ngtcp2_settings =
for i in 0..<NGTCP2_STATELESS_RESET_TOKENLEN:
result.transport_params.stateless_reset_token[i] = uint8(i)
result.initial_ts = getMonoTime().ticks.uint
result.log_printf = log_printf
proc setupServer*(path: ptr ngtcp2_path): ptr ngtcp2_conn =

View File

@ -1,4 +1,5 @@
import unittest
import std/monotimes
import ngtcp2
import helpers/server
import helpers/client