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
8b838ff9
Commit
8b838ff9
authored
Nov 06, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: use CURLOPT_PRIVATE
Replaces the loop in input_curl_find_request().
parent
154bdf0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+7
-5
No files found.
src/input/CurlInputPlugin.cxx
View file @
8b838ff9
...
...
@@ -224,16 +224,18 @@ static constexpr Domain curlm_domain("curlm");
*
* Runs in the I/O thread. No lock needed.
*/
gcc_pure
static
struct
input_curl
*
input_curl_find_request
(
CURL
*
easy
)
{
assert
(
io_thread_inside
());
for
(
auto
c
:
curl
.
requests
)
if
(
c
->
easy
==
easy
)
return
c
;
void
*
p
;
CURLcode
code
=
curl_easy_getinfo
(
easy
,
CURLINFO_PRIVATE
,
&
p
);
if
(
code
!=
CURLE_OK
)
return
nullptr
;
return
nullptr
;
return
(
input_curl
*
)
p
;
}
static
void
...
...
@@ -326,7 +328,6 @@ input_curl_easy_add(struct input_curl *c, Error &error)
assert
(
io_thread_inside
());
assert
(
c
!=
nullptr
);
assert
(
c
->
easy
!=
nullptr
);
assert
(
input_curl_find_request
(
c
->
easy
)
==
nullptr
);
curl
.
requests
.
push_front
(
c
);
...
...
@@ -927,6 +928,7 @@ input_curl_easy_init(struct input_curl *c, Error &error)
return
false
;
}
curl_easy_setopt
(
c
->
easy
,
CURLOPT_PRIVATE
,
(
void
*
)
c
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_USERAGENT
,
"Music Player Daemon "
VERSION
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_HEADERFUNCTION
,
...
...
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