aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-01 15:34:07 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-01 15:34:07 -0800
commit6cd521d5e68318ab3a93cb0e9cd4ee793576a643 (patch)
treebd39781e8480b0141fc1bfd0277f0fd8c1d0e24e
parent3e6657600104c37bdefb8160ab983af0d37eeb7f (diff)
downloadnng-6cd521d5e68318ab3a93cb0e9cd4ee793576a643.tar.gz
nng-6cd521d5e68318ab3a93cb0e9cd4ee793576a643.tar.bz2
nng-6cd521d5e68318ab3a93cb0e9cd4ee793576a643.zip
demo: call nng_init in http_client
-rw-r--r--demo/http_client/http_client.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/demo/http_client/http_client.c b/demo/http_client/http_client.c
index a00c842f..a18725a9 100644
--- a/demo/http_client/http_client.c
+++ b/demo/http_client/http_client.c
@@ -49,15 +49,15 @@ int
main(int argc, char **argv)
{
nng_http_client *client;
- nng_http_conn * conn;
- nng_url * url;
- nng_aio * aio;
- nng_http_req * req;
- nng_http_res * res;
- const char * hdr;
+ nng_http_conn *conn;
+ nng_url *url;
+ nng_aio *aio;
+ nng_http_req *req;
+ nng_http_res *res;
+ const char *hdr;
int rv;
int len;
- void * data;
+ void *data;
nng_iov iov;
if (argc < 2) {
@@ -65,7 +65,8 @@ main(int argc, char **argv)
exit(1);
}
- if (((rv = nng_url_parse(&url, argv[1])) != 0) ||
+ if (((rv = nng_init(NULL)) != 0) ||
+ ((rv = nng_url_parse(&url, argv[1])) != 0) ||
((rv = nng_http_client_alloc(&client, url)) != 0) ||
((rv = nng_http_req_alloc(&req, url)) != 0) ||
((rv = nng_http_res_alloc(&res)) != 0) ||