[Spice-commits] server/red-channel-client.c
Christophe Fergau
teuf at kemper.freedesktop.org
Fri Feb 10 15:33:33 UTC 2017
server/red-channel-client.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit e9461ec904632ddfeff92cbc8ba7683f9a6eacd5
Author: Christophe Fergeau <cfergeau at redhat.com>
Date: Tue Nov 29 19:01:04 2016 +0100
Move variables to inner block in red_peer_handle_incoming()
This makes the code slightly more readable as this means less local
variables to keep track of when taking a high level view of that code.
Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/red-channel-client.c b/server/red-channel-client.c
index 0002951..06fb8a8 100644
--- a/server/red-channel-client.c
+++ b/server/red-channel-client.c
@@ -1089,9 +1089,6 @@ static int red_peer_receive(RedsStream *stream, uint8_t *buf, uint32_t size)
static void red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handler)
{
int bytes_read;
- uint8_t *parsed;
- size_t parsed_size;
- message_destructor_t parsed_free;
uint16_t msg_type;
uint32_t msg_size;
@@ -1147,6 +1144,10 @@ static void red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handle
}
if (handler->cb->parser) {
+ uint8_t *parsed;
+ size_t parsed_size;
+ message_destructor_t parsed_free;
+
parsed = handler->cb->parser(handler->msg,
handler->msg + msg_size, msg_type,
SPICE_VERSION_MINOR, &parsed_size, &parsed_free);
More information about the Spice-commits
mailing list