3 Commits

Author SHA1 Message Date
Diego
23f26c2127 change version to 0.34.0 2024-08-16 13:47:54 +02:00
diegomrsantos
024ce6202c chore: upgrade ngtcp2 to 1.6.0 (#6)
Upgrades ngtcp2 to 1.6.0 with all the necessary fixes.
2024-08-16 13:35:36 +02:00
Tanguy
76bf92475f Style check fixes (#5)
* Style check fixes
* ngtcp2.nim generation
* fix ci
2022-08-26 12:03:55 +02:00
10 changed files with 3498 additions and 2384 deletions

View File

@@ -12,7 +12,9 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: iffy/install-nim@v1.1
- 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,9 @@ 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"
sed -i 's/\bpassC\b/passc/g' 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 */

5
config.nims Normal file
View File

@@ -0,0 +1,5 @@
--styleCheck:usages
if (NimMajor, NimMinor) < (1, 6):
--styleCheck:hint
else:
--styleCheck:error

5834
ngtcp2.nim

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
packageName = "ngtcp2"
version = "0.32.0"
version = "0.34.0"
author = "Status Research & Development GmbH"
description = "Nim wrapper around the ngtcp2 library"
license = "MIT"
installDirs = @["sources", "build"]
installFiles = @["ngtcp2.nim"]
requires "nim >= 1.2.6"
requires "nim >= 1.6.0"

View File

@@ -5,11 +5,13 @@ import strformat
import nativesockets
when defined(windows):
{.passL: "-lws2_32".}
{.passl: "-lws2_32".}
else:
{.passC: "-DHAVE_UNISTD_H".}
# C include directories
const root = currentSourcePath.parentDir
const sourceInclude = root/"sources"/"lib"/"includes"
const buildInclude = root/"build"/"lib"/"includes"
{.passC: fmt"-I{sourceInclude} -I{buildInclude}".}
{.passc: fmt"-I{sourceInclude} -I{buildInclude}".}

Submodule sources updated: 0108324d98...5f8bd54ad7

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