Read data from an evbuffer and drain the bytes read.
If more bytes are requested than are available in the evbuffer, we
only extract as many bytes as were available.
@param buf the evbuffer to be read from
@param data the destination buffer to store the result
@param datlen the maximum size of the destination buffer
@return the number of bytes read, or -1 if we can't drain the buffer.
Read data from an evbuffer and drain the bytes read.
If more bytes are requested than are available in the evbuffer, we only extract as many bytes as were available.
@param buf the evbuffer to be read from @param data the destination buffer to store the result @param datlen the maximum size of the destination buffer @return the number of bytes read, or -1 if we can't drain the buffer.