summaryrefslogtreecommitdiffstats
path: root/client/red_peer.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-17 10:15:15 +0200
committerAlexander Larsson <alexl@redhat.com>2010-06-18 20:27:32 +0200
commitee91ed475dc5b9ea8f5ee05faa3dd153306e3471 (patch)
treeadfd3b9086bb875db3d3748c4ab88c8977e17ff5 /client/red_peer.h
parent13026676627887a7d85abb49a0468150ac75ebe6 (diff)
downloadspice-ee91ed475dc5b9ea8f5ee05faa3dd153306e3471.tar.gz
spice-ee91ed475dc5b9ea8f5ee05faa3dd153306e3471.tar.xz
spice-ee91ed475dc5b9ea8f5ee05faa3dd153306e3471.zip
Switch client to use generated marshallers
Diffstat (limited to 'client/red_peer.h')
-rw-r--r--client/red_peer.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/client/red_peer.h b/client/red_peer.h
index f24e5e7b..001f9fa9 100644
--- a/client/red_peer.h
+++ b/client/red_peer.h
@@ -26,6 +26,7 @@
#include "process_loop.h"
#include "threads.h"
#include "platform_utils.h"
+#include "marshaller.h"
class RedPeer: protected EventSources::Socket {
public:
@@ -111,6 +112,7 @@ public:
void enable() { _shut = false;}
virtual CompundInMessage* recive();
+ uint32_t do_send(OutMessage& message, uint32_t skip_bytes);
uint32_t send(OutMessage& message);
uint32_t recive(uint8_t* buf, uint32_t size);
@@ -194,20 +196,19 @@ private:
class RedPeer::OutMessage {
public:
- OutMessage(uint32_t type, uint32_t size);
+ OutMessage(uint32_t type);
virtual ~OutMessage();
- SpiceDataHeader& header() { return *(SpiceDataHeader *)_data;}
- uint8_t* data() { return _data + sizeof(SpiceDataHeader);}
- void resize(uint32_t size);
+ SpiceMarshaller *marshaller() { return _marshaller;}
+ void reset(uint32_t type);
private:
- uint32_t message_size() { return header().size + sizeof(SpiceDataHeader);}
- uint8_t* base() { return _data;}
+ uint32_t message_size() { return spice_marshaller_get_total_size(_marshaller);}
+ uint8_t* base() { return spice_marshaller_get_ptr(_marshaller);}
+ SpiceDataHeader& header() { return *(SpiceDataHeader *)base();}
-private:
- uint8_t* _data;
- uint32_t _size;
+protected:
+ SpiceMarshaller *_marshaller;
friend class RedPeer;
friend class RedChannel;