[hobbit] Mutiple tests for the same webpage but on diferent hosts (cluster) with bbgen

Henrik Stoerner henrik at hswn.dk
Sat Apr 2 09:34:36 CEST 2005


On Fri, Apr 01, 2005 at 07:29:30PM -0300, Werner Michels (Ext Lists) wrote:

> 	My install is Redhat based with BB 1.9e + bbgen version 2.15

That's a fairly ancient version of bbgen. I would of course suggest an upgrade.

> 10.10.0.200 member1-www2.somesite.com     # NAME:"10.10.0.200" http://www2.somesite.com=10.10.0.200/test.htm
> 10.10.0.201 member2-www2.somesite.com     # NAME:"10.10.0.201" http://www2.somesite.com=10.10.0.201/test.htm
> 10.10.0.202 member3-www2.somesite.com     # NAME:"10.10.0.202" http://www2.somesite.com=10.10.0.202/test.htm
> 
>          The result (seen on tcpdump'ing the http connections) is that
>          BB+bbgen test 3 times the first of these tree hosts
>          (10.10.0.200)

Yep, it's a bug. The attached patch should fix it.
(Note to the Hobbit users: This is not relevant for you).


Henrik
-------------- next part --------------
diff -u bbgen-2.15.orig/httptest.c bbgen-2.15/httptest.c
--- bbgen-2.15.orig/httptest.c	2004-02-06 12:40:46.000000000 +0100
+++ bbgen-2.15/httptest.c	2005-04-02 09:26:51.532294272 +0200
@@ -433,7 +433,8 @@
 			 * IP-address inside the URL, and set a "Host:" header
 			 * so that virtual webhosts will work.
 			 */
-			curl_easy_setopt(req->curl, CURLOPT_URL, urlip(req->url, req->ip, NULL));
+			req->fakeurl = strdup(urlip(req->url, req->ip, NULL));
+			curl_easy_setopt(req->curl, CURLOPT_URL, req->fakeurl);
 			req->slist = curl_slist_append(req->slist, req->hosthdr);
 			curl_easy_setopt(req->curl, CURLOPT_HTTPHEADER, req->slist);
 		}
diff -u bbgen-2.15.orig/httptest.h bbgen-2.15/httptest.h
--- bbgen-2.15.orig/httptest.h	2004-02-06 12:40:46.000000000 +0100
+++ bbgen-2.15/httptest.h	2005-04-02 09:25:02.743109705 +0200
@@ -37,6 +37,7 @@
 	int    is_ftp;                  /* Set if URL is an FTP request */
 	int    httpver;                 /* If we must do only HTTP 1.0 */
 	char   *hosthdr;                /* Host: header for ip-based test */
+	char   *fakeurl;                /* Fake URL for IP-based test */
 	char   *postdata;               /* Form POST data CURLOPT_POSTFIELDS */
 	int    sslversion;		/* SSL version CURLOPT_SSLVERSION */
 	char   *ciphers; 	   	/* SSL ciphers CURLOPT_SSL_CIPHER_LIST */


More information about the Xymon mailing list