BUG/MEDIUM: lua: many errors when we try to send data with the channel API

First we allow to use the reserved size to write the data that
will be sent. The reserved size remain guaranty because the
writed data will be sent quickly and the reserved room we be
again avalaible.

This permits to guaranty that the function send always have
avalaible space to send data (except if it cannot connect to
the server).

The function buffer_replace2 works only on contiguous buffer.
This patch also detects if the required size is contiguous.
If it not the case we realign the buffer.
1 file changed