Use the buffer controls also for the redir dialer.

This commit is contained in:
notsure2 2024-02-17 17:11:01 +02:00
parent b6cbc0c0f0
commit 3b42b3f9c8
1 changed files with 6 additions and 5 deletions

View File

@ -138,11 +138,10 @@ func ParseConfig(conf string) (raw RawConfig, err error) {
// InitState process the RawConfig and initialises a server State accordingly // InitState process the RawConfig and initialises a server State accordingly
func InitState(preParse RawConfig, worldState common.WorldState) (sta *State, err error) { func InitState(preParse RawConfig, worldState common.WorldState) (sta *State, err error) {
sta = &State{ sta = &State{
BypassUID: make(map[[16]byte]struct{}), BypassUID: make(map[[16]byte]struct{}),
ProxyBook: map[string]net.Addr{}, ProxyBook: map[string]net.Addr{},
UsedRandom: map[[32]byte]int64{}, UsedRandom: map[[32]byte]int64{},
RedirDialer: &net.Dialer{}, WorldState: worldState,
WorldState: worldState,
} }
if preParse.CncMode { if preParse.CncMode {
err = errors.New("command & control mode not implemented") err = errors.New("command & control mode not implemented")
@ -196,6 +195,8 @@ func InitState(preParse RawConfig, worldState common.WorldState) (sta *State, er
}) })
} }
sta.RedirDialer = &net.Dialer{Control: dialerControl}
if preParse.KeepAlive <= 0 { if preParse.KeepAlive <= 0 {
sta.ProxyDialer = &net.Dialer{KeepAlive: -1, Control: dialerControl} sta.ProxyDialer = &net.Dialer{KeepAlive: -1, Control: dialerControl}
} else { } else {