Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Israel Garcia
libcloudstorage
Commits
46f26058
Commit
46f26058
authored
Feb 10, 2018
by
Paweł Wegner
Browse files
Request: don't wait for auth to finish.
parent
20fc266e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Request/AuthorizeRequest.cpp
View file @
46f26058
...
...
@@ -112,6 +112,18 @@ void AuthorizeRequest::cancel() {
Request
::
cancel
();
}
void
AuthorizeRequest
::
finish
()
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
provider_mutex_
);
if
(
provider
())
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
provider
()
->
current_authorization_mutex_
);
if
(
!
provider
()
->
auth_callbacks_
.
empty
())
return
;
}
}
Request
::
finish
();
}
void
AuthorizeRequest
::
set_server
(
std
::
shared_ptr
<
IHttpServer
>
p
)
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
lock_
);
auth_server_
=
p
;
...
...
src/Request/AuthorizeRequest.h
View file @
46f26058
...
...
@@ -42,7 +42,8 @@ class AuthorizeRequest : public Request<EitherError<void>> {
void
oauth2Authorization
(
AuthorizeCompleted
);
void
sendCancel
();
void
cancel
();
void
cancel
()
override
;
void
finish
()
override
;
void
set_server
(
std
::
shared_ptr
<
IHttpServer
>
);
private:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment