<div dir="ltr">ack<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 1, 2014 at 4:24 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This commit only adds if (vdagent_file_xfers != NULL) {} checks before<br>
calling into the file transfer code. This allows to disable file transfer<br>
handling by setting this variable to NULL.<br>
---<br>
src/vdagent.c | 30 ++++++++++++++++++++----------<br>
1 file changed, 20 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/vdagent.c b/src/vdagent.c<br>
index d7f7aba..3ab2352 100644<br>
--- a/src/vdagent.c<br>
+++ b/src/vdagent.c<br>
@@ -89,25 +89,33 @@ void daemon_read_complete(struct udscs_connection **connp,<br>
}<br>
break;<br>
case VDAGENTD_FILE_XFER_START:<br>
- vdagent_file_xfers_start(vdagent_file_xfers,<br>
- (VDAgentFileXferStartMessage *)data);<br>
+ if (vdagent_file_xfers != NULL) {<br>
+ vdagent_file_xfers_start(vdagent_file_xfers,<br>
+ (VDAgentFileXferStartMessage *)data);<br>
+ }<br>
free(data);<br>
break;<br>
case VDAGENTD_FILE_XFER_STATUS:<br>
- vdagent_file_xfers_status(vdagent_file_xfers,<br>
- (VDAgentFileXferStatusMessage *)data);<br>
+ if (vdagent_file_xfers != NULL) {<br>
+ vdagent_file_xfers_status(vdagent_file_xfers,<br>
+ (VDAgentFileXferStatusMessage *)data);<br>
+ }<br>
free(data);<br>
break;<br>
case VDAGENTD_FILE_XFER_DATA:<br>
- vdagent_file_xfers_data(vdagent_file_xfers,<br>
- (VDAgentFileXferDataMessage *)data);<br>
+ if (vdagent_file_xfers != NULL) {<br>
+ vdagent_file_xfers_data(vdagent_file_xfers,<br>
+ (VDAgentFileXferDataMessage *)data);<br>
+ }<br>
free(data);<br>
break;<br>
case VDAGENTD_CLIENT_DISCONNECTED:<br>
vdagent_x11_client_disconnected(x11);<br>
- vdagent_file_xfers_destroy(vdagent_file_xfers);<br>
- vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,<br>
- fx_open_dir, debug);<br>
+ if (vdagent_file_xfers != NULL) {<br>
+ vdagent_file_xfers_destroy(vdagent_file_xfers);<br>
+ vdagent_file_xfers = vdagent_file_xfers_create(client, fx_dir,<br>
+ fx_open_dir, debug);<br>
+ }<br>
break;<br>
default:<br>
syslog(LOG_ERR, "Unknown message from vdagentd type: %d, ignoring",<br>
@@ -298,7 +306,9 @@ reconnect:<br>
udscs_client_handle_fds(&client, &readfds, &writefds);<br>
}<br>
<br>
- vdagent_file_xfers_destroy(vdagent_file_xfers);<br>
+ if (vdagent_file_xfers != NULL) {<br>
+ vdagent_file_xfers_destroy(vdagent_file_xfers);<br>
+ }<br>
vdagent_x11_destroy(x11, client == NULL);<br>
udscs_destroy_connection(&client);<br>
if (!quit && do_daemonize)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.0<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>