The gwbuf_hexdump_pretty displays the hex contents of the buffer alongside
the human-readable version of it. The text version helps identify parts of
the buffer that contain text which makes protocol data decoding easier.
Added range-erase method to mxs::Buffer. This makes it easier to modify
the contents of mxs::Buffer.
The intended use-case for now is to erase unexpected trailing ERR packets
from resultsets.
Backend should use empty() instead of length() to see if the buffer is
empty. The length of a buffer should always be valid to call, even on
empty buffers.
All GWBUF macros that address a single link in a chain are now
simple wrappers for equivalent gwbuf_link-functions.
Next step is to drop the macros and replace their use with calls
to the functions.
A GWBUF given to any gwbuf-function:
- Must not be NULL. Exceptions are gwbuf_free() and gwbuf_append(),
in analogy with free() and realloc() respectively.
- Must be the head of a chain.
- Must be owned by the calling thread.
Formatted with nl_func_type_name and related options set to ignore. This
keeps the formatting intact for long return types in declarations and
definitions.
This makes iterating over packets in buffers faster while still
maintaining the requirements for forward iterators. Not using operator+=
makes it clear that this is not a random access iterator.
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
Copying a std::deque<mxs::Buffer> would cause a compilation failure due to
ambiguity between the copy-assignment and move-assignment
operators. Explicitly constructing a temporary object retains the strong
exception guarantee but prevents the ambiguity.
The code failed to compile when the function is used with a warning that
`pBuffer` was used without initialization. This makes sense as the first
conditional block re-declares the same parameter.