[Spice-devel] [PATCH spice-streaming-agent v4 4/4] Stub to handle errors from server

Frediano Ziglio fziglio at redhat.com
Wed Feb 21 15:47:16 UTC 2018


Base error message handling.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/spice-streaming-agent.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index 0e419bc..aeee5d3 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -126,6 +126,12 @@ static void handle_stream_capabilities(uint32_t len)
     }
 }
 
+static void handle_stream_error(uint32_t len)
+{
+    // TODO read message and use it
+    throw std::runtime_error("got an error message from server");
+}
+
 static void read_command_from_device(void)
 {
     StreamDevHeader hdr;
@@ -145,6 +151,8 @@ static void read_command_from_device(void)
     switch (hdr.type) {
     case STREAM_TYPE_CAPABILITIES:
         return handle_stream_capabilities(hdr.size);
+    case STREAM_TYPE_NOTIFY_ERROR:
+        return handle_stream_error(hdr.size);
     case STREAM_TYPE_START_STOP:
         return handle_stream_start_stop(hdr.size);
     }
-- 
2.14.3



More information about the Spice-devel mailing list