Skip to content

Commit

Permalink
client: use bigger TTL, expose it to clients (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthulhu-rider authored Feb 29, 2024
2 parents d1bb088 + 021cdfa commit 0c41af6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const (
fieldNumSigPubKey = 1
fieldNumSigVal = 2
fieldNumSigScheme = 3

// DefaultTTL is a TTL used for NeoFS requests if no other value is
// set specifically for a call. It limits the number of hops the
// request can transit (see specification for details).
DefaultTTL = 8
)

// groups meta parameters shared between all Client operations.
Expand Down Expand Up @@ -120,7 +125,7 @@ func (x contextCall) prepareRequest() {
}

if meta.GetTTL() == 0 {
meta.SetTTL(2)
meta.SetTTL(DefaultTTL)
}

if meta.GetVersion() == nil {
Expand All @@ -137,7 +142,7 @@ func (x contextCall) prepareRequest() {
func (c *Client) prepareRequest(req request, meta *v2session.RequestMetaHeader) {
ttl := meta.GetTTL()
if ttl == 0 {
ttl = 2
ttl = DefaultTTL
}

verV2 := meta.GetVersion()
Expand Down

0 comments on commit 0c41af6

Please sign in to comment.