From 90786eb073e9bd84ef2d5e732621b73d8473eaad Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 24 Dec 2013 12:59:36 -0500 Subject: [PATCH] Small tweaks to https-client.c --- sample/https-client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sample/https-client.c b/sample/https-client.c index 0f5e8f8e..6597f119 100644 --- a/sample/https-client.c +++ b/sample/https-client.c @@ -183,7 +183,8 @@ main(int argc, char **argv) int r; struct evhttp_uri *http_uri; - const char *url = 0, *scheme, *host, *path, *query, *data_file = 0; + const char *url = NULL, *data_file = NULL; + const char *scheme, *host, *path, *query; char uri[256]; int port; @@ -353,6 +354,9 @@ main(int argc, char **argv) evhttp_add_header(output_headers, "Connection", "close"); if (data_file) { + /* NOTE: In production code, you'd probably want to use + * evbuffer_add_file() or evbuffer_add_file_segment(), to + * avoid needless copying. */ FILE * f = fopen(data_file, "rb"); char buf[1024]; ssize_t s; -- 2.40.0