chore: upgrade ngtcp2 to 1.6.0 (#6)

Upgrades ngtcp2 to 1.6.0 with all the necessary fixes.
This commit is contained in:
diegomrsantos 2024-08-16 13:35:36 +02:00 committed by GitHub
parent 76bf92475f
commit 024ce6202c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 2815 additions and 1750 deletions

View File

@ -12,7 +12,9 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: iffy/install-nim@v3
- uses: iffy/install-nim@v5
with:
version: 1.6.20
- name: Build
run: nimble install -y
- name: Test

View File

@ -1 +1 @@
nim 1.2.6
nim 1.6.20

View File

@ -3,7 +3,7 @@ root=$(dirname "$0")
# install nimterop, if not already installed
if ! [ -x "$(command -v toast)" ]; then
nimble install -y nimterop@0.6.11
nimble install -y nimterop@2532ce0
fi
# run cmake on ngtcp2 sources
@ -27,7 +27,7 @@ toast \
--preprocess \
--noHeader \
--defines=NGTCP2_STATICLIB \
--replace=sockaddr=SockAddr,SockAddr_storage=Sockaddr_storage \
--replace=sockaddr=SockAddr,SockAddr_storage=Sockaddr_storage,socklen_t=SockLen \
--includeDirs="${root}/sources/lib/includes" \
--includeDirs="${root}/build/lib/includes" \
"${root}/sources/lib/includes/ngtcp2/ngtcp2.h" >> "${root}/ngtcp2.nim"

View File

@ -25,12 +25,18 @@
#ifndef VERSION_H
#define VERSION_H
/**
* @macrosection
*
* Library version macros
*/
/**
* @macro
*
* Version number of the ngtcp2 library release.
*/
#define NGTCP2_VERSION "0.1.90"
#define NGTCP2_VERSION "1.6.0"
/**
* @macro
@ -40,6 +46,6 @@
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
* becomes 0x010203.
*/
#define NGTCP2_VERSION_NUM 0x00015a
#define NGTCP2_VERSION_NUM 0x010600
#endif /* VERSION_H */

4530
ngtcp2.nim

File diff suppressed because it is too large Load Diff

View File

@ -6,4 +6,4 @@ license = "MIT"
installDirs = @["sources", "build"]
installFiles = @["ngtcp2.nim"]
requires "nim >= 1.2.6"
requires "nim >= 1.6.0"

View File

@ -6,6 +6,8 @@ import nativesockets
when defined(windows):
{.passl: "-lws2_32".}
else:
{.passC: "-DHAVE_UNISTD_H".}
# C include directories
const root = currentSourcePath.parentDir

@ -1 +1 @@
Subproject commit 0108324d983715da607918dad13153a024445e66
Subproject commit 5f8bd54ad7e46d9d210b5caae70566d43c99a88a

View File

@ -3,6 +3,9 @@ import ngtcp2
test "default settings":
var settings: ngtcp2_settings
ngtcp2_settings_default(addr settings)
check settings.transport_params.max_udp_payload_size > 0
check settings.transport_params.active_connection_id_limit > 0
ngtcp2_settings_default_versioned(NGTCP2_SETTINGS_V2, addr settings)
check settings.max_tx_udp_payload_size > 0
var transport_params: ngtcp2_transport_params
ngtcp2_transport_params_default_versioned(NGTCP2_TRANSPORT_PARAMS_V1, addr transport_params)
check transport_params.active_connection_id_limit > 0