[Spice-devel] [PATCH spice-vdagent] file-xfer: Send more detailed error messages

Jakub Janků janku.jakub.jj at gmail.com
Sun May 28 21:30:19 UTC 2017


Send VD_AGENT_FILE_XFER_STATUS_NO_AGENT and
VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED instead o`f general error, when the
given error occurs.

send_file_xfer_status() ensures, these errors are sent only to clients with
VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS capability.
---
 src/vdagentd/vdagentd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
index 73b892f..c6f5e40 100644
--- a/src/vdagentd/vdagentd.c
+++ b/src/vdagentd/vdagentd.c
@@ -349,14 +349,14 @@ static void do_client_file_xfer(struct vdagent_virtio_port *vport,
             send_file_xfer_status(vport,
                "Could not find an agent connection belonging to the "
                "active session, cancelling file-xfer",
-               s->id, VD_AGENT_FILE_XFER_STATUS_CANCELLED, NULL, 0);
+               s->id, VD_AGENT_FILE_XFER_STATUS_NO_AGENT, NULL, 0);
             return;
         } else if (session_info_session_is_locked(session_info)) {
             syslog(LOG_DEBUG, "Session is locked, skipping file-xfer-start");
             send_file_xfer_status(vport,
                "User's session is locked and cannot start file transfer. "
                "Cancelling file-xfer",
-               s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
+               s->id, VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED, NULL, 0);
             return;
         }
         udscs_write(active_session_conn, VDAGENTD_FILE_XFER_START, 0, 0,
-- 
2.9.4



More information about the Spice-devel mailing list