diff options
author | Alon Levy <alevy@redhat.com> | 2010-11-04 17:16:01 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-02-07 19:06:52 +0200 |
commit | e571b5ebbb5f60d264f2d2eab8ec34d389fd3752 (patch) | |
tree | 3b8049ff7031d5b4f4c068a795398752a9219d92 /server | |
parent | bf6f246b2e8a921e6a524d092dd6f2d8cc1ced68 (diff) | |
download | spice-e571b5ebbb5f60d264f2d2eab8ec34d389fd3752.tar.gz spice-e571b5ebbb5f60d264f2d2eab8ec34d389fd3752.tar.xz spice-e571b5ebbb5f60d264f2d2eab8ec34d389fd3752.zip |
server/red_channel: add out_bytes_counter (unused)
Diffstat (limited to 'server')
-rw-r--r-- | server/red_channel.c | 3 | ||||
-rw-r--r-- | server/red_channel.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c index a13ef0ee..584b92e4 100644 --- a/server/red_channel.c +++ b/server/red_channel.c @@ -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; diff --git a/server/red_channel.h b/server/red_channel.h index 893a7f8a..e8ebb053 100644 --- a/server/red_channel.h +++ b/server/red_channel.h @@ -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 */ |