diff options
author | Alexander Larsson <alexl@redhat.com> | 2013-04-04 19:08:02 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2013-04-04 19:34:32 +0200 |
commit | f25b407fdc1ea5624ebe8b8b0e026615f1f14243 (patch) | |
tree | 0d192ea8d7ea922c8d697a161eb4ea652a1accb0 /daemon/gvfschannel.c | |
parent | 46f9c79cb7b289676128555646721d18a6c4c062 (diff) | |
download | gvfs-f25b407fdc1ea5624ebe8b8b0e026615f1f14243.tar.gz |
channel: Unqueue cancelled requests
We put a channel request on the output buffer and start writing, but
if the write is cancelled on the first call (i.e. no partial writes)
we abort immediately without ever writing the request.
However, if we do this we also need to unqueue the request from the output
buffer, as otherwise this will be sent with the next operation. This
can be problematic for seeks as the seek generation is then not in sync.
https://bugzilla.gnome.org/show_bug.cgi?id=675181
Diffstat (limited to 'daemon/gvfschannel.c')
-rw-r--r-- | daemon/gvfschannel.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/daemon/gvfschannel.c b/daemon/gvfschannel.c index ec87cb99..994b5ea1 100644 --- a/daemon/gvfschannel.c +++ b/daemon/gvfschannel.c @@ -321,21 +321,19 @@ start_queued_request (GVfsChannel *channel) req->arg1, req->arg2, req->data, req->data_len, &error); - if (job == NULL) - { - job = g_vfs_job_error_new (channel, error); - g_error_free (error); - } - if (job != NULL && req->cancelled) { /* Ignore the job, although we need to create it to rely on handle_request side effects like seek generations, etc */ g_object_unref (job); - error = - g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, - _("Operation was cancelled")); + job = NULL; + error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, + _("Operation was cancelled")); + } + + if (job == NULL) + { job = g_vfs_job_error_new (channel, error); g_error_free (error); } |