<div dir="ltr">ack<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 4:06 PM, Yonit Halperin <span dir="ltr"><<a href="mailto:yhalperi@redhat.com" target="_blank">yhalperi@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">spice_channel_client_error prints warning and shutdowns the<br>
channel_client that hit the error.<br>
This macro is useful for errors that are specific for one session<br>
and that are unrecoverable only with respect to this session.<br>
Prefer disconnecting a client over aborting when possible.<br>
---<br>
server/red_channel.h | 11 +++++++++++<br>
1 file changed, 11 insertions(+)<br>
<br>
diff --git a/server/red_channel.h b/server/red_channel.h<br>
index f770510..ba299b6 100644<br>
--- a/server/red_channel.h<br>
+++ b/server/red_channel.h<br>
@@ -328,6 +328,17 @@ struct RedChannel {<br>
#endif<br>
};<br>
<br>
+/*<br>
+ * When an error occurs over a channel, we treat it as a warning<br>
+ * for spice-server and shutdown the channel.<br>
+ */<br>
+#define spice_channel_client_error(rcc, format, ...) \<br>
+ do { \<br>
+ spice_warning("rcc %p type %u id %u: " format, rcc, \<br>
+ rcc->channel->type, rcc->channel->id, ## __VA_ARGS__); \<br>
+ red_channel_client_shutdown(rcc); \<br>
+ } while (0)<br>
+<br>
/* if one of the callbacks should cause disconnect, use red_channel_shutdown and don't<br>
* explicitly destroy the channel */<br>
RedChannel *red_channel_create(int size,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.1.4<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div>