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
3c66feff
Commit
3c66feff
authored
Jan 08, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/curl/Global: defer the ReadInfo() call
Fixes a crash that can occur due to recursion from InvalidateSockets() to ReadInfo() to CurlRequest callbacks.
parent
218c3bc0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
NEWS
NEWS
+2
-0
Global.cxx
src/lib/curl/Global.cxx
+7
-1
Global.hxx
src/lib/curl/Global.hxx
+5
-1
No files found.
NEWS
View file @
3c66feff
ver 0.20.1 (not yet released)
ver 0.20.1 (not yet released)
* input
- curl: fix crash bug
* mixer
* mixer
- alsa: normalize displayed volume according to human perception
- alsa: normalize displayed volume according to human perception
* fix crash with volume_normalization enabled
* fix crash with volume_normalization enabled
...
...
src/lib/curl/Global.cxx
View file @
3c66feff
...
@@ -96,7 +96,7 @@ private:
...
@@ -96,7 +96,7 @@ private:
};
};
CurlGlobal
::
CurlGlobal
(
EventLoop
&
_loop
)
CurlGlobal
::
CurlGlobal
(
EventLoop
&
_loop
)
:
TimeoutMonitor
(
_loop
)
:
TimeoutMonitor
(
_loop
)
,
DeferredMonitor
(
_loop
)
{
{
multi
.
SetOption
(
CURLMOPT_SOCKETFUNCTION
,
CurlSocket
::
SocketFunction
);
multi
.
SetOption
(
CURLMOPT_SOCKETFUNCTION
,
CurlSocket
::
SocketFunction
);
multi
.
SetOption
(
CURLMOPT_SOCKETDATA
,
this
);
multi
.
SetOption
(
CURLMOPT_SOCKETDATA
,
this
);
...
@@ -262,5 +262,11 @@ CurlGlobal::SocketAction(curl_socket_t fd, int ev_bitmask)
...
@@ -262,5 +262,11 @@ CurlGlobal::SocketAction(curl_socket_t fd, int ev_bitmask)
"curl_multi_socket_action() failed: %s"
,
"curl_multi_socket_action() failed: %s"
,
curl_multi_strerror
(
mcode
));
curl_multi_strerror
(
mcode
));
DeferredMonitor
::
Schedule
();
}
void
CurlGlobal
::
RunDeferred
()
{
ReadInfo
();
ReadInfo
();
}
}
src/lib/curl/Global.hxx
View file @
3c66feff
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "Multi.hxx"
#include "Multi.hxx"
#include "event/TimeoutMonitor.hxx"
#include "event/TimeoutMonitor.hxx"
#include "event/DeferredMonitor.hxx"
class
CurlSocket
;
class
CurlSocket
;
class
CurlRequest
;
class
CurlRequest
;
...
@@ -39,7 +40,7 @@ class CurlRequest;
...
@@ -39,7 +40,7 @@ class CurlRequest;
/**
/**
* Manager for the global CURLM object.
* Manager for the global CURLM object.
*/
*/
class
CurlGlobal
final
:
private
Timeout
Monitor
{
class
CurlGlobal
final
:
TimeoutMonitor
,
Deferred
Monitor
{
CurlMulti
multi
;
CurlMulti
multi
;
public
:
public
:
...
@@ -81,6 +82,9 @@ private:
...
@@ -81,6 +82,9 @@ private:
/* virtual methods from class TimeoutMonitor */
/* virtual methods from class TimeoutMonitor */
void
OnTimeout
()
override
;
void
OnTimeout
()
override
;
/* virtual methods from class DeferredMonitor */
void
RunDeferred
()
override
;
};
};
#endif
#endif
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