sample/http-connect: made it compatible with C90

This commit is contained in:
Azat Khuzhin 2015-08-18 21:29:03 +03:00
parent e045551558
commit f976d4360b

View File

@ -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,
};