mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(flash): fix codeQL issue
@formatter:off Signed-off-by: clinx <chenlin1@oppo.com>
This commit is contained in:
parent
0b02c44208
commit
0bcdcee745
@ -48,7 +48,7 @@ var AddrDatabase = make(map[uint64]string)
|
||||
|
||||
type clusterConfig struct {
|
||||
cfsProto.RemoteCacheConfig
|
||||
httpProxyPoolSize uint64
|
||||
httpProxyPoolSize int
|
||||
heartbeatPort int64
|
||||
replicaPort int64
|
||||
peerAddrs []string
|
||||
|
||||
@ -2,7 +2,6 @@ package flashgroupmanager
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"time"
|
||||
@ -163,14 +162,8 @@ func (m *FlashGroupManager) registerAPIMiddleware(route *mux.Router) {
|
||||
func (m *FlashGroupManager) newReverseProxy() *httputil.ReverseProxy {
|
||||
tr := &http.Transport{}
|
||||
if m.config != nil {
|
||||
ps := m.config.httpProxyPoolSize // uint64
|
||||
if ps > uint64(math.MaxInt) {
|
||||
log.LogErrorf("newReverseProxy httpProxyPoolSize[%d] invalid", ps)
|
||||
return nil
|
||||
}
|
||||
poolSize := int(ps)
|
||||
tr = proto.GetHttpTransporter(&proto.HttpCfg{
|
||||
PoolSize: poolSize,
|
||||
PoolSize: m.config.httpProxyPoolSize,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -200,8 +200,7 @@ func (m *FlashGroupManager) checkConfig(cfg *config.Config) (err error) {
|
||||
if m.id, err = strconv.ParseUint(cfg.GetString(ID), 10, 64); err != nil {
|
||||
return fmt.Errorf("%v,err:%v", proto.ErrInvalidCfg, err.Error())
|
||||
}
|
||||
|
||||
m.config.httpProxyPoolSize = uint64(cfg.GetInt64(HttpReversePoolSize))
|
||||
m.config.httpProxyPoolSize = cfg.GetInt(HttpReversePoolSize)
|
||||
if m.config.httpProxyPoolSize < defaultHttpReversePoolSize {
|
||||
m.config.httpProxyPoolSize = defaultHttpReversePoolSize
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user