Skip to content

Commit 294c172

Browse files
committed
feature freeze for 0.5.0 release
1 parent 3727b13 commit 294c172

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ SEXP nano_decode(void *buf, size_t sz, const int mod, const int kpr) {
502502
SET_STRING_ELT(data, i, onechar);
503503
if (Rf_xlength(onechar) > 0) m++;
504504
}
505-
SETLENGTH(data, m);
505+
data = Rf_xlengthgets(data, m);
506506
UNPROTECT(1);
507507
} else {
508508
size_t size;

tests/tests.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ nanotest(identical(call_aio(n), n))
6969
nanotest(is_aio(n) == FALSE)
7070
sraio <- n$send_aio(as.raw(0L), mode = "r", timeout = 200)
7171
rraio <- n$recv_aio(mode = "r", timeout = 200)
72+
nanotestn(call_aio(rraio)$data)
7273
sraio <- n$send_aio(as.raw(1L), mode = "ra", timeout = 200)
7374
rraio <- n$recv_aio(mode = "ra", timeout = 200)
7475
sraio <- n$send_aio(as.raw(2L), mode = "raw", timeout = 200)
@@ -151,9 +152,11 @@ nanotest(close(sock2) == 0L)
151152
nanotestwn(ncurl("http://www.cam.ac.uk/"))
152153
nanotestwn(ncurl("http://httpbin.org/post", convert = FALSE, method = "POST", headers = c(`Content-Type` = "text/plain"), data = "test"))
153154
nanotestwn(ncurl("http://httpbin.org/post", convert = FALSE, method = "POST", headers = list(`Content-Type` = "text/plain")))
154-
nanotestwn(ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = c(Authorization = "Bearer token"), data = "test"))
155-
put <- ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = list(Authorization = "Bearer token"))
156-
nanotest(is.null(stop_aio(put)))
155+
put1 <- ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = c(Authorization = "Bearer token"), data = "test")
156+
nanotestn(put1$raw)
157+
put2 <- ncurl("http://httpbin.org/put", async = TRUE, method = "PUT", headers = list(Authorization = "Bearer token"))
158+
nanotestn(call_aio(put2)$data)
159+
nanotest(is.null(stop_aio(put2)))
157160
nanotestwn(stream(dial = "tcp://127.0.0.1:5555"))
158161

159162
nanotest(is.character(ver <- nng_version()) && length(ver) == 2L)

0 commit comments

Comments
 (0)