From 00c4ef9e0d4bc4d1ea210e7a0d31494b4116bb4a Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Wed, 13 May 2020 02:16:34 -0600 Subject: * Avoid error messages or tcp timeouts when cancelling imap authentication. --- imap/src/c-client/auth_bea.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'imap/src/c-client/auth_bea.c') diff --git a/imap/src/c-client/auth_bea.c b/imap/src/c-client/auth_bea.c index 2273b413..1db020a4 100644 --- a/imap/src/c-client/auth_bea.c +++ b/imap/src/c-client/auth_bea.c @@ -138,13 +138,9 @@ long auth_oauthbearer_client (authchallenge_t challenger,authrespond_t responder } /* empty challenge or user requested abort or client does not have info */ - if(!oauth2.access_token) { - if (base){ - (*responder) (stream,base,"",strlen(base)); - if ((challenge = (*challenger) (stream,&clen)) != NULL) - fs_give ((void **) &challenge); - } - (*responder) (stream,NIL,NIL,0); + if(tryanother || !oauth2.access_token) { + if (!base) + (*responder) (stream,NIL,NIL,0); *trial = 0; /* cancel subsequent attempts */ ret = LONGT; /* will get a BAD response back */ } @@ -196,7 +192,7 @@ long auth_oauthbearer_client (authchallenge_t challenger,authrespond_t responder fs_give ((void **) &response); } } - if (!ret || !oauth2.name || tryanother) + if (!ret || !oauth2.name) *trial = 65535; /* don't retry if bad protocol */ return ret; } -- cgit v1.2.3-54-g00ecf