r293 - trunk/varnish-tools/fetcher

des at projects.linpro.no des at projects.linpro.no
Tue Jul 4 14:03:13 CEST 2006


Author: des
Date: 2006-07-04 14:03:13 +0200 (Tue, 04 Jul 2006)
New Revision: 293

Modified:
   trunk/varnish-tools/fetcher/fetcher.c
Log:
Add some comments.

Modified: trunk/varnish-tools/fetcher/fetcher.c
===================================================================
--- trunk/varnish-tools/fetcher/fetcher.c	2006-07-04 12:01:44 UTC (rev 292)
+++ trunk/varnish-tools/fetcher/fetcher.c	2006-07-04 12:03:13 UTC (rev 293)
@@ -51,6 +51,7 @@
 	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 @@
 		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 @@
 				errx(1, "connection prematurely closed");
 	}
 	fclose(f);
+
 	exit(0);
 }




More information about the varnish-commit mailing list