Skip to content

Commit

Permalink
upgrade ngtcp2 to 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Jul 3, 2024
1 parent 929f172 commit 2fcdb8a
Show file tree
Hide file tree
Showing 7 changed files with 2,800 additions and 1,737 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions build/lib/includes/ngtcp2/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 */
4,506 changes: 2,779 additions & 1,727 deletions ngtcp2.nim

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ngtcp2.nimble
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
packageName = "ngtcp2"
version = "0.33.0"
version = "1.6.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"
2 changes: 2 additions & 0 deletions prelude.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import nativesockets

when defined(windows):
{.passl: "-lws2_32".}
else:
{.passC: "-DHAVE_UNISTD_H".}

# C include directories
const root = currentSourcePath.parentDir
Expand Down
2 changes: 1 addition & 1 deletion sources
Submodule sources updated 381 files
9 changes: 6 additions & 3 deletions tests/testNgtcp2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2fcdb8a

Please sign in to comment.