Ignore server comments

This commit is contained in:
Dillen Meijboom 2020-02-19 21:51:44 +01:00
parent 71b60dbb3a
commit 391caf042a
No known key found for this signature in database
GPG key ID: 84D3210A4E7C255E

View file

@ -359,10 +359,16 @@ impl<T: Read + Write> Client<T> {
// TODO Clean up this code
loop {
let mut line = Vec::new();
// explicit match blocks neccessary to convert error to tuple and not bind self too
// early (see also comment on `login`)
ok_or_unauth_client_err!(self.readline(&mut line), self);
// ignore server comments
if line.starts_with(b"* ") {
continue;
}
// Some servers will only send `+\r\n`.
if line.starts_with(b"+ ") || &line == b"+\r\n" {
let challenge = if &line == b"+\r\n" {