CONNECT response headers are now passed back as "regular" headers

This commit is contained in:
Daniel Stenberg 2004-01-27 12:54:22 +00:00
parent 7d15651115
commit dc932f739a
7 changed files with 68 additions and 5 deletions

10
CHANGES
View File

@ -6,7 +6,17 @@
Changelog
Daniel(27 January 2004)
- Made the response-headers during a CONNECT request to a proxy get passed on
as regular headers, so they appear with -i/-I options and similar.
- Based on a patch by Gisle Vanem, I've made the progress meter display
properly switch to a GB-display when more than 9999MB have been transfered.
Daniel(23 January 2004)
- Gisle Vanem pointed out a curlrc parser problem/crash when an option with a
required didn't have one and was on the last line of a file.
- More Windows fixes for large files. We now build and link with
../lib/strtoofft.c in the app code since Curl_strtoll() is not a provided
libcurl function... Perhaps we should consider a 'common' dir or similar

View File

@ -869,6 +869,21 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
perline++; /* amount of bytes in this line so far */
if(*ptr=='\n') {
char letter;
int writetype;
/* output debug output if that is requested */
if(data->set.verbose)
Curl_debug(data, CURLINFO_HEADER_IN, line_start, perline);
/* send the header to the callback */
writetype = CLIENTWRITE_HEADER;
if(data->set.http_include_header)
writetype |= CLIENTWRITE_BODY;
result = Curl_client_write(data, writetype, line_start, perline);
if(result)
return result;
/* Newlines are CRLF, so the CR is ignored as the line isn't
really terminated until the LF comes. Treat a following CR
as end-of-headers as well.*/
@ -880,10 +895,6 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
break; /* breaks out of for-loop, not switch() */
}
/* output debug output if that is requested */
if(data->set.verbose)
Curl_debug(data, CURLINFO_HEADER_IN, line_start, perline);
/* keep a backup of the position we are about to blank */
letter = line_start[perline];
line_start[perline]=0; /* zero terminate the buffer */

View File

@ -8,6 +8,15 @@ Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
</data>
<datacheck>
HTTP/1.1 200 Mighty fine indeed
HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
ETag: "21025-dc7-39462498"
</datacheck>
</reply>
# Client-side

View File

@ -10,6 +10,17 @@ Funny-head: yesyes
contents
</data>
<datacheck>
HTTP/1.1 200 Mighty fine indeed
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
contents
</datacheck>
</reply>
#

View File

@ -9,7 +9,7 @@ Content-Length: 34
Proxy-Authenticate: NTLM
This is not the real page either!
</data1001>
</data>
</reply>

View File

@ -10,6 +10,17 @@ Funny-head: yesyes
contents
</data>
<datacheck>
HTTP/1.1 200 Mighty fine indeed
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
contents
</datacheck>
</reply>
#

View File

@ -10,6 +10,17 @@ Funny-head: yesyes
contents
</data>
<datacheck>
HTTP/1.1 200 Mighty fine indeed
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake swsclose
Content-Type: text/html
Funny-head: yesyes
contents
</datacheck>
</reply>
#