Skip to content

Commit 10ec8f9

Browse files
committed
keep at NNG 1.5.2 for release
1 parent a1288f1 commit 10ec8f9

File tree

6 files changed

+17
-20
lines changed

6 files changed

+17
-20
lines changed

NEWS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88
#### Updates
99

10-
* NNG library used for building from source (and on Windows) updated to 1.6.0 pre-release.
1110
* Setting 'NANONEXT_TLS=1' now allows the downloaded NNG library to be built against a system mbedtls installation.
1211
* Deprecated `send_ctx()`, `recv_ctx()` and logging are removed.
13-
* Internal performance optimisations.
12+
* All-round internal performance optimisations.
1413

1514
# nanonext 0.4.0
1615

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ This is available in system package repositories as:
463463

464464
A system installation of 'libnng' in the standard filesystem locations will be detected and used if possible.
465465

466-
Otherwise, a suitable recent version of 'libnng' will be downloaded and built from source automatically during package installation (note: this requires 'cmake').
466+
Otherwise, the latest release version of 'libnng' will be downloaded and built from source automatically during package installation (note: this requires 'cmake').
467467

468468
#### Windows
469469

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ aio
379379
#> < recvAio >
380380
#> - $data for message data
381381
aio$data |> str()
382-
#> num [1:100000000] 2.698 0.0645 -1.0922 2.1422 0.8848 ...
382+
#> num [1:100000000] 0.112 0.003 2.633 -0.609 -0.476 ...
383383
```
384384

385385
As `call_aio()` is blocking and will wait for completion, an alternative
@@ -516,11 +516,11 @@ ncurl("http://httpbin.org/headers")
516516
#> [1] 7b 0a 20 20 22 68 65 61 64 65 72 73 22 3a 20 7b 0a 20 20 20 20 22 48 6f 73
517517
#> [26] 74 22 3a 20 22 68 74 74 70 62 69 6e 2e 6f 72 67 22 2c 20 0a 20 20 20 20 22
518518
#> [51] 58 2d 41 6d 7a 6e 2d 54 72 61 63 65 2d 49 64 22 3a 20 22 52 6f 6f 74 3d 31
519-
#> [76] 2d 36 32 36 37 31 36 30 32 2d 32 35 64 63 33 32 39 63 30 39 35 34 64 36 33
520-
#> [101] 39 37 37 62 34 30 35 32 39 22 0a 20 20 7d 0a 7d 0a
519+
#> [76] 2d 36 32 36 38 37 33 65 39 2d 36 66 33 37 32 32 39 34 32 61 34 31 39 31 36
520+
#> [101] 35 30 35 37 31 38 35 33 31 22 0a 20 20 7d 0a 7d 0a
521521
#>
522522
#> $data
523-
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-62671602-25dc329c0954d63977b40529\"\n }\n}\n"
523+
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-626873e9-6f3722942a41916505718531\"\n }\n}\n"
524524
```
525525

526526
For advanced use, supports additional HTTP methods such as POST or PUT.
@@ -535,7 +535,7 @@ res
535535
#> - $raw for raw message
536536

537537
call_aio(res)$data
538-
#> [1] "{\n \"args\": {}, \n \"data\": \"{\\\"key\\\": \\\"value\\\"}\", \n \"files\": {}, \n \"form\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Length\": \"16\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-62671603-121afeba10cc694a091360a9\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"78.145.225.121\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
538+
#> [1] "{\n \"args\": {}, \n \"data\": \"{\\\"key\\\": \\\"value\\\"}\", \n \"files\": {}, \n \"form\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Length\": \"16\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-626873e9-0c5fdf1b0c8e1f21452df988\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"78.145.225.121\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
539539
```
540540

541541
In this respect, it may be used as a performant and lightweight method
@@ -594,7 +594,7 @@ This is available in system package repositories as:
594594
A system installation of ‘libnng’ in the standard filesystem locations
595595
will be detected and used if possible.
596596

597-
Otherwise, a suitable recent version of ‘libnng’ will be downloaded and
597+
Otherwise, the latest release version of ‘libnng’ will be downloaded and
598598
built from source automatically during package installation (note: this
599599
requires ‘cmake’).
600600

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ "$NANONEXT_ARM" ]; then
1414
PKG_LIBS="$PKG_LIBS -latomic"
1515
fi
1616
PKG_CFLAGS=""
17-
LIB_VER="722bf46"
17+
LIB_VER="169221d"
1818
SYS_LIB=0
1919

2020
# Check for custom locations

src/core.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ SEXP rnng_recv(SEXP socket, SEXP mode, SEXP block, SEXP keep) {
995995
mode = rnng_matcharg(mode);
996996
const int mod = *INTEGER(mode), kpr = *LOGICAL(keep);
997997
int xc;
998-
unsigned char *buf;
998+
void *buf;
999999
size_t sz;
10001000
nng_aio *aiop;
10011001
SEXP res;
@@ -1005,7 +1005,7 @@ SEXP rnng_recv(SEXP socket, SEXP mode, SEXP block, SEXP keep) {
10051005
xc = blk ? nng_recv(*sock, &buf, &sz, 1u): nng_recv(*sock, &buf, &sz, 3u);
10061006
if (xc)
10071007
return mk_error(xc);
1008-
res = nano_decode(buf, sz, mod, kpr);
1008+
res = nano_decode((unsigned char *) buf, sz, mod, kpr);
10091009
nng_free(buf, sz);
10101010

10111011
} else {
@@ -1022,9 +1022,8 @@ SEXP rnng_recv(SEXP socket, SEXP mode, SEXP block, SEXP keep) {
10221022
return mk_error(xc);
10231023
}
10241024
nng_msg *msgp = nng_aio_get_msg(aiop);
1025-
buf = (unsigned char *) nng_msg_body(msgp);
10261025
sz = nng_msg_len(msgp);
1027-
res = nano_decode(buf, sz, mod, kpr);
1026+
res = nano_decode((unsigned char *) nng_msg_body(msgp), sz, mod, kpr);
10281027
nng_msg_free(msgp);
10291028
nng_aio_free(aiop);
10301029
}
@@ -1187,7 +1186,7 @@ SEXP rnng_stream_recv(SEXP stream, SEXP mode, SEXP timeout, SEXP keep, SEXP byte
11871186

11881187
mode = rnng_matchargs(mode);
11891188
const int mod = *INTEGER(mode), kpr = *LOGICAL(keep);
1190-
const size_t xlen = Rf_asInteger(bytes);
1189+
const size_t xlen = (size_t) Rf_asInteger(bytes);
11911190
nng_duration dur;
11921191
int xc;
11931192
nng_iov iov;

tools/winlibs.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# nanonext - Download precompiled libnng for Windows ---------------------------
22

3-
if (!file.exists("../windows/rwinlib-1.6.0-pre/include/nng.h")) {
3+
if (!file.exists("../windows/rwinlib-1.5.2/include/nng.h")) {
44

55
if (getRversion() < "3.3.0") setInternet2()
6-
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.6.0-pre.zip", destfile = "nng-1.6.0-pre.zip", quiet = TRUE)
6+
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.5.2.zip", destfile = "nng-1.5.2.zip", quiet = TRUE)
77
dir.create("../windows", showWarnings = FALSE)
8-
unzip("nng-1.6.0-pre.zip", exdir = "../windows")
9-
unlink("nng-1.6.0-pre.zip")
8+
unzip("nng-1.5.2.zip", exdir = "../windows")
9+
unlink("nng-1.5.2.zip")
1010

1111
}
1212

13-
# cmake -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fPIC" -G "MSYS Makefiles" -DNNG_ELIDE_DEPRECATED=1 -DNNG_TESTS=0 -DNNG_TOOLS=0 ..

0 commit comments

Comments
 (0)