Home | History | Annotate | Download | only in http

Lines Matching refs:Transport

7 // This is the low-level Transport implementation of RoundTripper.
35 // DefaultTransport is the default implementation of Transport and is
40 var DefaultTransport RoundTripper = &Transport{
53 // DefaultMaxIdleConnsPerHost is the default value of Transport's
57 // Transport is an implementation of RoundTripper that supports HTTP,
60 // By default, Transport caches connections for future re-use.
62 // This behavior can be managed using Transport's CloseIdleConnections method
68 // A Transport is a low-level primitive for making HTTP and HTTPS requests.
71 // Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2
73 // and how the Transport is configured. The DefaultTransport supports HTTP/2.
74 // To explicitly enable HTTP/2 on a transport, use golang.org/x/net/http2
77 // The Transport will send CONNECT requests to a proxy for its own use
78 // when processing HTTPS requests, but Transport should generally not
85 type Transport struct {
111 // then the transport dials using package net.
116 // Deprecated: Use DialContext instead, which allows the transport
146 // DisableCompression, if true, prevents the Transport from
149 // Accept-Encoding value. If the Transport requests gzip on
186 // TLSNextProto specifies how the Transport switches to an
188 // protocol negotiation. If Transport dials an TLS connection
219 func (t *Transport) onceSetNextProtoDefaults() {
225 // Transport.
238 log.Printf("Error enabling Transport HTTP/2 support: %v", err)
243 // Auto-configure the http2.Transport's MaxHeaderListSize from
244 // the http.Transport's MaxResponseHeaderBytes. They don't
247 // TODO: also add this to x/net/http2.Configure Transport, behind
311 // ProxyURL returns a proxy function (for use in a Transport)
350 func (t *Transport) RoundTrip(req *Request) (*Response, error) {
501 // ErrSkipAltProtocol is a sentinel error value defined by Transport.RegisterProtocol.
505 // The Transport will pass requests using the given scheme to rt.
511 // If rt.RoundTrip returns ErrSkipAltProtocol, the Transport will
514 func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper) {
533 func (t *Transport) CloseIdleConnections() {
558 func (t *Transport) CancelRequest(req *Request) {
563 func (t *Transport) cancelRequest(req *Request, err error) {
618 func (t *Transport) connectMethodForRequest(treq *transportRequest) (cm connectMethod, err error) {
668 // transportReadFromServerError is used by Transport.readLoop when the
675 // them to return from Transport.RoundTrip.
681 return fmt.Sprintf("net/http: Transport failed to read from server: %v", e.err)
684 func (t *Transport) putOrCloseIdleConn(pconn *persistConn) {
690 func (t *Transport) maxIdleConnsPerHost() int {
702 func (t *Transport) tryPutIdleConn(pconn *persistConn) error {
770 func (t *Transport) getIdleConnCh(cm connectMethod) chan *persistConn {
789 func (t *Transport) getIdleConn(cm connectMethod) (pconn *persistConn, idleSince time.Time) {
812 // Transport.removeIdleConn. Just skip it and
827 func (t *Transport) removeIdleConn(pconn *persistConn) {
834 func (t *Transport) removeIdleConnLocked(pconn *persistConn) {
862 func (t *Transport) setReqCanceler(r *Request, fn func(error)) {
879 func (t *Transport) replaceReqCanceler(r *Request, fn func(error)) bool {
896 func (t *Transport) dial(ctx context.Context, network, addr string) (net.Conn, error) {
903 err = errors.New("net/http: Transport.Dial hook returned (nil, nil)")
914 func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (*persistConn, error) {
1033 // The connect method and the transport can both specify a TLS
1034 // Host name. The transport's name takes precedence if present.
1035 func chooseTLSHost(cm connectMethod, t *Transport) string {
1096 func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (*persistConn, error) {
1121 return nil, wrapErr(errors.New("net/http: Transport.DialTLS returned (nil, nil)"))
1402 t *Transport
1423 // Both guarded by Transport.idleMu:
1561 return fmt.Errorf("net/http: HTTP/1.x transport connection broken: %v", err)
1897 // whether the Transport (as opposed to the user client code)
1898 // added the Accept-Encoding gzip header. If the Transport
2154 // bodyEOFSignal is used by the HTTP/1 transport when reading response