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
ba31d176
Commit
ba31d176
authored
Aug 25, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: eliminate attribute "eof"
Assume the flag is true when the "easy" CURL handle is NULL. That way, we don't need to keep track if CURL has sent us the "DONE" information yet.
parent
68edbc3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
curl_input_plugin.c
src/input/curl_input_plugin.c
+4
-11
No files found.
src/input/curl_input_plugin.c
View file @
ba31d176
...
...
@@ -82,9 +82,6 @@ struct input_curl {
/** has something been added to the buffers list? */
bool
buffered
;
/** did libcurl tell us the we're at the end of the response body? */
bool
eof
;
/** error message provided by libcurl */
char
error
[
CURL_ERROR_SIZE
];
...
...
@@ -207,7 +204,6 @@ input_curl_easy_free(struct input_curl *c)
g_free
(
c
->
range
);
c
->
range
=
NULL
;
c
->
eof
=
true
;
c
->
base
.
ready
=
true
;
}
...
...
@@ -285,7 +281,7 @@ input_curl_select(struct input_curl *c, GError **error_r)
.
tv_usec
=
0
,
};
assert
(
!
c
->
eof
);
assert
(
c
->
easy
!=
NULL
);
FD_ZERO
(
&
rfds
);
FD_ZERO
(
&
wfds
);
...
...
@@ -331,7 +327,7 @@ fill_buffer(struct input_curl *c, GError **error_r)
{
CURLMcode
mcode
=
CURLM_CALL_MULTI_PERFORM
;
while
(
!
c
->
eof
&&
g_queue_is_empty
(
c
->
buffers
))
{
while
(
c
->
easy
!=
NULL
&&
g_queue_is_empty
(
c
->
buffers
))
{
int
running_handles
;
bool
bret
;
...
...
@@ -499,7 +495,7 @@ input_curl_eof(G_GNUC_UNUSED struct input_stream *is)
{
struct
input_curl
*
c
=
(
struct
input_curl
*
)
is
;
return
c
->
e
of
&&
g_queue_is_empty
(
c
->
buffers
);
return
c
->
e
asy
==
NULL
&&
g_queue_is_empty
(
c
->
buffers
);
}
static
int
...
...
@@ -516,7 +512,7 @@ input_curl_buffer(struct input_stream *is, GError **error_r)
c
->
buffered
=
false
;
if
(
!
is
->
ready
&&
!
c
->
eof
)
if
(
!
is
->
ready
&&
c
->
easy
!=
NULL
)
/* not ready yet means the caller is waiting in a busy
loop; relax that by calling select() on the
socket */
...
...
@@ -656,8 +652,6 @@ input_curl_easy_init(struct input_curl *c, GError **error_r)
CURLcode
code
;
CURLMcode
mcode
;
c
->
eof
=
false
;
c
->
easy
=
curl_easy_init
();
if
(
c
->
easy
==
NULL
)
{
g_set_error
(
error_r
,
curl_quark
(),
0
,
...
...
@@ -810,7 +804,6 @@ input_curl_seek(struct input_stream *is, goffset offset, int whence,
/* seek to EOF: simulate empty result; avoid
triggering a "416 Requested Range Not Satisfiable"
response */
c
->
eof
=
true
;
return
true
;
}
...
...
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