We should first shut down TLS so we can signal the other end a clean shutdown
in contrast to a socket failure.
Big thanks to wget(1) to find it. Fantastic tool.
This generates error pages based on IDs. This allows to reuse errors
and add more advanced information to them.
This patch also makes Icecast send in plain text OR HTML based
on the clients Accept:-string.
This allows ICY source clients to log in again with 2.4.x-style config.
ICY does not provide a username. Therefore the username was unset.
This patch sets the username for ICY source connections and allow them
to be handled as if a username was provided.
Configuration tag <shoutcast-user> was added to select the username to set
to. This defaults to "source".
This adds support to read metadata from Ogg/Opus streams:
* Original sample rate from OpusHead,
* number of channels from OpusHead,
* Tags from OpusTags.
This adds spaces into the strings such as "nomatch" (-> "no match")
as returned by auth_result2str(). This is to improve readability of
resulting logfiles by most uses.
This fixes a number of segfault happening in case config tags are
empty. This patch also adds warnings for most cases.
Please test for any regressions.
This should likely be ported to 2.4.4 as well.
Closes: #2265
libspeex reports warnings in case of oddnesses with the data to stderr.
However Icecast2 uses those functions in it's codec probeing process.
This way libspeex will write messages to a posibily reused random handle.
This is clearly a bug by package maintainers of libspeex.
See the source code of this change as well as libspeex's source code
as reference.
This fixes the regression introduced by r19250 (461a537561).
The fix checks if the source client is actually known before printing it's IP-Address.
See also: #2016
As proposed in #2272, this renames the mount specific
mp3-metadata-interval to icy-metadata-interval to prevent
confusion about what it does (setting the icy metadata
interval) and to make clear it's not mp3 specific but ICY
specific.
This changes the file extension check in a way that it no longer
ignores trailing characters. This significantly reduces the risk
for false positives while matching. However this invalidates old
setups with files like foo.xsl3. However I have never files like
that in the wild.
This is based on the patch privided by ePirat in ticket #2248.
See: #2248
This replaces the add node function with the one intended for text nodes
to prevent that invalid entities are not encoded and therefore could
break the XML output.
(See d739c65e54 and #2255)
This fixes a bug where listener Referer or User-Agent strings containing
a sequence like `&T;` was not escaped properly and therefore made the
whole XML document invalid.
Injecting new XML nodes (<foo></foo>) was not possible, it seems in the
worse case all it could cause was that the XML failed to parse.
Fix#2255
There was an error how URIs were handled in our custom XSL loader
that rewrites include URIs to point to admin dir if the include
is not found in the current dir.
The check for the file would not work if the path contains chars
that are usually escaped in URIs, like a space (%20), as we get
a already encoded version of that URI in the loader and did not
decode it before checking the existence of the file.
(Fix#2249)
This works around the problem that windows ignores tailing dots.
This way you could trick Icecast2 to send a XSLT file as plain text.
Please test.
Closes: #2247
This moved the <mime-types> setting into <paths>. The code still
supports reading it from the root element but will warn the user
about this.
Also there seems to be no documentation about this setting.
Closes: #2164
* Loop over elements in input buffer.
* Most are literally copied with their contents without
inspection into the header or data buffers as appropriate.
* Some only copy the element header, to allow inspecting
children elements.
* Cluster elements are identified and used as sync points.
No probing is done for keyframes *yet*
ban and allow file support has been moved into a generic implementation
that can be re-used by later code such as proxy matching or other
blacklisting.
See: #1959
This fixes a bug that could cause the global listener count of Icecast to
be negative. This was caused due to wrong handling of errors in the
format_prepare_headers function.
Fixes: #2199
Thanks a lot to Simeon Völkel (0xBD4E031CDB4043C9) for reporting
and investigating the bug.
This let util_url_escape() handle NULL passed as parameter.
In case the parameter is NULL it will also return NULL.
This patch also does some cleanup of the code such as migration
away from int and thus avoiding future failtures.
This is a re-apply of 3baa4e46aa
as git refuses to cherry-pick.
This is a first commit to correct minor problmes reported by
Denis Denisov. There is likely another commit to correct some more
such problems.
Thank you Denis Denisov.
This cleans the libcurl usage up a bit. It moves common code used
to interact with libcurl into a single new file curl.[ch].
Notes:
* It does not alter any features nor fixes any bugs.
* Thew REVIEW about strdup(self->url) in event_url.c as been processed.
According to the manpage for curl_easy_setopt()/CURLOPT_URL
there is no need for us to copy.
* URL Auth as well as URL triggers have sent ICECAST_VERSION_STRING
as User-Agent:, this has be corrected to what is set in the config
file.
* As curl.c is now a single point for setting parameters all the TLS
parameters should be reviewed and set (based on config).
Please test!
This allows to store a history of played songs along the source
object and report it as part of the status XML.
Additional work needs to be done to make this configurable.
Also format_mp3.c needs work to support this.
A generic song changed handler should be implemented to handle this
in a nice way.
That one should also be the point to call logging_playlist().
See: #766
This adds the operation mode "strict". It does not yet have
any specific features and alias the "normal" mode.
This change is mostly to make the setting of "strict" valid
so it can be used already.
As we do not support any SSL version but TLS this renames
all TLS related config options. Docs still need to be updated.
Close still uses 'ssl' internally e.g. for variable names.
This should be changed on a later patch.
This switches the behaviour introduced with the last commit
so that now the admin folder is only checked for includes if
in the specified path none is found.
This adds support for including xslt files that are in the admin
directory in an xslt file which is in the webroot, without having to
specify the full path.
For example:
<xsl:include href="includes/head.xsl"/>
will look inside the admin directory (foo/bar/admin/includes/header.xsl)
and include it, if it's found. If not it will as usual look for it in
the directory where the xslt file is located. This enables us to have
common files like the header, footer, json stuff, etc. in the admin
directory, so we don't need to have an extra copy in the web folder.
Note:
The configuration value for the admin directory is requested
every time an xslt is requested (if not in the cache).
Additonally it should be noted that the includes are not cached.
This tries to unbreak the 100-continue thing a bit.
Proper headers are send in case of 100-continue. Also the 200 OK
was moved to the end of the stream.
The client may even be reused. But I'm not sure we only do
'End of stream' in cases we are not on an undefined state of the
client. Do we as of now support anything that give us EOS without
a fatal socket state (error or shutdown)?
At least this unbreaks 100-continue with active TLS that was broken
as hell as we sent the header in clear over the socket. Not checking
if it was transmitted completly or something. Using lowlevel socket
calls (in contrast to the connection level calls that would have
handled the TLS just fine).
While this seem sto be a huge improvement to the situation I kindly
ask you to do a lot testing on this. Both with SOURCE as well as
PUT clients.
We have answered SOURCE/PUT requests with a simple
"HTTP/1.0 200 OK\r\n\r\n" while we should answer with complet
headers. This commit corrects this.
Interoperability:
This will work for two classes of clients:
* Super dumb ones not checking the response and will just send
data and hope the socket is still open.
* Those with a real parser.
* Shoutcast clients (indepnded code path).
* All libshout, curl, wget, ... based clients.
This *could* break:
* Clients that check for the exact returned message. However
as we start with the same string this should work.
Only client that check for the string including the End-of-header
CRLF sequense may break.
Please test careful before release.
This exposes the TLS status as <tls> tag in the <listener> tag.
The tag contains a bool ("true" or "false"). TLS mode, version and
other parameters are out of the scope of this tag and may be added
as independed tags in later commits.