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) c.errorLogger.Printf("%T error: %v", op, opErr)
} }
// Send the reply to the kernel. // Send the reply to the kernel, if one is required.
replyMsg := kernelResponse(m.Header().Unique, op, opErr, c.protocol) outMsg := c.kernelResponse(m.Header().Unique, op, opErr)
if replyMsg != nil { if outMsg != nil {
if err := c.writeMessage(replyMsg); err != nil { err := c.writeMessage(outMsg.Bytes())
if c.errorLogger != nil { c.putOutMessage(outMsg)
c.errorLogger.Printf("writeMessage: %v", err)
}
return if err != nil && c.errorLogger != nil {
c.errorLogger.Printf("writeMessage: %v", err)
} }
} }
} }