Connection.Reply

geesefs-0-30-9
Aaron Jacobs 2015-07-28 16:14:58 +10:00
parent 0becfa3df2
commit 5238806cff
1 changed files with 7 additions and 9 deletions

View File

@ -449,17 +449,15 @@ func (c *Connection) Reply(ctx context.Context, opErr error) {
c.errorLogger.Printf("%T error: %v", op, opErr)
}
// Send the reply to the kernel.
replyMsg := kernelResponse(m.Header().Unique, op, opErr, c.protocol)
if replyMsg != nil {
if err := c.writeMessage(replyMsg); err != nil {
if c.errorLogger != nil {
c.errorLogger.Printf("writeMessage: %v", err)
}
// Send the reply to the kernel, if one is required.
outMsg := c.kernelResponse(m.Header().Unique, op, opErr)
if outMsg != nil {
err := c.writeMessage(outMsg.Bytes())
c.putOutMessage(outMsg)
return
if err != nil && c.errorLogger != nil {
c.errorLogger.Printf("writeMessage: %v", err)
}
}
}