nemith / netconf

NETCONF implementation in Go.
Other
29 stars 7 forks source link

fix recv loop send when context is canceled/timedout #47

Closed nemith closed 1 year ago

nemith commented 1 year ago

This fixes a known issue where sends on the req channel will block forever if the call to Call/Do is canceled.

This adds the context to the request and allows for the send on the channel to not block if a ctx.Done() exists (as with the recv side in Do). There is also some minor error handling cleanip (if we don't get a valid channel there is no reason to try to send to it.)