Skip to content

Commit

Permalink
fixes ncurl() relocation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 22, 2023
1 parent f590ced commit 7f8c1d3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nanonext
Type: Package
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
Version: 0.10.4.9009
Version: 0.10.4.9010
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
a socket library implementing 'Scalability Protocols', a reliable,
high-performance standard for common communications patterns including
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nanonext 0.10.4.9009 (development)
# nanonext 0.10.4.9010 (development)

#### New Features

Expand All @@ -13,8 +13,9 @@
+ registered 'refhook' functions apply to external pointer type objects only.
* `until()` updated to be identical to `.until()`, returning FALSE instead of TRUE if the timeout has been reached.
* `pipe_notify()` arguments 'add', 'remove' and 'flag' now default to FALSE instead of TRUE for easier selective specification of the events to signal.
* Fixes potential segfault at `ncurl()` when the relocation address is missing and 'follow' is set to TRUE.
* The weak references interface is removed as 'non-core'.
* Applies fixes nanomsg/nng#1702 and nanomsg/nng#1705 to bundled 'libnng' v1.6.0 (a54820f).
* Applies fix nanomsg/nng#1702 to bundled 'libnng' v1.6.0 (a54820f).
* Upgrades bundled 'libmbedtls' to v 3.5.1.

# nanonext 0.10.4
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Library versions
LIB_VER="a54820f-p"
LIB_VER="a54820f-p2"
TLS_VER="edb8fec"

# Initialise
Expand Down
2 changes: 1 addition & 1 deletion configure.ucrt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Library versions
LIB_VER="a54820f-p"
LIB_VER="a54820f-p2"
TLS_VER="edb8fec"

tar -xf src/mbedtls-$TLS_VER.tar.xz
Expand Down
Binary file removed src/nng-a54820f-p.tar.xz
Binary file not shown.
Binary file added src/nng-a54820f-p2.tar.xz
Binary file not shown.
8 changes: 6 additions & 2 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,21 @@ SEXP rnng_ncurl(SEXP http, SEXP convert, SEXP follow, SEXP method, SEXP headers,
code = nng_http_res_get_status(res), relo = code >= 300 && code < 400;

if (relo && LOGICAL(follow)[0]) {
const char *location = nng_http_res_get_header(res, "Location");
if (location == NULL) goto resume;
nng_url_free(url);
xc = nng_url_parse(&url, nng_http_res_get_header(res, "Location"));
xc = nng_url_parse(&url, location);
nng_http_res_free(res);
nng_http_req_free(req);
nng_http_client_free(client);
if (xc)
mk_error_ncurl(xc);
return mk_error_ncurl(xc);
cfg = NULL;
goto relocall;
}

resume: ;

SEXP out, vec, rvec;
void *dat;
size_t sz;
Expand Down

0 comments on commit 7f8c1d3

Please sign in to comment.