[#323] client: Remove initCallContextWithoutKey
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
84888854ab
commit
2f843de3ed
4 changed files with 3 additions and 14 deletions
|
@ -288,11 +288,6 @@ func (x *contextCall) processCall() bool {
|
|||
// initializes static cross-call parameters inherited from client.
|
||||
func (c *Client) initCallContext(ctx *contextCall) {
|
||||
ctx.key = c.prm.key
|
||||
c.initCallContextWithoutKey(ctx)
|
||||
}
|
||||
|
||||
// initializes static cross-call parameters inherited from client except private key.
|
||||
func (c *Client) initCallContextWithoutKey(ctx *contextCall) {
|
||||
ctx.resolveAPIFailures = c.prm.resolveNeoFSErrors
|
||||
ctx.callbackResp = c.prm.cbRespInfo
|
||||
ctx.netMagic = c.prm.netMagic
|
||||
|
|
|
@ -148,11 +148,9 @@ func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObj
|
|||
res ResObjectDelete
|
||||
)
|
||||
|
||||
if prm.keySet {
|
||||
c.initCallContextWithoutKey(&cc)
|
||||
cc.key = prm.key
|
||||
} else {
|
||||
c.initCallContext(&cc)
|
||||
if prm.keySet {
|
||||
cc.key = prm.key
|
||||
}
|
||||
|
||||
cc.req = &req
|
||||
|
|
|
@ -499,11 +499,9 @@ func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectH
|
|||
|
||||
res.idObj = prm.objID
|
||||
|
||||
if prm.keySet {
|
||||
c.initCallContextWithoutKey(&cc)
|
||||
cc.key = prm.key
|
||||
} else {
|
||||
c.initCallContext(&cc)
|
||||
if prm.keySet {
|
||||
cc.key = prm.key
|
||||
}
|
||||
|
||||
cc.req = &req
|
||||
|
|
|
@ -110,11 +110,9 @@ func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResS
|
|||
res ResSessionCreate
|
||||
)
|
||||
|
||||
if prm.keySet {
|
||||
c.initCallContextWithoutKey(&cc)
|
||||
cc.key = prm.key
|
||||
} else {
|
||||
c.initCallContext(&cc)
|
||||
if prm.keySet {
|
||||
cc.key = prm.key
|
||||
}
|
||||
|
||||
cc.meta = prm.prmCommonMeta
|
||||
|
|
Loading…
Reference in a new issue