Skip to content

Commit d57f452

Browse files
committed
update libmbedtls and libnng; adds strcat()
1 parent 831ec62 commit d57f452

21 files changed

+354
-272
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: nanonext
22
Type: Package
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4-
Version: 0.9.0.9038
4+
Version: 0.9.0.9039
55
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
66
a socket library providing high-performance scalability protocols, a
77
cross-platform standard for messaging and communications. Serves as a

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export(socket)
8484
export(stat)
8585
export(status_code)
8686
export(stop_aio)
87+
export(strcat)
8788
export(stream)
8889
export(subscribe)
8990
export(survey_time)

NEWS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# nanonext 0.9.0.9038 (development)
1+
# nanonext 0.9.0.9039 (development)
22

33
#### New Features
44

55
* Enables secure TLS transports `tls+tcp://` and `wss://` for scalability protocols.
66
+ `listen()` and `dial()` gain the argument 'tls' for supplying a TLS configuration object
77
+ `write_cert()` generates 4096 bit RSA keys and self-signed X.509 certificates for use with `tls_config()`.
8-
* `weakref()`, `weakref_key()` and `weakref_value()` implement an interface to R's weak reference system. These may be used for purposes including synchronising the lifetimes of objects or creating read-only objects.
8+
* `weakref()`, `weakref_key()` and `weakref_value()` implement an interface to R's weak reference system. These may be used for synchronising the lifetimes of objects with reference objects such as Sockets or Aios, or creating read-only objects accessible by the weakref value alone.
9+
* `strcat()` provides a simple, fast utility to concatenate two strings.
910

1011
#### Updates
1112

1213
* 'tlsConfig' objects no longer have a 'source' attribute.
1314
* Fix cases where `base64enc()` failed for objects exceeding a certain size.
1415
* `stream()` has been updated internally for additional robustness.
15-
* Updates bundled 'libmbedtls' v3.4.0 source configuration for threading support and fixes one case of undefined behaviour.
16-
* Updates bundled `libnng` cmake helper to better detect the correct version of `libmbedtls`.
16+
* Updates bundled 'libmbedtls' v3.4.0 source configuration for threading support.
17+
* Updates bundled 'libnng' to v1.6.0 alpha (c5e9d8a) again, having resolved previous issues.
1718

1819
# nanonext 0.9.0
1920

R/messenger.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,28 @@ messenger <- function(url, auth = NULL) {
6464
cat("\r", `length<-`(intro, i), sep = " ", file = stdout())
6565
msleep(32L)
6666
}
67-
cat(sprintf("\n| url: %s\n", url), file = stdout())
67+
cat(strcat("\n| url: ", url), file = stdout())
6868

6969
s <- send(sock, data = writeBin(":c ", raw()), mode = 2L, block = FALSE)
7070
if (s) {
7171
length(attr(sock, "dialer")) && {
72-
cat("| connection error... exiting\n", file = stderr())
72+
cat("\n| connection error... exiting\n", file = stderr())
7373
return(invisible())
7474
}
75-
cat(sprintf("| peer offline: %s\n", format.POSIXct(Sys.time())), file = stderr())
75+
cat(strcat("\n| peer offline: ", format.POSIXct(Sys.time())), file = stderr())
7676
} else {
77-
cat(sprintf("| peer online: %s\n", format.POSIXct(Sys.time())), file = stderr())
77+
cat(strcat("\n| peer online: ", format.POSIXct(Sys.time())), file = stderr())
7878
r <- recv(sock, mode = 5L, block = TRUE)
7979
for (i in seq_len(32L))
8080
lock[r[i]] == r[i + 32L] || {
81-
cat("| authentication failed\n", file = stderr())
81+
cat("\n| authentication failed\n", file = stderr())
8282
return(invisible())
8383
}
84-
cat("| authenticated\n", file = stderr())
84+
cat("\n| authenticated", file = stderr())
8585
}
8686

8787
sock <- .Call(rnng_messenger_thread_create, list(sock, key))
88-
cat("type your message:\n", file = stdout())
88+
cat("\ntype your message:\n", file = stdout())
8989

9090
repeat {
9191
data <- readline()

R/tls.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
#' 'client' to create a client configuration or 'server' to create a server
2323
#' configuration.
2424
#'
25-
#' @param client \strong{either} the absolute path to a file containing X.509
25+
#' @param client \strong{either} the character path to a file containing X.509
2626
#' certificate(s) in PEM format, comprising the certificate authority
2727
#' certificate chain (and revocation list if present), used to validate
2828
#' certificates presented by peers,
2929
#'
3030
#' \strong{or} a length 2 character vector comprising [i] the certificate
3131
#' authority certificate chain and [ii] the certificate revocation list or
3232
#' the empty character \code{""} if not applicable.
33-
#' @param server \strong{either} the absolute path to a single file containing
33+
#' @param server \strong{either} the character path to a file containing
3434
#' the PEM encoded certificate and associated private key (may contain
3535
#' additional certificates leading to a validation chain, with the leaf
3636
#' certificate first, although the self-signed root is not required as the
@@ -270,4 +270,4 @@ base64dec <- function(x, convert = TRUE) .Call(rnng_base64dec, x, convert)
270270
#' @export
271271
#'
272272
write_cert <- function(cn = "localhost", valid = "20301231235959")
273-
.Call(rnng_cert_write, cn, valid, interactive())
273+
.Call(rnng_write_cert, cn, valid, interactive())

R/utils.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,22 @@ status_code <- function(x) .Call(rnng_status_code, x)
276276
#' @keywords internal
277277
#'
278278
nng_fini <- function() invisible(.Call(rnng_fini))
279+
280+
#' Concatenate 2 Strings
281+
#'
282+
#' A fast implementation that simply combines two strings into one.
283+
#'
284+
#' @param a character value.
285+
#' @param b character value.
286+
#'
287+
#' @return A character vector of length 1.
288+
#'
289+
#' @details If either 'a' or 'b' is a vector of length greater than 1, only the
290+
#' first element of each is concatenated.
291+
#'
292+
#' @examples
293+
#' strcat("hello ", "world!")
294+
#'
295+
#' @export
296+
#'
297+
strcat <- function(a, b) .Call(rnng_strcat, a, b)

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Library versions
4-
LIB_VER="8e1836f"
4+
LIB_VER="c5e9d8a"
55
TLS_VER="1873d3b"
66

77
# Initialise

configure.ucrt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Library versions
2-
LIB_VER="8e1836f"
2+
LIB_VER="c5e9d8a"
33
TLS_VER="1873d3b"
44

55
tar -xf inst/mbedtls-$TLS_VER.tar.xz

inst/mbedtls-1873d3b.tar.xz

80 Bytes
Binary file not shown.

inst/nng-8e1836f.tar.xz

-217 KB
Binary file not shown.

0 commit comments

Comments
 (0)