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
edcd0b99
Commit
edcd0b99
authored
Jan 11, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/curl/Request: add methods StartIndirect(), StopIndirect()
parent
55d14739
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
Request.cxx
src/lib/curl/Request.cxx
+17
-0
Request.hxx
src/lib/curl/Request.hxx
+10
-0
No files found.
src/lib/curl/Request.cxx
View file @
edcd0b99
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "Global.hxx"
#include "Global.hxx"
#include "Version.hxx"
#include "Version.hxx"
#include "Handler.hxx"
#include "Handler.hxx"
#include "event/Call.hxx"
#include "util/RuntimeError.hxx"
#include "util/RuntimeError.hxx"
#include "util/StringStrip.hxx"
#include "util/StringStrip.hxx"
#include "util/StringView.hxx"
#include "util/StringView.hxx"
...
@@ -81,6 +82,14 @@ CurlRequest::Start()
...
@@ -81,6 +82,14 @@ CurlRequest::Start()
}
}
void
void
CurlRequest
::
StartIndirect
()
{
BlockingCall
(
global
.
GetEventLoop
(),
[
this
](){
Start
();
});
}
void
CurlRequest
::
Stop
()
noexcept
CurlRequest
::
Stop
()
noexcept
{
{
if
(
!
registered
)
if
(
!
registered
)
...
@@ -91,6 +100,14 @@ CurlRequest::Stop() noexcept
...
@@ -91,6 +100,14 @@ CurlRequest::Stop() noexcept
}
}
void
void
CurlRequest
::
StopIndirect
()
{
BlockingCall
(
global
.
GetEventLoop
(),
[
this
](){
Stop
();
});
}
void
CurlRequest
::
FreeEasy
()
noexcept
CurlRequest
::
FreeEasy
()
noexcept
{
{
if
(
!
easy
)
if
(
!
easy
)
...
...
src/lib/curl/Request.hxx
View file @
edcd0b99
...
@@ -94,12 +94,22 @@ public:
...
@@ -94,12 +94,22 @@ public:
void
Start
();
void
Start
();
/**
/**
* A thread-safe version of Start().
*/
void
StartIndirect
();
/**
* Unregister this request via CurlGlobal::Remove().
* Unregister this request via CurlGlobal::Remove().
*
*
* This method must be called in the event loop thread.
* This method must be called in the event loop thread.
*/
*/
void
Stop
()
noexcept
;
void
Stop
()
noexcept
;
/**
* A thread-safe version of Stop().
*/
void
StopIndirect
();
CURL
*
Get
()
noexcept
{
CURL
*
Get
()
noexcept
{
return
easy
.
Get
();
return
easy
.
Get
();
}
}
...
...
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