Merge pull request #154 from dmeijboom/master

When authenticating using SASL XAUTH2 with Gmail fails
This commit is contained in:
Jon Gjengset 2020-02-20 12:37:30 -05:00 committed by GitHub
commit 3ee0952723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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" {