client: cleanup

This commit is contained in:
aler9
2021-11-13 10:41:16 +01:00
parent add62f4759
commit 69c73068ec

View File

@@ -523,8 +523,6 @@ func (c *Client) run() {
return err
}
}
c.checkStreamTimer = time.NewTimer(clientCheckStreamPeriod)
} else {
inTimeout := func() bool {
now := time.Now()
@@ -544,8 +542,6 @@ func (c *Client) run() {
if inTimeout {
return liberrors.ErrClientUDPTimeout{}
}
c.checkStreamTimer = time.NewTimer(clientCheckStreamPeriod)
}
} else { // TCP
inTimeout := func() bool {
@@ -556,10 +552,10 @@ func (c *Client) run() {
if inTimeout {
return liberrors.ErrClientTCPTimeout{}
}
c.checkStreamTimer = time.NewTimer(clientCheckStreamPeriod)
}
c.checkStreamTimer = time.NewTimer(clientCheckStreamPeriod)
case <-c.keepaliveTimer.C:
_, err := c.do(&base.Request{
Method: func() base.Method {