Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1630)

Delta Between Two Patch Sets: src/pkg/net/http/transport.go

Issue 5449070: code review 5449070: net: shorten composite literal field values (Closed)
Left Patch Set: Created 12 years, 4 months ago
Right Patch Set: diff -r f91f50b96e10 https://go.googlecode.com/hg/ Created 12 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // HTTP client implementation. See RFC 2616. 5 // HTTP client implementation. See RFC 2616.
6 //· 6 //·
7 // This is the low-level Transport implementation of RoundTripper. 7 // This is the low-level Transport implementation of RoundTripper.
8 // The high-level interface is in client.go. 8 // The high-level interface is in client.go.
9 9
10 package http 10 package http
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 case cm.targetScheme == "http": 325 case cm.targetScheme == "http":
326 pconn.isProxy = true 326 pconn.isProxy = true
327 if pa != "" { 327 if pa != "" {
328 pconn.mutateHeaderFunc = func(h Header) { 328 pconn.mutateHeaderFunc = func(h Header) {
329 h.Set("Proxy-Authorization", pa) 329 h.Set("Proxy-Authorization", pa)
330 } 330 }
331 } 331 }
332 case cm.targetScheme == "https": 332 case cm.targetScheme == "https":
333 connectReq := &Request{ 333 connectReq := &Request{
334 Method: "CONNECT", 334 Method: "CONNECT",
335 » » » URL: &url.URL{RawPath: cm.targetAddr}, 335 » » » URL: {RawPath: cm.targetAddr},
gri 2011/12/02 23:06:26 I'd leave this file alone - no real win
336 Host: cm.targetAddr, 336 Host: cm.targetAddr,
337 Header: make(Header), 337 Header: make(Header),
338 } 338 }
339 if pa != "" { 339 if pa != "" {
340 connectReq.Header.Set("Proxy-Authorization", pa) 340 connectReq.Header.Set("Proxy-Authorization", pa)
341 } 341 }
342 connectReq.Write(conn) 342 connectReq.Write(conn)
343 343
344 // Read response. 344 // Read response.
345 // Okay to use and discard buffered reader here, because 345 // Okay to use and discard buffered reader here, because
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 731
732 // discardOnCloseReadCloser consumes all its input on Close. 732 // discardOnCloseReadCloser consumes all its input on Close.
733 type discardOnCloseReadCloser struct { 733 type discardOnCloseReadCloser struct {
734 io.ReadCloser 734 io.ReadCloser
735 } 735 }
736 736
737 func (d *discardOnCloseReadCloser) Close() error { 737 func (d *discardOnCloseReadCloser) Close() error {
738 io.Copy(ioutil.Discard, d.ReadCloser) // ignore errors; likely invalid o r already closed 738 io.Copy(ioutil.Discard, d.ReadCloser) // ignore errors; likely invalid o r already closed
739 return d.ReadCloser.Close() 739 return d.ReadCloser.Close()
740 } 740 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b