From 90592795a925f75b9c6745e5fbdf94f3a5536580 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 4 Jul 2006 12:03:13 +0000 Subject: [PATCH] Add some comments. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@293 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-tools/fetcher/fetcher.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/varnish-tools/fetcher/fetcher.c b/varnish-tools/fetcher/fetcher.c index b4d61ce1..12c4b571 100644 --- a/varnish-tools/fetcher/fetcher.c +++ b/varnish-tools/fetcher/fetcher.c @@ -51,6 +51,7 @@ main(void) const char *line; FILE *f; + /* connect to accelerator */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; @@ -62,12 +63,15 @@ main(void) err(1, "connect()"); if ((f = fdopen(sd, "w+")) == NULL) err(1, "fdopen()"); + for (ctr = 0; ctr < 5000; ++ctr) { fprintf(stderr, "\r%d ", ctr); + + /* send request */ + fprintf(f, req_pattern, ctr); #ifdef DEBUG fprintf(stderr, req_pattern, ctr); #endif - fprintf(f, req_pattern, ctr); /* get response header */ if ((line = read_line(f)) == NULL) @@ -95,5 +99,6 @@ main(void) errx(1, "connection prematurely closed"); } fclose(f); + exit(0); } -- 2.39.5