[PATCH spice-streaming-agent 6/6] Stub to handle errors from server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Base error message handling.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 src/spice-streaming-agent.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index 5813fba..2612ccb 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -82,6 +82,7 @@ static int have_something_to_read(int timeout)
 
 static int read_stream_capabilities(uint32_t len);
 static int read_stream_start_stop(uint32_t len);
+static int read_stream_error(uint32_t len);
 
 static int read_command_from_device(void)
 {
@@ -101,6 +102,8 @@ static int read_command_from_device(void)
     switch (hdr.type) {
     case STREAM_TYPE_CAPABILITIES:
         return read_stream_capabilities(hdr.size);
+    case STREAM_TYPE_NOTIFY_ERROR:
+        return read_stream_error(hdr.size);
     case STREAM_TYPE_START_STOP:
         return read_stream_start_stop(hdr.size);
     }
@@ -152,6 +155,13 @@ static int read_stream_capabilities(uint32_t len)
     return 1;
 }
 
+static int read_stream_error(uint32_t len)
+{
+    // TODO read message and use it
+    ERROR("got an error message from server");
+    return -1;
+}
+
 static int read_command(bool blocking)
 {
     int timeout = blocking?-1:0;
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]