Skip to content

Commit 09f6359

Browse files
committed
#736 use shared.Context insead of creating a new context
1 parent 28b118c commit 09f6359

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

โ€Žclient/client.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,11 @@ func (client *Client) call(ctx context.Context, servicePath, serviceMethod strin
343343

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

348352
call := new(Call)
349353
call.Raw = true

0 commit comments

Comments
ย (0)