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
56f763a4
Commit
56f763a4
authored
Nov 02, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: forget Content-Length (and more) after redirect
Fixes playback of redirected streams.
parent
a2eb14f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
NEWS
NEWS
+2
-0
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+26
-0
No files found.
NEWS
View file @
56f763a4
ver 0.19.2 (not yet released)
* input
- curl: fix redirected streams
* playlist
- don't allow empty playlist name
- m3u: don't ignore unterminated last line
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
56f763a4
...
...
@@ -109,6 +109,13 @@ struct CurlInputStream final : public AsyncInputStream {
*/
void
FreeEasyIndirect
();
/**
* Called when a new response begins. This is used to discard
* headers from previous responses (for example authentication
* and redirects).
*/
void
ResponseBoundary
();
void
HeaderReceived
(
const
char
*
name
,
std
::
string
&&
value
);
size_t
DataReceived
(
const
void
*
ptr
,
size_t
size
);
...
...
@@ -598,6 +605,20 @@ CurlInputStream::~CurlInputStream()
}
inline
void
CurlInputStream
::
ResponseBoundary
()
{
/* undo all effects of HeaderReceived() because the previous
response was not applicable for this stream */
seekable
=
false
;
size
=
UNKNOWN_SIZE
;
ClearMimeType
();
ClearTag
();
// TODO: reset the IcyInputStream?
}
inline
void
CurlInputStream
::
HeaderReceived
(
const
char
*
name
,
std
::
string
&&
value
)
{
if
(
IsSeekPending
())
...
...
@@ -645,6 +666,11 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
size
*=
nmemb
;
const
char
*
header
=
(
const
char
*
)
ptr
;
if
(
size
>
5
&&
memcmp
(
header
,
"HTTP/"
,
5
)
==
0
)
{
c
.
ResponseBoundary
();
return
size
;
}
const
char
*
end
=
header
+
size
;
char
name
[
64
];
...
...
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