Skip to content

Commit

Permalink
fixup! export: don't call IsValid separately
Browse files Browse the repository at this point in the history
  • Loading branch information
guelfey committed Apr 8, 2023
1 parent 5e780f0 commit be72ad8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,17 @@ func (conn *Conn) send(ctx context.Context, msg *Message, ch chan *Call) *Call {
<-ctx.Done()
conn.calls.handleSendError(msg, ctx.Err())
}()
conn.sendMessageAndIfClosed(msg, func() {
// error is handled in handleSendError
_ = conn.sendMessageAndIfClosed(msg, func() {
conn.calls.handleSendError(msg, ErrClosed)
canceler()
})
} else {
canceler()
call = &Call{Err: nil, Done: ch}
ch <- call
conn.sendMessageAndIfClosed(msg, func() {
// error is handled in handleSendError
_ = conn.sendMessageAndIfClosed(msg, func() {
call = &Call{Err: ErrClosed}
})
}
Expand Down Expand Up @@ -605,7 +607,8 @@ func (conn *Conn) sendError(err error, dest string, serial uint32) {
if len(e.Body) > 0 {
msg.Headers[FieldSignature] = MakeVariant(SignatureOf(e.Body...))
}
conn.sendMessageAndIfClosed(msg, nil)
// not much we can do to handle a possible error here
_ = conn.sendMessageAndIfClosed(msg, nil)
}

// sendReply creates a method reply message corresponding to the parameters and
Expand All @@ -622,7 +625,8 @@ func (conn *Conn) sendReply(dest string, serial uint32, values ...interface{}) {
if len(values) > 0 {
msg.Headers[FieldSignature] = MakeVariant(SignatureOf(values...))
}
conn.sendMessageAndIfClosed(msg, nil)
// not much we can do to handle a possible error here
_ = conn.sendMessageAndIfClosed(msg, nil)
}

// AddMatchSignal registers the given match rule to receive broadcast
Expand Down

0 comments on commit be72ad8

Please sign in to comment.