@@ -282,8 +282,8 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
282282 "%s"
283283 "\r\n" ,
284284 hostname , remote_port ,
285- (data -> bits .proxy_user_passwd )?data -> ptr_proxyuserpwd :"" ,
286- (data -> useragent ?data -> ptr_uagent :"" )
285+ (data -> bits .proxy_user_passwd )?conn -> allocptr . proxyuserpwd :"" ,
286+ (data -> useragent ?conn -> allocptr . uagent :"" )
287287 );
288288
289289 /* wait for the proxy to send us a HTTP/1.0 200 OK header */
@@ -405,9 +405,9 @@ CURLcode Curl_http(struct connectdata *conn)
405405 have been used in the proxy connect, but if we have got a header with
406406 the user-agent string specified, we erase the previously made string
407407 here. */
408- if (checkheaders (data , "User-Agent:" ) && data -> ptr_uagent ) {
409- free (data -> ptr_uagent );
410- data -> ptr_uagent = NULL ;
408+ if (checkheaders (data , "User-Agent:" ) && conn -> allocptr . uagent ) {
409+ free (conn -> allocptr . uagent );
410+ conn -> allocptr . uagent = NULL ;
411411 }
412412
413413 if ((data -> bits .user_passwd ) && !checkheaders (data , "Authorization:" )) {
@@ -421,23 +421,23 @@ CURLcode Curl_http(struct connectdata *conn)
421421 sprintf (data -> buffer , "%s:%s" , data -> user , data -> passwd );
422422 if (Curl_base64_encode (data -> buffer , strlen (data -> buffer ),
423423 & authorization ) >= 0 ) {
424- if (data -> ptr_userpwd )
425- free (data -> ptr_userpwd );
426- data -> ptr_userpwd = aprintf ( "Authorization: Basic %s\015\012" ,
424+ if (conn -> allocptr . userpwd )
425+ free (conn -> allocptr . userpwd );
426+ conn -> allocptr . userpwd = aprintf ( "Authorization: Basic %s\015\012" ,
427427 authorization );
428428 free (authorization );
429429 }
430430 }
431431 }
432432 if ((data -> bits .http_set_referer ) && !checkheaders (data , "Referer:" )) {
433- if (data -> ptr_ref )
434- free (data -> ptr_ref );
435- data -> ptr_ref = aprintf ("Referer: %s\015\012" , data -> referer );
433+ if (conn -> allocptr . ref )
434+ free (conn -> allocptr . ref );
435+ conn -> allocptr . ref = aprintf ("Referer: %s\015\012" , data -> referer );
436436 }
437437 if (data -> cookie && !checkheaders (data , "Cookie:" )) {
438- if (data -> ptr_cookie )
439- free (data -> ptr_cookie );
440- data -> ptr_cookie = aprintf ("Cookie: %s\015\012" , data -> cookie );
438+ if (conn -> allocptr . cookie )
439+ free (conn -> allocptr . cookie );
440+ conn -> allocptr . cookie = aprintf ("Cookie: %s\015\012" , data -> cookie );
441441 }
442442
443443 if (data -> cookies ) {
@@ -457,17 +457,18 @@ CURLcode Curl_http(struct connectdata *conn)
457457 }
458458
459459 if (!checkheaders (data , "Host:" ) &&
460- !data -> ptr_host ) {
460+ !conn -> allocptr . host ) {
461461 /* if ptr_host is already set, it is OK since we only re-use connections
462462 to the very same host and port */
463463
464464 if (((conn -> protocol & PROT_HTTPS ) && (data -> remote_port == PORT_HTTPS )) ||
465465 (!(conn -> protocol & PROT_HTTPS ) && (data -> remote_port == PORT_HTTP )) )
466466 /* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include
467467 the port number in the host string */
468- data -> ptr_host = aprintf ("Host: %s\r\n" , host );
468+ conn -> allocptr . host = aprintf ("Host: %s\r\n" , host );
469469 else
470- data -> ptr_host = aprintf ("Host: %s:%d\r\n" , host , data -> remote_port );
470+ conn -> allocptr .host = aprintf ("Host: %s:%d\r\n" , host ,
471+ data -> remote_port );
471472 }
472473
473474 if (!checkheaders (data , "Pragma:" ))
@@ -541,22 +542,22 @@ CURLcode Curl_http(struct connectdata *conn)
541542 */
542543 if ((data -> httpreq == HTTPREQ_GET ) &&
543544 !checkheaders (data , "Range:" )) {
544- data -> ptr_rangeline = aprintf ("Range: bytes=%s\r\n" , data -> range );
545+ conn -> allocptr . rangeline = aprintf ("Range: bytes=%s\r\n" , data -> range );
545546 }
546547 else if ((data -> httpreq != HTTPREQ_GET ) &&
547548 !checkheaders (data , "Content-Range:" )) {
548549
549550 if (data -> resume_from ) {
550551 /* This is because "resume" was selected */
551552 long total_expected_size = data -> resume_from + data -> infilesize ;
552- data -> ptr_rangeline = aprintf ("Content-Range: bytes %s%ld/%ld\r\n" ,
553+ conn -> allocptr . rangeline = aprintf ("Content-Range: bytes %s%ld/%ld\r\n" ,
553554 data -> range , total_expected_size - 1 ,
554555 total_expected_size );
555556 }
556557 else {
557558 /* Range was selected and then we just pass the incoming range and
558559 append total size */
559- data -> ptr_rangeline = aprintf ("Content-Range: bytes %s/%d\r\n" ,
560+ conn -> allocptr . rangeline = aprintf ("Content-Range: bytes %s/%d\r\n" ,
560561 data -> range , data -> infilesize );
561562 }
562563 }
@@ -572,7 +573,7 @@ CURLcode Curl_http(struct connectdata *conn)
572573 /* add the main request stuff */
573574 add_bufferf (req_buffer ,
574575 "%s " /* GET/HEAD/POST/PUT */
575- "%s HTTP/1.0 \r\n" /* path */
576+ "%s HTTP/1.1 \r\n" /* path */
576577 "%s" /* proxyuserpwd */
577578 "%s" /* userpwd */
578579 "%s" /* range */
@@ -588,15 +589,15 @@ CURLcode Curl_http(struct connectdata *conn)
588589 (data -> bits .http_post || data -> bits .http_formpost )?"POST" :
589590 (data -> bits .http_put )?"PUT" :"GET" ),
590591 ppath ,
591- (data -> bits .proxy_user_passwd && data -> ptr_proxyuserpwd )? data -> ptr_proxyuserpwd :"" ,
592- (data -> bits .user_passwd && data -> ptr_userpwd )? data -> ptr_userpwd :"" ,
593- (data -> bits .set_range && data -> ptr_rangeline )? data -> ptr_rangeline :"" ,
594- (data -> useragent && * data -> useragent && data -> ptr_uagent )? data -> ptr_uagent :"" ,
595- (data -> ptr_cookie ? data -> ptr_cookie :"" ), /* Cookie: <data> */
596- (data -> ptr_host ? data -> ptr_host :"" ), /* Host: host */
592+ (data -> bits .proxy_user_passwd && conn -> allocptr . proxyuserpwd )? conn -> allocptr . proxyuserpwd :"" ,
593+ (data -> bits .user_passwd && conn -> allocptr . userpwd )? conn -> allocptr . userpwd :"" ,
594+ (data -> bits .set_range && conn -> allocptr . rangeline )? conn -> allocptr . rangeline :"" ,
595+ (data -> useragent && * data -> useragent && conn -> allocptr . uagent )? conn -> allocptr . uagent :"" ,
596+ (conn -> allocptr . cookie ? conn -> allocptr . cookie :"" ), /* Cookie: <data> */
597+ (conn -> allocptr . host ? conn -> allocptr . host :"" ), /* Host: host */
597598 http -> p_pragma ?http -> p_pragma :"" ,
598599 http -> p_accept ?http -> p_accept :"" ,
599- (data -> bits .http_set_referer && data -> ptr_ref )? data -> ptr_ref :"" /* Referer: <data> <CRLF> */
600+ (data -> bits .http_set_referer && conn -> allocptr . ref )? conn -> allocptr . ref :"" /* Referer: <data> <CRLF> */
600601 );
601602
602603 if (co ) {
0 commit comments