Home | History | Annotate | Download | only in http

Lines Matching full:nil

59 	altProto map[string]RoundTripper // nil or map of URI scheme => RoundTripper
62 // Request. If the function returns a non-nil error, the
64 // If Proxy is nil or returns a nil *URL, no proxy is used.
69 // If Dial is nil, net.Dial is used.
75 // If DialTLS is nil, Dial and TLSClientConfig are used.
84 // tls.Client. If nil, the default configuration is used.
130 // A nil URL and nil error are returned if no proxy is defined in the
135 // a port number), then a nil URL and nil error will be returned.
145 return nil, nil
148 return nil, nil
151 if err != nil || !strings.HasPrefix(proxyURL.Scheme, "http") {
155 if proxyURL, err := url.Parse("http://" + proxy); err == nil {
156 return proxyURL, nil
159 if err != nil {
160 return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err)
162 return proxyURL, nil
169 return fixedURL, nil
177 extra Header // extra headers to write, or nil
181 if tr.extra == nil {
192 if req.URL == nil {
194 return nil, errors.New("http: nil Request.URL")
196 if req.Header == nil {
198 return nil, errors.New("http: nil Request.Header")
203 if t.altProto != nil {
207 if rt == nil {
209 return nil, &badStringError{"unsupported protocol scheme", req.URL.Scheme}
215 return nil, errors.New("http: no Host in request URL")
219 if err != nil {
221 return nil, err
229 if err != nil {
230 t.setReqCanceler(req, nil)
232 return nil, err
250 if t.altProto == nil {
266 t.idleConn = nil
267 t.idleConnCh = nil
284 if cancel != nil {
337 if t.Proxy != nil {
346 if cm.proxyURL == nil {
349 if u := cm.proxyURL.User; u != nil {
387 if waitingDialer != nil {
398 if t.idleConn == nil {
418 // It may return nil, if persistent connections are not being used.
421 return nil
427 if t.idleConnCh == nil {
442 if t.idleConn == nil {
443 return nil
448 return nil
468 if t.reqCanceler == nil {
471 if fn != nil {
489 if fn != nil {
498 if t.Dial != nil {
512 if pc := t.getIdleConn(cm); pc != nil {
513 // set request canceler to some non-nil function so we
517 return pc, nil
532 if prePendingDial != nil {
536 if v := <-dialc; v.err == nil {
539 if postPendingDial != nil {
565 return pc, nil
568 return nil, errors.New("net/http: request canceled while waiting for connection")
571 return nil, errors.New("net/http: request canceled while waiting for connection")
584 tlsDial := t.DialTLS != nil && cm.targetScheme == "https" && cm.proxyURL == nil
588 if err != nil {
589 return nil, err
597 if err != nil {
598 if cm.proxyURL != nil {
601 return nil, err
608 case cm.proxyURL == nil:
635 if err != nil {
637 return nil, err
642 return nil, errors.New(f[1])
663 if timer != nil {
668 if err := <-errc; err != nil {
670 return nil, err
673 if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
675 return nil, err
687 return pconn, nil
698 if err != nil {
704 if ip := net.ParseIP(host); ip != nil {
758 proxyURL *url.URL // nil for no proxy, else full proxy URL
766 if cm.proxyURL != nil {
781 if cm.proxyURL != nil {
823 // writeErrCh passes the request write error (usually nil)
895 if err == nil {
897 if err == nil && resp.StatusCode == 100 {
907 if resp != nil {
911 hasBody := resp != nil && rc.req.Method != "HEAD" && resp.ContentLength != 0
913 if err != nil {
925 if err != nil || resp.Close || rc.req.Close || resp.StatusCode <= 199 {
932 var waitForBodyRead chan bool // channel is nil when there's no body
937 return nil
944 } else if err != nil && pc.isCanceled() {
955 pc.t.setReqCanceler(rc.req, nil)
981 pc.t.setReqCanceler(rc.req, nil) // before pc might return to idle pool
1000 if hook := testHookReadLoopBeforeNextRead; hook != nil {
1016 if err == nil {
1019 if err != nil {
1038 return err == nil
1052 return err == nil
1096 // nil except for tests
1105 if hook := testHookEnterRoundTrip; hook != nil {
1110 return nil, errRequestCanceled
1117 if headerFn != nil {
1179 if err != nil {
1180 re = responseAndError{nil, err}
1202 if fn := testHookPersistConnClosedGotRes; fn != nil {
1220 cancelChan = nil
1224 if re.err != nil {
1225 pc.t.setReqCanceler(req.Request, nil)
1252 pc.mutateHeaderFunc = nil
1269 // bodyEOFSignal wraps a ReadCloser but runs fn (if non-nil) at most
1273 // If earlyCloseFn is non-nil and Close is called before io.EOF is
1281 fn func(error) error // err will be nil on Read io.EOF
1292 if rerr != nil {
1297 if err != nil {
1300 if es.rerr == nil {
1312 return nil
1315 if es.earlyCloseFn != nil && es.rerr != io.EOF {
1324 if es.fn == nil {
1328 es.fn = nil
1340 if gz.zr == nil {
1342 if err != nil {
1406 // If cfg is nil, a new zero tls.Config is returned.
1408 if cfg == nil {
1439 if cfg == nil {