[#532] object/hash: Fix NPE during request forwarding
In current implementation `Object.GetRangeHash` RPC handler forwards range requests for payload data. Missing request forwarder of the original request caused NPE during execution. Do not call request forwarder if payload range hash is requested. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
5e9513e008
commit
72e2bc8fb6
3 changed files with 18 additions and 4 deletions
|
@ -38,7 +38,7 @@ type execCtx struct {
|
|||
|
||||
curOff uint64
|
||||
|
||||
head bool
|
||||
head, hash bool
|
||||
|
||||
curProcEpoch uint64
|
||||
|
||||
|
@ -71,6 +71,12 @@ func withPayloadRange(r *objectSDK.Range) execOption {
|
|||
}
|
||||
}
|
||||
|
||||
func hashOnly() execOption {
|
||||
return func(c *execCtx) {
|
||||
c.hash = true
|
||||
}
|
||||
}
|
||||
|
||||
func (exec *execCtx) setLogger(l *logger.Logger) {
|
||||
req := "GET"
|
||||
if exec.headOnly() {
|
||||
|
@ -146,6 +152,10 @@ func (exec *execCtx) headOnly() bool {
|
|||
return exec.head
|
||||
}
|
||||
|
||||
func (exec *execCtx) hashOnly() bool {
|
||||
return exec.hash
|
||||
}
|
||||
|
||||
func (exec *execCtx) netmapEpoch() uint64 {
|
||||
return exec.prm.common.NetmapEpoch()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue