ing
This commit is contained in:
parent
a8acaab5b8
commit
d9973215da
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
@ -297,9 +298,11 @@ func (c *client) rpcReader(readerDone chan<- error) {
|
|||
|
||||
func (c *client) responseHandle(codecResponse protocol.ClientCodecResponse) error {
|
||||
c.pendingRequestsLock.Lock()
|
||||
cs, ok := c.pendingRequests[codecResponse.ID().(uint64)]
|
||||
id := reflect.ValueOf(codecResponse.ID()).Convert(uint64Type).Uint()
|
||||
|
||||
cs, ok := c.pendingRequests[id]
|
||||
if ok {
|
||||
delete(c.pendingRequests, codecResponse.ID().(uint64))
|
||||
delete(c.pendingRequests, id)
|
||||
}
|
||||
c.pendingRequestsLock.Unlock()
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package client
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"reflect"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultRequestTimeout is the default timeout for client request.
|
||||
|
@ -10,3 +13,5 @@ const (
|
|||
// handled by Client and Server.
|
||||
DefaultPendingMessages = 32 * 1024
|
||||
)
|
||||
|
||||
var uint64Type = reflect.TypeOf(uint64(0))
|
||||
|
|
Loading…
Reference in New Issue
Block a user