Skip to content

Commit

Permalink
Try to properly handle session errors (locka99#73)
Browse files Browse the repository at this point in the history
I'll apply this, thanks!
  • Loading branch information
svanharmelen authored Nov 19, 2020
1 parent f774dab commit 25df368
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions client/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2543,10 +2543,18 @@ impl Session {
let service_result = response.response_header.service_result;
session_debug!(self, "Service fault received with {} error code", service_result);
session_trace!(self, "ServiceFault {:?}", response);
// Terminate timer if
if service_result == StatusCode::BadTooManyPublishRequests {
// Turn off publish requests until server says otherwise
wait_for_publish_response = true;

match service_result {
StatusCode::BadTooManyPublishRequests => {
// Turn off publish requests until server says otherwise
wait_for_publish_response = true
}
StatusCode::BadSessionClosed | StatusCode::BadSessionIdInvalid => {
let mut session_state =
trace_write_lock_unwrap!(self.session_state);
session_state.on_session_closed(service_result)
}
_ => (),
}
}
_ => {
Expand Down

0 comments on commit 25df368

Please sign in to comment.