Skip to content

Commit

Permalink
Send only info log for CloseNotify
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas committed Jul 2, 2018
1 parent c525993 commit ecd0010
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,7 @@ impl SessionCommon {

pub fn send_warning_alert(&mut self, desc: AlertDescription) {
warn!("Sending warning alert {:?}", desc);
let m = Message::build_alert(AlertLevel::Warning, desc);
let enc = self.we_encrypting;
self.send_msg(m, enc);
self.send_warning_alert_no_log(desc);
}

pub fn send_fatal_alert(&mut self, desc: AlertDescription) {
Expand All @@ -760,7 +758,8 @@ impl SessionCommon {
}

pub fn send_close_notify(&mut self) {
self.send_warning_alert(AlertDescription::CloseNotify)
info!("Sending warning alert {:?}", AlertDescription::CloseNotify);
self.send_warning_alert_no_log(AlertDescription::CloseNotify);
}

pub fn process_key_update(&mut self,
Expand Down Expand Up @@ -820,4 +819,10 @@ impl SessionCommon {
.ok_or_else(|| TLSError::HandshakeNotComplete)
}
}

fn send_warning_alert_no_log(&mut self, desc: AlertDescription) {
let m = Message::build_alert(AlertLevel::Warning, desc);
let enc = self.we_encrypting;
self.send_msg(m, enc);
}
}

0 comments on commit ecd0010

Please sign in to comment.