cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Getting multiple Host: headers

From: Brian Akins <bakins_at_web.turner.com>
Date: Fri, 23 Jul 2004 09:05:05 -0400

Daniel Stenberg wrote:

>
> Can you write a small program that repeats this behaviour and post it
> here?
>
Sure. See attached. It's a modified getmemory from examples.

Here's some output:
----------------------------------------------------------------------
i = 0
debug_callback: About to connect() to cnnsquid6 port 80
debug_callback: Connected to cnnsquid6 (10.165.7.16) port 80
debug_callback: GET /pixel.gif HTTP/1.1
Host: cnnsquid6
Pragma: no-cache
Accept: */*
User-Agent: Mozilla Something

debug_callback: Connection #0 to host cnnsquid6 left intact
----------------------------------------------------------------------
i = 1
debug_callback: Re-using existing connection! (#0) with host cnnsquid6
debug_callback: Connected to cnnsquid6 (10.165.7.16) port 80
debug_callback: GET /euro?this=that HTTP/1.1
Host: cnnsquid6
Pragma: no-cache
Accept: */*
Host: www.cnn.com
User-Agent: Mozilla Something

debug_callback: Connection #0 to host cnnsquid6 left intact
---------------------------------------------------------------------------

Notice the double Host headers.

This only happens after the first request on a keep-alive connection
when I try to override the Host header.

The way the app works, it opens x number of curl handles to some backend
servers. It does a "ping" request to make sure the handle is good.
Then the handle is used for other user requests.

-- 
Brian Akins
Senior Systems Engineer
CNN Internet Technologies

Received on 2004-07-23