From ce681752c44f792feab122cbd846b2407a42da72 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 2 Jan 2018 13:20:53 -0800 Subject: fixes #191 Several HTTP problems found First, httpbin.org was having some high latency (load) earlier today, so we needed to bump the timeout up. Next, this also uncovered a bug where our cancellation of http channels was a bit dodgy. This is changed to be a bit more robust, separating the "current" active http streams (for read or write) into separate tracking variables variables. Also, now cancellation immediately calls the aio finish for those -- there were assumptions elsewhere (expire timeouts) that cancellation caused nni_aio_finish() to be called. Finally there was a use after free bug in the websocket listener code where the listener could be freed while still having outstanding streams waiting to send the websocket reply. --- tests/httpclient.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/httpclient.c') diff --git a/tests/httpclient.c b/tests/httpclient.c index 6ea6fa6e..e377d334 100644 --- a/tests/httpclient.c +++ b/tests/httpclient.c @@ -1,6 +1,6 @@ // -// Copyright 2017 Garrett D'Amore -// Copyright 2017 Capitar IT Group BV +// Copyright 2018 Garrett D'Amore +// Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -40,7 +40,7 @@ TestMain("HTTP Client", { iaio = (nni_aio *) aio; iaio->a_addr = &rsa; - nng_aio_set_timeout(aio, 1000); + nng_aio_set_timeout(aio, 20000); nni_plat_tcp_resolv("httpbin.org", "80", NNG_AF_INET, 0, iaio); nng_aio_wait(aio); So(nng_aio_result(aio) == 0); @@ -83,7 +83,7 @@ TestMain("HTTP Client", { So(nng_aio_result(aio) == 0); So(nni_http_res_get_status(res) == 200); - Convey("The message contents are correct", { + Convey("The message contents are correct", { uint8_t digest[20]; void * data; const char *cstr; -- cgit v1.2.3-70-g09d2