Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ec207840
Commit
ec207840
authored
Nov 10, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/curl: migrate from DeferredMonitor to DeferEvent
parent
42ad753e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
CurlStorage.cxx
src/storage/plugins/CurlStorage.cxx
+9
-6
No files found.
src/storage/plugins/CurlStorage.cxx
View file @
ec207840
...
...
@@ -31,7 +31,7 @@
#include "lib/expat/ExpatParser.hxx"
#include "fs/Traits.hxx"
#include "event/Call.hxx"
#include "event/Defer
redMonitor
.hxx"
#include "event/Defer
Event
.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "util/ChronoUtil.hxx"
...
...
@@ -88,7 +88,9 @@ CurlStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
return
PathTraitsUTF8
::
Relative
(
base
.
c_str
(),
uri_utf8
);
}
class
BlockingHttpRequest
:
protected
CurlResponseHandler
,
DeferredMonitor
{
class
BlockingHttpRequest
:
protected
CurlResponseHandler
{
DeferEvent
defer_start
;
std
::
exception_ptr
postponed_error
;
bool
done
=
false
;
...
...
@@ -101,12 +103,13 @@ protected:
public
:
BlockingHttpRequest
(
CurlGlobal
&
curl
,
const
char
*
uri
)
:
DeferredMonitor
(
curl
.
GetEventLoop
()),
:
defer_start
(
curl
.
GetEventLoop
(),
BIND_THIS_METHOD
(
OnDeferredStart
)),
request
(
curl
,
uri
,
*
this
)
{
// TODO: use CurlInputStream's configuration
/* start the transfer inside the IOThread */
DeferredMonitor
::
Schedule
();
defer_start
.
Schedule
();
}
void
Wait
()
{
...
...
@@ -133,8 +136,8 @@ protected:
}
private
:
/*
virtual methods from DeferredMonitor
*/
void
RunDeferred
()
final
{
/*
DeferEvent callback
*/
void
OnDeferredStart
()
noexcept
{
assert
(
!
done
);
request
.
Start
();
...
...
Write
Preview
Markdown
is supported
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