diff options
author | Alexander Larsson <alexl@redhat.com> | 2013-04-04 19:13:05 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2013-04-04 19:34:32 +0200 |
commit | 5dcde303ae36986fd7dda4efb540ce4719fb648a (patch) | |
tree | 31adbf188cf0ab031759f492345e7e21e2585926 /client | |
parent | f25b407fdc1ea5624ebe8b8b0e026615f1f14243 (diff) | |
download | gvfs-5dcde303ae36986fd7dda4efb540ce4719fb648a.tar.gz |
GVfsChannels: Verify that replies are for the right serial
We might be getting replies for old cancelled operations which
we need to ignore.
https://bugzilla.gnome.org/show_bug.cgi?id=675181
Diffstat (limited to 'client')
-rw-r--r-- | client/gdaemonfileinputstream.c | 9 | ||||
-rw-r--r-- | client/gdaemonfileoutputstream.c | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/client/gdaemonfileinputstream.c b/client/gdaemonfileinputstream.c index f73c6816..9fc8ae5d 100644 --- a/client/gdaemonfileinputstream.c +++ b/client/gdaemonfileinputstream.c @@ -1035,7 +1035,8 @@ iterate_close_state_machine (GDaemonFileInputStream *file, IOOperationData *io_o op->state = CLOSE_STATE_HANDLE_INPUT_BLOCK; break; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_CLOSED) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_CLOSED && + reply.seq_nr == op->seq_nr) { op->ret_val = TRUE; g_string_truncate (file->input_buffer, 0); @@ -1301,7 +1302,8 @@ iterate_seek_state_machine (GDaemonFileInputStream *file, IOOperationData *io_op op->state = SEEK_STATE_HANDLE_INPUT_BLOCK; break; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_SEEK_POS) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_SEEK_POS && + reply.seq_nr == op->seq_nr) { op->ret_val = TRUE; op->ret_offset = ((goffset)reply.arg2) << 32 | (goffset)reply.arg1; @@ -1580,7 +1582,8 @@ iterate_query_state_machine (GDaemonFileInputStream *file, op->state = QUERY_STATE_HANDLE_INPUT_BLOCK; break; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_INFO) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_INFO && + reply.seq_nr == op->seq_nr) { op->info = gvfs_file_info_demarshal (data, reply.arg2); g_string_truncate (file->input_buffer, 0); diff --git a/client/gdaemonfileoutputstream.c b/client/gdaemonfileoutputstream.c index 70535b19..ece1d2ea 100644 --- a/client/gdaemonfileoutputstream.c +++ b/client/gdaemonfileoutputstream.c @@ -599,7 +599,8 @@ iterate_write_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_ g_string_truncate (file->input_buffer, 0); return STATE_OP_DONE; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_WRITTEN) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_WRITTEN && + reply.seq_nr == op->seq_nr) { op->ret_val = reply.arg1; g_string_truncate (file->input_buffer, 0); @@ -757,7 +758,8 @@ iterate_close_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_ g_string_truncate (file->input_buffer, 0); return STATE_OP_DONE; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_CLOSED) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_CLOSED && + reply.seq_nr == op->seq_nr) { op->ret_val = TRUE; if (reply.arg2 > 0) @@ -951,7 +953,8 @@ iterate_seek_state_machine (GDaemonFileOutputStream *file, IOOperationData *io_o g_string_truncate (file->input_buffer, 0); return STATE_OP_DONE; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_SEEK_POS) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_SEEK_POS && + reply.seq_nr == op->seq_nr) { op->ret_val = TRUE; op->ret_offset = ((goffset)reply.arg2) << 32 | (goffset)reply.arg1; @@ -1133,7 +1136,8 @@ iterate_query_state_machine (GDaemonFileOutputStream *file, g_string_truncate (file->input_buffer, 0); return STATE_OP_DONE; } - else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_INFO) + else if (reply.type == G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_INFO && + reply.seq_nr == op->seq_nr) { op->info = gvfs_file_info_demarshal (data, reply.arg2); g_string_truncate (file->input_buffer, 0); |