fixed #34
This commit is contained in:
parent
da3d31662b
commit
5334b50533
@ -185,12 +185,12 @@ func (client *Client) do(funcname string, data []byte,
|
|||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
client.lastcall = "c"
|
client.lastcall = "c"
|
||||||
client.innerHandler["c"] = func(resp *Response) {
|
client.innerHandler["c"] = func(resp *Response) {
|
||||||
|
defer mutex.Unlock()
|
||||||
if resp.DataType == dtError {
|
if resp.DataType == dtError {
|
||||||
err = getError(resp.Data)
|
err = getError(resp.Data)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
handle = resp.Handle
|
handle = resp.Handle
|
||||||
mutex.Unlock()
|
|
||||||
}
|
}
|
||||||
id := IdGen.Id()
|
id := IdGen.Id()
|
||||||
req := getJob(id, []byte(funcname), data)
|
req := getJob(id, []byte(funcname), data)
|
||||||
@ -249,12 +249,12 @@ func (client *Client) Status(handle string) (status *Status, err error) {
|
|||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
client.lastcall = "s" + handle
|
client.lastcall = "s" + handle
|
||||||
client.innerHandler["s"+handle] = func(resp *Response) {
|
client.innerHandler["s"+handle] = func(resp *Response) {
|
||||||
|
defer mutex.Unlock()
|
||||||
var err error
|
var err error
|
||||||
status, err = resp._status()
|
status, err = resp._status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
client.err(err)
|
client.err(err)
|
||||||
}
|
}
|
||||||
mutex.Unlock()
|
|
||||||
}
|
}
|
||||||
req := getRequest()
|
req := getRequest()
|
||||||
req.DataType = dtGetStatus
|
req.DataType = dtGetStatus
|
||||||
|
Loading…
Reference in New Issue
Block a user