tidb http 源码

  • 2022-09-19
  • 浏览 (543)

tidb http 代码

文件路径:/br/pkg/httputil/http.go

// Copyright 2021 PingCAP, Inc. Licensed under Apache-2.0.

package httputil

import (
	"crypto/tls"
	"net/http"
	"time"
)

// NewClient returns an HTTP(s) client.
func NewClient(tlsConf *tls.Config) *http.Client {
	// defaultTimeout for non-context requests.
	const defaultTimeout = 30 * time.Second
	cli := &http.Client{Timeout: defaultTimeout}
	if tlsConf != nil {
		transport := http.DefaultTransport.(*http.Transport).Clone()
		transport.TLSClientConfig = tlsConf
		cli.Transport = transport
	}
	return cli
}

相关信息

tidb 源码目录

相关文章

tidb bind_cache 源码

tidb bind_record 源码

tidb handle 源码

tidb session_handle 源码

tidb stat 源码

tidb backup 源码

tidb cmd 源码

tidb debug 源码

tidb main 源码

tidb restore 源码

0  赞