[httperf] Request with particular host header
Martin Arlitt
arlitt at granite.hpl.hp.com
Mon Jan 12 16:43:16 PST 2004
Prasanna
I think you've discovered a bug in httperf. the following change (and a
recompile) should fix the problem:
------------------------------------------------------------------------ $
diff -urN core.c~ core.c --- core.c~ 2000-10-31 16:57:50.000000000 -0700
+++ core.c 2004-01-12 13:14:44.000000000 -0700 @@ -970,8 +970,8 @@
else if (!call->req.iov[IE_HOST].iov_base)
{
/* Default call's hostname to connection's hostname: */
- call->req.iov[IE_HOST].iov_base = (caddr_t) conn->hostname;
- call->req.iov[IE_HOST].iov_len = conn->hostname_len;
+ call->req.iov[IE_HOST].iov_base = (caddr_t) conn->fqdname;
+ call->req.iov[IE_HOST].iov_len = conn->fqdname_len;
}
/* NOTE: the protocol version indicates what the _client_ can
------------------------------------------------------------------------
(i.e., change "conn->hostname" to "conn->fqdname" on line 973 of core.c,
and "conn->hostname_len" to "conn->fqdname_len" on line 974)
Martin
On Wed, 7 Jan 2004, Laghate, Prasanna wrote:
> How do I make a request which goes to server 1.2.3.4, but with a hostheader
> "x.y.com"?
>
> The following request:
> httperf --server=1.2.3.4 --server-name="x.y.com" --uri=/index.html
> --print-request
>
> gives:
> SH0:GET /index.html HTTP/1.1
> SH0:User-Agent: httperf/0.8
> SH0:Host: 1.2.3.4
>
> whereas I want:
> SH0:GET /index.html HTTP/1.1
> SH0:User-Agent: httperf/0.8
> SH0:Host: x.y.com
>
> Thanks,
> Prasanna
> _______________________________________________
> httperf mailing list
> httperf at linux.hpl.hp.com
> http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/httperf
>
More information about the httperf
mailing list