Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with FindObjectsInit? #111

Closed
madestro opened this issue Apr 10, 2019 · 0 comments
Closed

Problem with FindObjectsInit? #111

madestro opened this issue Apr 10, 2019 · 0 comments

Comments

@madestro
Copy link

Using this code:

func findObject(p *Ctx, session SessionHandle, template
[]*(Attribute)) []ObjectHandle {
  if err := p.FindObjectsInit(session, template); err != nil {
    panic("FindObjectsInit")
  }
  obj, _, err := p.FindObjects(session, 1024)
  if err != nil {
    panic("FindObjects")
  }
  if err := p.FindObjectsFinal(session); err != nil {
    panic("FindObjectsFinal")
  }
  if len(obj) > 0 {
    fmt.Println("found!")
    for _,o :=  range obj {
      fmt.Println("Object = ",o)
    }
    fmt.Println()
  }
  return obj
}

successive calls to this function produce that the results
list is appended to the original one. For instance: I'm using it to
check first for valid keys and, giving that i'm testing my app, I'm
using it also for deleting the keys.

First call produce

Object =  89
Object =  90

Second call

Object =  89
Object =  90
Object =  89
Object =  90
@miekg miekg closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants