mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-27 07:29:32 +00:00
server/red_channel: add out_bytes_counter (unused)
This commit is contained in:
parent
bf6f246b2e
commit
e571b5ebbb
@ -26,6 +26,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include "stat.h"
|
||||
#include "red_channel.h"
|
||||
|
||||
static void red_channel_push(RedChannel *channel);
|
||||
@ -172,6 +173,7 @@ static void red_peer_handle_outgoing(RedsStreamContext *peer, OutgoingHandler *h
|
||||
}
|
||||
} else {
|
||||
handler->pos += n;
|
||||
stat_inc_counter(handler->out_bytes_counter, n);
|
||||
if (handler->pos == handler->size) { // finished writing data
|
||||
handler->on_msg_done(handler->opaque);
|
||||
handler->vec = handler->vec_buf;
|
||||
@ -285,6 +287,7 @@ RedChannel *red_channel_create(int size, RedsStreamContext *peer,
|
||||
channel->outgoing.opaque = channel;
|
||||
channel->outgoing.pos = 0;
|
||||
channel->outgoing.size = 0;
|
||||
channel->outgoing.out_bytes_counter = NULL;
|
||||
|
||||
channel->outgoing.get_msg_size = red_channel_peer_get_out_msg_size;
|
||||
channel->outgoing.prepare = red_channel_peer_prepare_out_msg;
|
||||
|
||||
@ -77,6 +77,9 @@ typedef struct OutgoingHandler {
|
||||
on_outgoing_error_proc on_error;
|
||||
on_outgoing_block_proc on_block;
|
||||
on_outgoing_msg_done_proc on_msg_done;
|
||||
#ifdef RED_STATISTICS
|
||||
uint64_t *out_bytes_counter;
|
||||
#endif
|
||||
} OutgoingHandler;
|
||||
|
||||
/* Red Channel interface */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user