Move desync check back a bit

This commit is contained in:
Steven Fackler 2015-09-19 11:02:10 -07:00
parent 9d25328322
commit bf021bb475

View File

@ -99,14 +99,15 @@ impl<'a> Iterator for BlockingIter<'a> {
fn next(&mut self) -> Option<Result<Notification>> {
let mut conn = self.conn.conn.borrow_mut();
if conn.is_desynchronized() {
return Some(Err(Error::IoError(desynchronized())));
}
if let Some(notification) = conn.notifications.pop_front() {
return Some(Ok(notification));
}
if conn.is_desynchronized() {
return Some(Err(Error::IoError(desynchronized())));
}
match conn.read_message_with_notification() {
Ok(NotificationResponse { pid, channel, payload }) => {
Some(Ok(Notification {