extra fixes

Signed-off-by: jsign <jsign.uy@gmail.com>
This commit is contained in:
jsign 2020-01-24 22:48:30 -03:00
parent dbd51ff8e7
commit 54f2e6ea3a
2 changed files with 5 additions and 1 deletions

View File

@ -385,7 +385,7 @@ func (fn *rpcFunc) handleRpcCall(args []reflect.Value) (results []reflect.Value)
retVal = func() reflect.Value { return val.Elem() } retVal = func() reflect.Value { return val.Elem() }
} }
retry := resp.Error != nil && resp.Error.Code == 0 && fn.retry retry := resp.Error != nil && resp.Error.Code == 2 && fn.retry
if !retry { if !retry {
break break
} }

View File

@ -429,6 +429,7 @@ func (c *wsConn) closeInFlight() {
ID: id, ID: id,
Error: &respError{ Error: &respError{
Message: "handler: websocket connection closed", Message: "handler: websocket connection closed",
Code: 2,
}, },
} }
@ -438,6 +439,8 @@ func (c *wsConn) closeInFlight() {
} }
c.handlingLk.Unlock() c.handlingLk.Unlock()
} }
c.inflight = map[int64]clientRequest{}
c.handling = map[int64]context.CancelFunc{}
} }
func (c *wsConn) closeChans() { func (c *wsConn) closeChans() {
@ -519,6 +522,7 @@ func (c *wsConn) handleWsConn(ctx context.Context) {
ID: *req.req.ID, ID: *req.req.ID,
Error: &respError{ Error: &respError{
Message: "handler: websocket connection closed", Message: "handler: websocket connection closed",
Code: 2,
}, },
} }
c.writeLk.Unlock() c.writeLk.Unlock()