[PATCH vdagent 10/11] udscs: Add udscs_is_write_pending()

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

 



This is necessary for the following GMainLoop integration.
---
 src/udscs.c | 6 ++++++
 src/udscs.h | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/src/udscs.c b/src/udscs.c
index 2761cbb..4a0e193 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -359,6 +359,12 @@ int udscs_client_get_fd(struct udscs_connection *conn)
     return conn->fd;
 }
 
+gboolean udscs_is_write_pending(struct udscs_connection *conn)
+{
+    g_return_val_if_fail(conn != NULL, FALSE);
+    return (conn->write_buf != NULL);
+}
+
 #ifndef UDSCS_NO_SERVER
 
 /* ---------- Server-side implementation ---------- */
diff --git a/src/udscs.h b/src/udscs.h
index 08e71c8..a8ca952 100644
--- a/src/udscs.h
+++ b/src/udscs.h
@@ -126,6 +126,10 @@ void udscs_do_read(struct udscs_connection **connp);
  */
 void udscs_do_write(struct udscs_connection **connp);
 
+/* Return TRUE if there's some data in the write buffer to be written,
+ * otherwise return FALSE.
+ */
+gboolean udscs_is_write_pending(struct udscs_connection *conn);
 
 #ifndef UDSCS_NO_SERVER
 
-- 
2.13.5

_______________________________________________
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]