Home | History | Annotate | Download | only in http

Lines Matching refs:Transport

7 // This is the low-level Transport implementation of RoundTripper.
34 // DefaultTransport is the default implementation of Transport and is
39 var DefaultTransport RoundTripper = &Transport{
52 // DefaultMaxIdleConnsPerHost is the default value of Transport's
56 // Transport is an implementation of RoundTripper that supports HTTP,
59 // By default, Transport caches connections for future re-use.
61 // This behavior can be managed using Transport's CloseIdleConnections method
67 // A Transport is a low-level primitive for making HTTP and HTTPS requests.
70 // Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2
72 // and how the Transport is configured. The DefaultTransport supports HTTP/2.
73 // To explicitly enable HTTP/2 on a transport, use golang.org/x/net/http2
75 type Transport struct {
96 // then the transport dials using package net.
101 // Deprecated: Use DialContext instead, which allows the transport
131 // DisableCompression, if true, prevents the Transport from
134 // Accept-Encoding value. If the Transport requests gzip on
171 // TLSNextProto specifies how the Transport switches to an
173 // protocol negotiation. If Transport dials an TLS connection
204 func (t *Transport) onceSetNextProtoDefaults() {
210 // Transport.
223 log.Printf("Error enabling Transport HTTP/2 support: %v", err)
228 // Auto-configure the http2.Transport's MaxHeaderListSize from
229 // the http.Transport's MaxResponseHeaderBytes. They don't
232 // TODO: also add this to x/net/http2.Configure Transport, behind
292 // ProxyURL returns a proxy function (for use in a Transport)
319 func (t *Transport) RoundTrip(req *Request) (*Response, error) {
457 // ErrSkipAltProtocol is a sentinel error value defined by Transport.RegisterProtocol.
461 // The Transport will pass requests using the given scheme to rt.
467 // If rt.RoundTrip returns ErrSkipAltProtocol, the Transport will
470 func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper) {
489 func (t *Transport) CloseIdleConnections() {
514 func (t *Transport) CancelRequest(req *Request) {
519 func (t *Transport) cancelRequest(req *Request, err error) {
574 func (t *Transport) connectMethodForRequest(treq *transportRequest) (cm connectMethod, err error) {
619 // transportReadFromServerError is used by Transport.readLoop when the
626 // them to return from Transport.RoundTrip.
632 return fmt.Sprintf("net/http: Transport failed to read from server: %v", e.err)
635 func (t *Transport) putOrCloseIdleConn(pconn *persistConn) {
641 func (t *Transport) maxIdleConnsPerHost() int {
653 func (t *Transport) tryPutIdleConn(pconn *persistConn) error {
721 func (t *Transport) getIdleConnCh(cm connectMethod) chan *persistConn {
740 func (t *Transport) getIdleConn(cm connectMethod) (pconn *persistConn, idleSince time.Time) {
763 // Transport.removeIdleConn. Just skip it and
778 func (t *Transport) removeIdleConn(pconn *persistConn) {
785 func (t *Transport) removeIdleConnLocked(pconn *persistConn) {
813 func (t *Transport) setReqCanceler(r *Request, fn func(error)) {
830 func (t *Transport) replaceReqCanceler(r *Request, fn func(error)) bool {
847 func (t *Transport) dial(ctx context.Context, network, addr string) (net.Conn, error) {
854 err = errors.New("net/http: Transport.Dial hook returned (nil, nil)")
865 func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (*persistConn, error) {
967 func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (*persistConn, error) {
986 return nil, errors.New("net/http: Transport.DialTLS returned (nil, nil)")
1265 t *Transport
1286 // Both guarded by Transport.idleMu:
1410 // up to Transport.RoundTrip method when persistConn.roundTrip sees
1435 return fmt.Errorf("net/http: HTTP/1.x transport connection broken: %v", err)
1504 // t.setReqCanceler from this persistConn while the Transport
1768 // whether the Transport (as opposed to the user client code)
1769 // added the Accept-Encoding gzip header. If the Transport
2002 // bodyEOFSignal is used by the HTTP/1 transport when reading response