Skip to content

Commit

Permalink
#736 use shared.Context insead of creating a new context
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnest committed Jan 31, 2023
1 parent 28b118c commit 09f6359
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ func (client *Client) call(ctx context.Context, servicePath, serviceMethod strin

// SendRaw sends raw messages. You don't care args and replies.
func (client *Client) SendRaw(ctx context.Context, r *protocol.Message) (map[string]string, []byte, error) {
ctx = context.WithValue(ctx, seqKey{}, r.Seq())
if sharedCtx, ok := ctx.(*share.Context); ok {
sharedCtx.SetValue(seqKey{}, r.Seq())
} else {
ctx = context.WithValue(ctx, seqKey{}, r.Seq())
}

call := new(Call)
call.Raw = true
Expand Down

0 comments on commit 09f6359

Please sign in to comment.