This commit is contained in:
crusader 2018-07-01 01:39:08 +09:00
parent 32883be22b
commit f5810183da

View File

@ -204,6 +204,7 @@ func (c *Client) handleSend(stopChan <-chan struct{}, doneChan chan<- error, wri
var ( var (
rs *requestState rs *requestState
id interface{} id interface{}
messageType int
message []byte message []byte
err error err error
ok bool ok bool
@ -233,7 +234,7 @@ LOOP:
if 0 < rs.id { if 0 < rs.id {
id = rs.id id = rs.id
} }
message, err = c.ClientHandler.GetRPCCodec().NewRequest(rs.method, rs.params, id) messageType, message, err = c.ClientHandler.GetRPCCodec().NewRequest(rs.method, rs.params, id)
if nil != err { if nil != err {
rs.setError(err) rs.setError(err)
rs.done() rs.done()
@ -241,7 +242,7 @@ LOOP:
} }
select { select {
case writeChan <- css.MakeSocketMessage(css.TextMessage, message): case writeChan <- css.MakeSocketMessage(messageType, message):
default: default:
rs.setError(fmt.Errorf("%s cannot send request", c.logHeader())) rs.setError(fmt.Errorf("%s cannot send request", c.logHeader()))
rs.done() rs.done()