red-channel-client: Do not allocate iovec array statically in the class

This array is just used locally in red_channel_client_handle_outgoing
so declare it there.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2018-06-14 18:29:19 +01:00
parent f1050bfc76
commit 0e5c4880ed

View File

@ -101,8 +101,6 @@ typedef struct RedChannelClientConnectivityMonitor {
} RedChannelClientConnectivityMonitor;
typedef struct OutgoingMessageBuffer {
struct iovec vec[IOV_MAX];
int vec_size;
int pos;
int size;
} OutgoingMessageBuffer;
@ -1081,10 +1079,11 @@ static void red_channel_client_handle_outgoing(RedChannelClient *rcc)
}
for (;;) {
buffer->vec_size =
red_channel_client_prepare_out_msg(rcc, buffer->vec, G_N_ELEMENTS(buffer->vec),
struct iovec vec[IOV_MAX];
int vec_size =
red_channel_client_prepare_out_msg(rcc, vec, G_N_ELEMENTS(vec),
buffer->pos);
n = red_stream_writev(stream, buffer->vec, buffer->vec_size);
n = red_stream_writev(stream, vec, vec_size);
if (n == -1) {
switch (errno) {
case EAGAIN: