From: Azat Khuzhin Date: Tue, 18 Aug 2015 18:29:03 +0000 (+0300) Subject: sample/http-connect: made it compatible with C90 X-Git-Tag: release-2.1.6-beta~90^2~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f976d4360bb4f80b021c6b15e41d162fce7d06eb;p=libevent sample/http-connect: made it compatible with C90 --- diff --git a/sample/http-connect.c b/sample/http-connect.c index ca29260a..980b1ee2 100644 --- a/sample/http-connect.c +++ b/sample/http-connect.c @@ -14,13 +14,13 @@ struct connect_base struct evhttp_uri *location; }; -void get_cb(struct evhttp_request *req, void *arg) +static void get_cb(struct evhttp_request *req, void *arg) { assert(req); evbuffer_write(req->input_buffer, STDOUT_FILENO); } -void connect_cb(struct evhttp_request *proxy_req, void *arg) +static void connect_cb(struct evhttp_request *proxy_req, void *arg) { char buffer[PATH_MAX]; @@ -49,6 +49,8 @@ int main(int argc, const char **argv) struct evhttp_connection *evcon; struct evhttp_request *req; + struct connect_base connect_base; + if (argc != 3) { printf("Usage: %s proxy url\n", argv[0]); return 1; @@ -80,7 +82,7 @@ int main(int argc, const char **argv) assert(base = event_base_new()); assert(evcon = evhttp_connection_base_new(base, NULL, evhttp_uri_get_host(proxy), evhttp_uri_get_port(proxy))); - struct connect_base connect_base = { + connect_base = (struct connect_base){ .evcon = evcon, .location = location, };