servalproject / serval-dna

The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
http://servalproject.org
Other
171 stars 80 forks source link

ob_dup() did not preserve source position #66

Closed rom1v closed 11 years ago

rom1v commented 11 years ago

ob_append_bytes() changes the position, so it must be reset.

rom1v commented 11 years ago

Arf, it breaks tests/routing

I think there is a problem: shouldn't ob_dup() preserve position on the destination buffer?

lakeman commented 11 years ago

Yeah, that set of functions don't quite behave like you might expect them to, and the rest of the application depends on that behaviour.

I'd actually like to implement a reference counted replacement that would allow us to use scatter gather I/O for relaying packets directly from the buffer we received them in without any memory copying.

On Fri, Jul 5, 2013 at 7:41 PM, ®om notifications@github.com wrote:

Arf, it breaks tests/routing…

I think there is a problem: shouldn't ob_dup() preserve position on the destination buffer?

— Reply to this email directly or view it on GitHubhttps://github.com/servalproject/serval-dna/pull/66#issuecomment-20510566 .