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
8b84e5b3
Commit
8b84e5b3
authored
Jun 17, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: hold mutex while writing to postponed_error
parent
e1d5ddb4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
AsyncInputStream.cxx
src/input/AsyncInputStream.cxx
+10
-0
AsyncInputStream.hxx
src/input/AsyncInputStream.hxx
+2
-0
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+4
-3
No files found.
src/input/AsyncInputStream.cxx
View file @
8b84e5b3
...
...
@@ -63,6 +63,16 @@ AsyncInputStream::Pause()
paused
=
true
;
}
void
AsyncInputStream
::
PostponeError
(
Error
&&
error
)
{
assert
(
io_thread_inside
());
seek_state
=
SeekState
::
NONE
;
postponed_error
=
std
::
move
(
error
);
cond
.
broadcast
();
}
inline
void
AsyncInputStream
::
Resume
()
{
...
...
src/input/AsyncInputStream.hxx
View file @
8b84e5b3
...
...
@@ -86,6 +86,8 @@ protected:
open
=
false
;
}
void
PostponeError
(
Error
&&
error
);
bool
IsBufferEmpty
()
const
{
return
buffer
.
IsEmpty
();
}
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
8b84e5b3
...
...
@@ -777,9 +777,10 @@ CurlInputStream::DoSeek(offset_type new_offset)
return
;
}
Error
error
;
if
(
!
InitEasy
(
postponed_error
))
{
mutex
.
lock
();
SeekDone
(
);
PostponeError
(
std
::
move
(
error
)
);
return
;
}
...
...
@@ -790,9 +791,9 @@ CurlInputStream::DoSeek(offset_type new_offset)
curl_easy_setopt
(
easy
,
CURLOPT_RANGE
,
range
);
}
if
(
!
input_curl_easy_add_indirect
(
this
,
postponed_
error
))
{
if
(
!
input_curl_easy_add_indirect
(
this
,
error
))
{
mutex
.
lock
();
SeekDone
(
);
PostponeError
(
std
::
move
(
error
)
);
return
;
}
...
...
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