Merge pull request #487 from lpxxn/master
fix streamming error io.ErrUnexpectedEOF
This commit is contained in:
commit
e035664a8c
@ -157,17 +157,15 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
|
||||
// TODO: handle error better
|
||||
if err := handler(ctx, request, response); err != nil {
|
||||
if err != lastStreamResponseError {
|
||||
// write an error response
|
||||
err = rcodec.Write(&codec.Message{
|
||||
Header: msg.Header,
|
||||
Error: err.Error(),
|
||||
Type: codec.Error,
|
||||
}, nil)
|
||||
// could not write the error response
|
||||
if err != nil {
|
||||
log.Logf("rpc: unable to write error response: %v", err)
|
||||
}
|
||||
// write an error response
|
||||
err = rcodec.Write(&codec.Message{
|
||||
Header: msg.Header,
|
||||
Error: err.Error(),
|
||||
Type: codec.Error,
|
||||
}, nil)
|
||||
// could not write the error response
|
||||
if err != nil {
|
||||
log.Logf("rpc: unable to write error response: %v", err)
|
||||
}
|
||||
s.wg.Done()
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user