summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vdagent-file-xfers.c8
-rw-r--r--src/vdagent-file-xfers.h2
-rw-r--r--src/vdagent.c9
3 files changed, 19 insertions, 0 deletions
diff --git a/src/vdagent-file-xfers.c b/src/vdagent-file-xfers.c
index 379cda0..344859d 100644
--- a/src/vdagent-file-xfers.c
+++ b/src/vdagent-file-xfers.c
@@ -315,3 +315,11 @@ void vdagent_file_xfers_data(struct vdagent_file_xfers *xfers,
g_hash_table_remove(xfers->xfers, GUINT_TO_POINTER(msg->id));
}
}
+
+void vdagent_file_xfers_error(struct udscs_connection *vdagentd, uint32_t msg_id)
+{
+ g_return_if_fail(vdagentd != NULL);
+
+ udscs_write(vdagentd, VDAGENTD_FILE_XFER_STATUS,
+ msg_id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
+}
diff --git a/src/vdagent-file-xfers.h b/src/vdagent-file-xfers.h
index 20783eb..fe5da81 100644
--- a/src/vdagent-file-xfers.h
+++ b/src/vdagent-file-xfers.h
@@ -37,5 +37,7 @@ void vdagent_file_xfers_status(struct vdagent_file_xfers *xfers,
VDAgentFileXferStatusMessage *msg);
void vdagent_file_xfers_data(struct vdagent_file_xfers *xfers,
VDAgentFileXferDataMessage *msg);
+void vdagent_file_xfers_error(struct udscs_connection *vdagentd,
+ uint32_t msg_id);
#endif
diff --git a/src/vdagent.c b/src/vdagent.c
index a048d53..9d130d5 100644
--- a/src/vdagent.c
+++ b/src/vdagent.c
@@ -93,6 +93,9 @@ void daemon_read_complete(struct udscs_connection **connp,
if (vdagent_file_xfers != NULL) {
vdagent_file_xfers_start(vdagent_file_xfers,
(VDAgentFileXferStartMessage *)data);
+ } else {
+ vdagent_file_xfers_error(*connp,
+ ((VDAgentFileXferStartMessage *)data)->id);
}
free(data);
break;
@@ -100,6 +103,9 @@ void daemon_read_complete(struct udscs_connection **connp,
if (vdagent_file_xfers != NULL) {
vdagent_file_xfers_status(vdagent_file_xfers,
(VDAgentFileXferStatusMessage *)data);
+ } else {
+ vdagent_file_xfers_error(*connp,
+ ((VDAgentFileXferStatusMessage *)data)->id);
}
free(data);
break;
@@ -107,6 +113,9 @@ void daemon_read_complete(struct udscs_connection **connp,
if (vdagent_file_xfers != NULL) {
vdagent_file_xfers_data(vdagent_file_xfers,
(VDAgentFileXferDataMessage *)data);
+ } else {
+ vdagent_file_xfers_error(*connp,
+ ((VDAgentFileXferDataMessage *)data)->id);
}
free(data);
break;