Skip to content

Commit

Permalink
fix: bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantxie committed Dec 30, 2024
1 parent 2ce092d commit e84a5d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/remote/trans/default_server_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ func (t *svrTransHandler) writeErrorReplyIfNeeded(
if connReset {
// if connection needs to be closed, set ConnResetTag to response header
// to ensure the client won't reuse the connection.
rpcinfo.AsMutableEndpointInfo(ri.From()).SetTag(rpcinfo.ConnResetTag, "1")
if ei := rpcinfo.AsTaggable(ri.To()); ei != nil {
ei.SetTag(rpcinfo.ConnResetTag, "1")
}
}
ctx, err = t.transPipe.Write(ctx, conn, errMsg)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/transmeta/ttheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (sh *serverTTHeaderHandler) WriteMeta(ctx context.Context, msg remote.Messa
strInfo[bizExtra], _ = utils.Map2JSONStr(bizErr.BizExtra())
}
}
if val, ok := ri.From().Tag(rpcinfo.ConnResetTag); ok {
if val, ok := ri.To().Tag(rpcinfo.ConnResetTag); ok {
strInfo[transmeta.HeaderConnectionReadyToReset] = val
}

Expand Down

0 comments on commit e84a5d2

Please sign in to comment.