-
-
Notifications
You must be signed in to change notification settings - Fork 111
Avoid reattempting authentication for auth versions where it has no effect #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*~ | ||
*.pyc | ||
test-env* | ||
junk/ | ||
junk/ | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -494,7 +494,8 @@ func (c *Connection) authenticate(ctx context.Context) (err error) { | |
} | ||
} | ||
|
||
retries := 1 | ||
shouldReattempt := c.Auth.ShouldReattemptAuth() | ||
|
||
again: | ||
var req *http.Request | ||
req, err = c.Auth.Request(ctx, c) | ||
|
@@ -519,8 +520,8 @@ again: | |
// Try again for a limited number of times on | ||
// AuthorizationFailed or BadRequest. This allows us | ||
// to try some alternate forms of the request | ||
if (err == AuthorizationFailed || err == BadRequest) && retries > 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this still needs the retries logic otherwise it will retry forever won't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The inclusion of |
||
retries-- | ||
if (err == AuthorizationFailed || err == BadRequest) && shouldReattempt { | ||
shouldReattempt = false | ||
goto again | ||
} | ||
return | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't ever seem to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's checked on line 523 and assigned false on line 524, no?