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
c9278bfc
Commit
c9278bfc
authored
Nov 06, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: don't abort all requests on curl_multi_perform() error
Eliminate some complicated code that's not worth the trouble.
parent
8b838ff9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
40 deletions
+7
-40
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+7
-40
No files found.
src/input/CurlInputPlugin.cxx
View file @
c9278bfc
...
...
@@ -404,33 +404,6 @@ input_curl_easy_free_indirect(struct input_curl *c)
}
/**
* Abort and free all HTTP requests.
*
* Runs in the I/O thread. The caller must not hold locks.
*/
static
void
input_curl_abort_all_requests
(
const
Error
&
error
)
{
assert
(
io_thread_inside
());
assert
(
error
.
IsDefined
());
while
(
!
curl
.
requests
.
empty
())
{
struct
input_curl
*
c
=
curl
.
requests
.
front
();
assert
(
!
c
->
postponed_error
.
IsDefined
());
input_curl_easy_free
(
c
);
const
ScopeLock
protect
(
c
->
base
.
mutex
);
c
->
postponed_error
.
Set
(
error
);
c
->
base
.
ready
=
true
;
c
->
base
.
cond
.
broadcast
();
}
}
/**
* A HTTP request is finished.
*
* Runs in the I/O thread. The caller must not hold locks.
...
...
@@ -497,7 +470,7 @@ input_curl_info_read(void)
*
* Runs in the I/O thread. The caller must not hold locks.
*/
static
bool
static
void
input_curl_perform
(
void
)
{
assert
(
io_thread_inside
());
...
...
@@ -509,16 +482,10 @@ input_curl_perform(void)
mcode
=
curl_multi_perform
(
curl
.
multi
,
&
running_handles
);
}
while
(
mcode
==
CURLM_CALL_MULTI_PERFORM
);
if
(
mcode
!=
CURLM_OK
&&
mcode
!=
CURLM_CALL_MULTI_PERFORM
)
{
Error
error
;
error
.
Format
(
curlm_domain
,
mcode
,
"curl_multi_perform() failed: %s"
,
curl_multi_strerror
(
mcode
));
input_curl_abort_all_requests
(
error
);
return
false
;
}
return
true
;
if
(
mcode
!=
CURLM_OK
&&
mcode
!=
CURLM_CALL_MULTI_PERFORM
)
FormatError
(
curlm_domain
,
"curl_multi_perform() failed: %s"
,
curl_multi_strerror
(
mcode
));
}
int
...
...
@@ -548,8 +515,8 @@ CurlSockets::PrepareSockets()
void
CurlSockets
::
DispatchSockets
()
{
i
f
(
input_curl_perform
())
input_curl_info_read
();
i
nput_curl_perform
();
input_curl_info_read
();
}
/*
...
...
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