From 0e1fa26b48455d44d4028e8ebe0df6bc440a3aef Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 28 Dec 2015 17:07:18 -0700 Subject: [PATCH] Add desync check to notifications iter --- src/notification.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/notification.rs b/src/notification.rs index 291099af..f825acb8 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -100,6 +100,10 @@ impl<'a> Iterator for Iter<'a> { return Some(Ok(notification)); } + if conn.is_desynchronized() { + return Some(Err(Error::Io(desynchronized()))); + } + match conn.read_message_with_notification_nonblocking() { Ok(Some(NotificationResponse { pid, channel, payload })) => { Some(Ok(Notification {