[#839] service/object: Add high level functions to control request forwarding

Applicable for object/get execution context.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-09-27 09:52:03 +03:00 committed by Alex Vanin
parent b3464e8140
commit b97cdbea9e
3 changed files with 17 additions and 6 deletions

View file

@ -347,3 +347,15 @@ func (exec *execCtx) writeCollectedObject() {
exec.writeObjectPayload(exec.collectedObject)
}
}
// isForwardingEnabled returns true if common execution
// parameters has request forwarding closure set.
func (exec execCtx) isForwardingEnabled() bool {
return exec.prm.forwarder != nil
}
// disableForwarding removes request forwarding closure from common
// parameters, so it won't be inherited in new execution contexts.
func (exec *execCtx) disableForwarding() {
exec.prm.SetRequestForwarder(nil)
}