-
Notifications
You must be signed in to change notification settings - Fork 113
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
Unexpected extra data in XML from devices #103
Comments
FWIW, I've also seen this, this is due to Netconf 1.1 'chunking' - these numbers are the number of bytes in the chunk. At the moment I'm working around this by stripping the numbers out after receiving them, but I'd like to do a proper fix at some point. I wonder if the intention was to use the |
If you know the size of the chunk using Regexp would be the most inefficient way to handle it :) So chunked transport isn't supported and this library probably needs to be reworked to handle it. |
Yeah, agreed, having thought more, regex is definitely not the right approach. I have a prototype that mostly works now reading the chunk sizes - but it doesn't really fit nicely with how the code is currently structured. I'll have a bit more of a think about how to do this in a way that is a bit more structured. |
I have ugly but working changes for this on my fork at https://github.com/nights99/go-netconf/tree/chunk_read The error handling definitely needs improving, but if anyone has suggestions for a nicer structure I should have some more time to work on it again soon. |
chunking is in the latest release (however i haven't tested it) I am working on a rewrite where chunking will be a part of this (tracking in #24). Closing this for now. Please feel free to comment if the new version (v0.3.0) isn't working for you. |
Hi, I think the issue here is still present even in the latest code - although the code supports sending the chunk size, it isn't parsing out the chunk sizes from received messages, leaving them in the xml. Looks like @GiacomoCortesi's fork has a possible solution for this. Thanks, |
Good to know. Open for a fix for v1. I am working on v2 now and will do stream based w/ proper parsing: https://github.com/nemith/go-netconf/blob/v2/transport/frame.go#L100 |
Yes, my fork includes some changes for chunked framing support, but credits go to the author of https://github.com/andaru/netconf. I just took a couple of functions from there and made the adaptations needed to make it work. |
fun fact, someone took part of the code from my fork for chunked framing support and put it here: |
I'll approve any PR for fixes but my focus will be on the rewrite (which already support chucked reads and writes) |
This happens using the master branch.
Running the following code (connection is to a Cisco device, if that matters):
I get the following output (excerpts):
I don't understand what those
#4104
,#4102
,#4083
etc. mean.Inspecting the
Exec()
method of the session reveals that after the following line:go-netconf/netconf/session.go
Line 48 in a527e68
rawXML
already contains the spurious numbers.Using the stable version (0.1.1), the one you get by default when importing
github.com/Juniper/go-netconf/netconf
, the output is clean.The text was updated successfully, but these errors were encountered: