1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-30 06:35:23 +00:00
Commit Graph

1386 Commits

Author SHA1 Message Date
Thomas B. Ruecker
70265c466e Spelling fix, thanks to Ukikie 2016-11-23 20:36:53 +00:00
Philipp Schafft
b3b1dd12a1 Workaround: This avoids libspeex printing warnings on Opus streams.
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.
2016-10-29 11:42:52 +00:00
Philipp Schafft
72075d0d0d Fix: Fixed regression introduced by r19250.
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
2016-09-04 11:38:07 +00:00
Marvin Scholz
4117a2d2e2 Config: Rename mp3-metadata-interval to icy-metadata-interval
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.
2016-06-28 11:39:57 +00:00
Marvin Scholz
4345060c02 Cleanup: corrected usage of spaces 2016-06-07 11:30:46 +00:00
Philipp Schafft
834de5ba77 Fix: allow building without libcurl support 2016-04-19 15:13:12 +00:00
Marvin Scholz
43658deb37 Add log message for succesful streamlist requests 2016-04-13 10:12:39 +02:00
JRS
a552c6e667 Fix update_from_master() for receiving HTTP/1.1
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2016-04-13 09:57:00 +02:00
Philipp Schafft
c8f565b030 Update: SECURITY File extension check for trailing characters
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
2016-03-27 17:51:59 +00:00
Joseph Wallace
a2cac3ee93 Make ebml_parse_tag return tag ID code
(applying lessons learned from libshout)
2016-03-27 12:29:23 -04:00
Joseph Wallace
a218055158 Move tag-parsing bail conditions to top for clarity. 2016-03-27 12:29:23 -04:00
Joseph Wallace
78293f0485 Delete some debugging comments. 2016-03-27 12:29:06 -04:00
Joseph Wallace
dcbba0c600 Cleanup some signed-type issues in format-ebml.c 2016-03-27 12:29:06 -04:00
Philipp Schafft
9cae2ef646 Updated submodules 2016-03-27 13:16:23 +00:00
Joseph Wallace
788bd94eeb BUGFIX: Use a signed type for capturing the return value of client_read_bytes()
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2016-02-13 21:12:34 +01:00
Marvin Scholz
3a73f9c146 More hardening of XML output against invalid entities
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)
2016-02-10 20:56:56 +01:00
Thomas B. Ruecker
4c57532e7b Added missing space to fix output 2016-02-10 08:15:48 +00:00
Marvin Scholz
37150fe020 Fix STATS legacy authentication
This fixes the issue that auth for STATS method always fails, by
adding stats method to legacy admin auth in cfgfile.c
2016-02-09 20:27:10 +01:00
Marvin Scholz
d739c65e54 Fix invalid entities in listclient xml
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
2016-02-08 23:02:02 +01:00
Philipp Schafft
235527192c Merge branch 'webmKeyFrames' 2016-02-06 17:44:56 +00:00
Marvin Scholz
eecbc647b4 Fix handling of URIs in custom XSL loader
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)
2016-01-26 10:13:07 +01:00
Philipp Schafft
471cbaa60b Fix: remove tailing dots in URI.
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
2015-12-24 00:38:11 +00:00
Joseph Wallace
d196e75416 Convert ints used as boolean values into actual bools. 2015-12-19 15:32:37 -05:00
Joseph Wallace
1f6a0a497f Replace "long long"s with an appropriate type from <stdint.h> 2015-12-19 15:02:33 -05:00
Philipp Schafft
255af9e610 Fix: Moved <mime-types> into <paths>.
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
2015-12-12 08:17:58 +00:00
Joseph Wallace
de004670c3 Be clearer about ebml_parse_sized_int's sign & endian behavior. 2015-12-01 02:21:24 -05:00
Philipp Schafft
d3370f3d1c Cleanup: unify util.c a bit with libshout. 2015-11-28 17:58:18 +00:00
Joseph Wallace
e6cb7e26ee Move ebml-private structure definitions out of header file. 2015-11-28 12:49:54 -05:00
Joseph Wallace
0d7448efc7 Change buffer-related sizes & indices to size_t or ssize_t, as applicable. 2015-11-28 12:49:45 -05:00
Joseph Wallace
8a09627d05 Fix type of copy_state in EBML parser to an enum variable. 2015-11-28 12:41:46 -05:00
Joseph Wallace
dc263858a4 Additional format_ebml.c comments. 2015-11-28 12:41:46 -05:00
Joseph Wallace
af238d9129 Move MKV element magic values into proper #define constants. 2015-11-28 12:41:46 -05:00
Joseph Wallace
d394a244f0 Bugfix: Cluster test could have read past the end of the input buffer.
Move the cluster test inside the space-to-read check with the other tests.
2015-11-28 12:41:46 -05:00
Joseph Wallace
9de8fe483d Remove spare whitespace on blank lines. 2015-11-28 12:41:46 -05:00
Joseph Wallace
e4258bfad3 Don't wait for video keyframes on audio-only streams. 2015-11-28 12:41:46 -05:00
Joseph Wallace
9cf4ed560c Probe SimpleBlocks to determine which clusters start with a keyframe. 2015-11-28 12:41:45 -05:00
Joseph Wallace
6e11db5de2 Probe Tracks section of header to identify the video track.
We'll sync keyframes on that track next commit.
2015-11-28 12:41:45 -05:00
Joseph Wallace
9899413839 Add parser for bodies of Integer elements. 2015-11-28 12:41:45 -05:00
Joseph Wallace
f461ff6763 Buffer clusters to have time to probe them for metadata, like keyframes. 2015-11-28 12:41:45 -05:00
Joseph Wallace
def5a4cf6c Implement EBML-aware parser.
* 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*
2015-11-28 12:41:45 -05:00
Joseph Wallace
50c4984c78 Add functions to comprehend EBML tags. 2015-11-28 12:41:45 -05:00
Joseph Wallace
531d060d16 Adjust EBML parser writing protocol.
This will allow leaving unparsed data in the input buffer to wait for completion.
2015-11-28 12:41:45 -05:00
Joseph Wallace
13dc880d29 Yield sync point status from ebml_read directly.
This simplifies some fragile "was the last chunk a sync point?" logic.
2015-11-28 12:41:45 -05:00
Joseph Wallace
744b66c40e Make the state-machine nature of the EBML parser more evident. 2015-11-28 12:41:45 -05:00
Joseph Wallace
15e7fc6e4a Add comments & braces to format_ebml.c.
This should help make future changes to the code clearer.
2015-11-28 12:41:45 -05:00
Marvin Scholz
2ff8c50d3b Makefile: Fix commons include path 2015-11-28 17:15:42 +01:00
Marvin Scholz
d16e091e25 Update submodule for more deprecated Makefile INCLUDES fixes 2015-11-28 17:15:42 +01:00
Marvin Scholz
d3c1dafa7e Change deprecated INCLUDES variable in Makefile 2015-11-28 17:15:42 +01:00
Philipp Schafft
24bc25ec38 Cleanup: fixed some compiler warnings 2015-11-28 11:30:34 +00:00
Philipp Schafft
d51b9afc49 Cleanup: unify util.h a bit with libshout. 2015-11-28 10:51:50 +00:00
Philipp Schafft
32216013b2 Cleanup: unify util.c a bit with libshout. 2015-11-28 10:44:05 +00:00
Philipp Schafft
85b709da04 Merge branch 'matchfile' 2015-11-23 13:01:23 +00:00
Philipp Schafft
752b2f90fe Cleanup: mark constant loopup tables read only 2015-11-23 12:47:56 +00:00
Philipp Schafft
a650965cfd Cleanup: make util_base64_encode() useful for binary data. 2015-11-23 12:47:47 +00:00
Philipp Schafft
de48bdd13f Cleanup: Removed unused member host vom connection struct 2015-11-23 11:44:14 +00:00
Philipp Schafft
69cf9ad6c2 added <errno.h> as we use errno 2015-11-23 11:41:25 +00:00
Philipp Schafft
b7d0188e1d Update: updated submodules 2015-11-22 18:52:15 +00:00
Philipp Schafft
c0e895404e Cleanup: mark key as const (why wasn't it const already?) 2015-11-22 18:47:11 +00:00
Philipp Schafft
b55bae035d Update: Improved matchfile API
This adds support for allow-deny kind of rules with the matchfile API.

See: #2119
2015-11-22 18:47:06 +00:00
Philipp Schafft
d24dda61d0 Cleanup: moved ban and allow file support into generic implementation
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
2015-11-22 18:47:00 +00:00
Philipp Schafft
3653a1f812 updated submodules 2015-11-19 10:47:08 +00:00
Philipp Schafft
8e2fe8a3f7 Fix: Handle mount=NULL in config_find_mount() correctly. 2015-11-11 12:18:15 +00:00
Philipp Schafft
f5d728d730 Fix: Include required headers 2015-08-10 08:54:21 +00:00
Marvin Scholz
16dac2505e Fix that global listener count could be negative under certain circumstances
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.
2015-06-06 14:09:44 +02:00
Marvin Scholz
c35760cd50 Fix possible segfaults when header allocation fails
This fixes some possible segfaults that could happen if the header
(re)allocation fails.
2015-06-06 14:09:44 +02:00
Philipp Schafft
3d2ab9aec2 Fix: Handle case realloc() is used as free().
This (hopefully) corrects the usage of realloc() as free().
This patch is part of the series based on Denis Denisov's input.
2015-04-08 13:05:10 +00:00
Philipp Schafft
6605f4ddaa Fix: Let util_url_escape() handle NULL parameter.
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.
2015-04-08 10:25:25 +00:00
Philipp Schafft
c1f0eaff8a Fix: Fixed some smaller bugs such as leaks and performance improvements.
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.
2015-04-08 09:36:59 +00:00
Philipp Schafft
7402383448 Cleanup: move libcurl specifc code into curl.c
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!
2015-04-08 07:44:36 +00:00
Philipp Schafft
a1f204c184 Cleanup: Renamed <kartoffelsalat> to <event-bindings>
The parent element for <event> was renamed from <kartoffelsalat>
to <event-bindings> as discussed on the mailinglist and on IRC.
2015-03-31 08:20:37 +00:00
Philipp Schafft
2661d4360e Cleanup: More space corrections 2015-03-31 08:14:42 +00:00
Philipp Schafft
8455dbde57 Cleanup: corrected a space 2015-03-31 08:03:28 +00:00
Philipp Schafft
bfbb8f207c Feature: playlist history for ICY based streams.
This patch adds support for history for ICY based streams.
Of cause this has the same limits for metedata as ICY has.

See: #766
2015-03-28 18:14:41 +00:00
Philipp Schafft
961453b0de Added config option for history size.
This adds a <max-history> config option to the <mount> section.
Default is a history size of 4.

See: #766
2015-03-28 17:34:35 +00:00
Philipp Schafft
06fe442c2d Fixed off-by-one error in playlist truncation.
The playlist truncation (may_tracks) was off by one.
This fixes the problem.
2015-03-28 17:33:09 +00:00
Philipp Schafft
5f77b35d14 Initial patch for playlist history support.
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
2015-03-28 16:15:49 +00:00
Philipp Schafft
8d513db405 Added operation mode (omode) "strict".
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.
2015-03-27 11:15:22 +00:00
Philipp Schafft
5dac23adda Renamed config file SSL references to TLS.
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.
2015-03-27 11:08:50 +00:00
Thomas B. Ruecker
99e11adac3 Remove stray space that managed to sneak in 2015-03-01 17:11:31 +00:00
Thomas B. Ruecker
671c2366cf Fixed log messages and comments
* Reworded many log messages for better understanding.
 * Adjusted some version targets as we won't have a 2.4.2 release.
 * Added some FIXME comments
2015-03-01 16:55:27 +00:00
Thomas B. Ruecker
314aa9660d remove some spurious tabs and replace with spaces
Fix variable alignment if necessary.
2015-03-01 16:55:27 +00:00
Philipp Schafft
c1034058f6 Fix: do not close(-1) on Keep-Alive clients 2015-03-01 16:53:17 +00:00
Philipp Schafft
5e8b24785e Fix: Use correct malloc function 2015-03-01 15:53:57 +00:00
Philipp Schafft
e870c21384 Cleanup: some style corrections. 2015-03-01 15:52:37 +00:00
Marvin Scholz
e0c05ef8a9 Fix another memory leak in xslt loader
This fixes another memory leak, which was caused by not freeing
the admin_path when a subsequent xslt file was loaded.
2015-03-01 15:35:14 +01:00
Marvin Scholz
06545b25c0 Fixed memory leaks in custom xslt loader
This fixes some memory leaks in the xslt loader,
additionally it now makes no copy of the URI if not needed.
2015-03-01 14:30:19 +01:00
Marvin Scholz
0709b4e66d Only look for admin include if no local found
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.
2015-02-25 16:11:42 +01:00
Marvin Scholz
5b416b311c Add support for 'admin' includes from web XSLT files
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.
2015-02-25 15:49:01 +01:00
Philipp Schafft
225c6f240a Fix: do not FTBFS in case OpenSSL support is not compiled in 2015-02-23 21:43:07 +00:00
Philipp Schafft
1e80611d1c Sync submodules 2015-02-10 21:26:33 +00:00
Philipp Schafft
a1e5d2ab8a Cleanup: connection.c:776: warning: unused variable expectcontinue 2015-02-10 21:20:58 +00:00
Philipp Schafft
36d10121cf Feature: Support PUT with chunked transfer encoding.
This adds the Transfer-Encoding chunked to PUT support.

Please test carefully. Will add PUT to Allow: header after testing.

Have fun.

Closes: #2088
2015-02-10 21:18:52 +00:00
Philipp Schafft
79cb147c4a Cleanup: unbreak 100-continue a bit.
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.
2015-02-10 09:44:11 +00:00
Philipp Schafft
d6908eb024 Fix/Cleanup: Answer SOURCE/PUT requests with a real 200-OK.
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.
2015-02-10 09:12:33 +00:00
Philipp Schafft
9cf6d9313c Sync common/ 2015-02-10 08:46:44 +00:00
Philipp Schafft
91eb78fc3a Feature: Expose TLS status in <listener> tags.
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.
2015-02-09 12:14:16 +00:00
Philipp Schafft
927ccf5213 Cleanup: corrected comment TAGs 2015-02-09 12:06:29 +00:00
Philipp Schafft
c89a5714fb Cleanup: Converted tag <Listeners> to lowercase.
This converts the <Listeners> tag to lowercase on listclients admin
command. This is to align with stats.xml which already uses lowercase.
See: #2097
2015-02-09 12:03:00 +00:00
Philipp Schafft
765ceabe81 Fix: Detect socket errors on TLS based source connections 2015-02-07 12:21:31 +00:00
Philipp Schafft
7bc7472972 Fix: do keep SSL state when reusing a TLS connection. 2015-02-06 10:25:40 +00:00
Philipp Schafft
a18e2540fb Fix: Allow client=NULL in util_http_build_header()
This fixes a bug in 8941de3273975504aaa00a35d145c3f26c832d70:
When passing NULL as client parameter to util_http_build_header()
there was a segfault before this change.
2015-02-02 01:08:37 +00:00
Philipp Schafft
19162018f4 Fix: Announce RFC 2817 TLS Support if TLS support is enabled.
This announces TLS support if enabled via Upgrade:-header.
Closes: #2159
2015-02-02 01:05:05 +00:00
Philipp Schafft
dbbd22f792 Cleanup: Set Connection:-Header via client->reuse 2015-02-02 00:50:56 +00:00
Philipp Schafft
68248d15b1 Fix: Also check for Connection:-Header 2015-02-02 00:38:14 +00:00
Philipp Schafft
71408e6291 Feature: Allow RFC 2817 style Upgrade command.
This allows the usage of RFC 2817 style upgrade commands.
This is not correctly announced yet.
Can hardly be tested as most clients do not support this.
Will be helpful with TLS support in libshout.
See: #2159, #2152
2015-02-02 00:34:45 +00:00
Philipp Schafft
c806e47a4a Fix: allow Keep-Alive connections on normal error pages 2015-02-01 23:04:54 +00:00
Philipp Schafft
78213fe30a Cleanup: Move client queue node creation into function.
This adds the function create_client_node() taking care of
client queue node creation.
2015-02-01 21:01:01 +00:00
Philipp Schafft
8941de3273 Fix: Added some more HTTP/1.1 headers
This adds to all responses:
 * "Accept-Encoding: identity"
 * "Connection: close"
 * "Allow: GET, SOURCE" or "Allow: GET" (on admin pages)

This is to generate some infrastructure for Icecast to tell futur
source clients what is supported.

"Upgrade: TLS/1.0" should be added later when upgrade support is present.

See: #2152
2015-02-01 11:56:03 +00:00
Marvin Scholz
0dfc7c5b6a Cleanup codestyle
This commit cleanups codestyle a bit, yet there is still some work to be done
2015-01-25 19:57:27 +01:00
Philipp Schafft
9d84ba2036 Feature: Sending <admin> field to yp server
This sends the <admin> field to yp servers. It is thought be useful
to allow reaching the admins more easily in case of any yp problem.

Closes: #2146
2015-01-18 18:47:24 +00:00
Philipp Schafft
319b6d577f Fix: fix memory leak of active and pending ypdata_t
This (hopefully) fixes a memory leak that caused active and
pending ypdata_t objects to be not freed up on server shutdown
or config reload.

To testers: please enable yp submission and restart and SIGHUP
your instance several times with loglevel set to warning or higher.
Each time after shutdown or SIGHUP check your log for one of the
following two warnings:
 * 'active ypdata not freed up'
 * 'pending ypdata not freed up'

Those warnings must not be in the log. If you spot one please report.
2015-01-18 17:51:58 +00:00
Philipp Schafft
cc613d405f Fix: do not release events that are still in the queue 2015-01-18 17:26:07 +00:00
Philipp Schafft
7e4650138e Fix: fixed memory leak on XSPF generation 2015-01-18 17:14:03 +00:00
Philipp Schafft
3b4e3ed0ed Cleanup: more cleanly define blocks for admin command IDs
This adds info to the blocks about their size.
Also added two more blocks:
* for experimental features such as in private branches or
  or feature branches. This is for command IDs that are going to
  be merged with master some day. At merge they need to be changed
  and put into the regular position.
* for private features that are not going to be merged into master.
  e.g. specific features for a very specific user that are not
  useful for general audiance.

This should help keeping stuff sorted and largey reducing the risk
of command ID collissions on merges of branches.
Also this should make the merger's job a little bit more easy as
there are less likely any conflicts on merge if someone else got
a number closeby and those change is within the diff's context lines.
2015-01-13 08:42:02 +00:00
Philipp Schafft
db9b419250 Cleanup: Removed left overs from pre-<role> auth 2015-01-11 15:40:36 +00:00
Philipp Schafft
11d5dffd49 Cleanup: Removed tailing spaces 2015-01-10 18:53:44 +00:00
Philipp Schafft
e9a90f9918 Cleanup: converted tabs into spaces 2015-01-10 01:48:15 +00:00
Philipp Schafft
99d9be1dc5 Cleanup: two minor code style corrections 2015-01-08 23:39:59 +00:00
Philipp Schafft
205eca50ab Fix: Do not shut down fserve engine if not started up
This avoids a endless loop in a spin lock that has not been inited
yet if fserve engine was not started up by the time it was sent to
go down. This happened if icecast couldn't read the config because
the file was corrupted or non-existent.
Closes: #2144
2015-01-08 23:15:13 +00:00
Philipp Schafft
f992da8cfa Fix: Set on_demand on creation of on-demand relay
This sets the on_demand parameter of the source correctly on
creation of a on-demand relay.
Thanks to Marvin Scholz <epirat07@gmail.com>.
Closes: #2054
2015-01-06 17:12:56 +00:00
Philipp Schafft
f39b7d8880 Cleanup: Removed trivial header files for auth backends
All Auth backends had just one prototype in auth_*.h. Those
got merged into auth.h to avoid to have many small files around.
2015-01-06 11:29:07 +00:00
Philipp Schafft
a52e2e1a35 Fix: SECURITY allow global admins to access all mounts 2015-01-05 16:58:43 +00:00
Thomas B. Ruecker
3d8245f71a making sure submodules are sync 2014-12-31 17:45:09 +00:00
Philipp Schafft
490482deaf Fix: SECURITY Corrected methods of anonymous role for htpasswd legacy auth 2014-12-29 09:48:00 +00:00
Philipp Schafft
0f311a318d Fix: Do not segfault if <role type="..."> is unknown 2014-12-28 21:11:52 +00:00
Philipp Schafft
b638d3c939 Fix: Added support to admin/ interface to list <role>s
This adds support to list global and per mount roles on stats.xsl.
This isn't nicest formated but works.
This also adds <source>-like <authentication> with <role>s to
root node.
Closes: #2133
2014-12-26 21:57:50 +00:00
Philipp Schafft
785c32bfc5 Revert "Fix: avoid assignment discards 'const' qualifier warning"
This reverts commit 0dbabcc44c.
Breaks other OpenSSL versions.
2014-12-24 11:36:34 +00:00
Philipp Schafft
0b1af34f0e Prevent various redefined definitions in win32-specific code
From: Erik van Pienbroek <epienbro@fedoraproject.org>
Date: Mon, 22 Dec 2014 18:02:09 +0100
2014-12-24 11:35:56 +00:00
Philipp Schafft
0dbabcc44c Fix: avoid assignment discards 'const' qualifier warning
Untested. Please test.
See #2063
2014-12-24 09:03:26 +00:00
Philipp Schafft
d75d1d6a7a Feature: Allow <resource> to have only one of source and destination
This allows <resource> (former <alias>) to have only one of the
attribues source and destination. In that case other parameters
will be applied to the client but uri is not mapped.

See #2097
2014-12-20 18:48:03 +00:00
Philipp Schafft
7b5bafdf55 Merge branch fix for <metadata> of relays. 2014-12-20 18:07:04 +00:00
Philipp Schafft
7e9e298e33 Fix: avoid segfault by generating <metadata> for relays 2014-12-20 18:06:42 +00:00
Philipp Schafft
857264acdc Fix: memory leak and race condition fix 2014-12-20 16:12:27 +00:00
Philipp Schafft
2a99aa0f0b Fix: memory leak, now also releasing reglist[] members 2014-12-20 15:30:26 +00:00
Philipp Schafft
8702999204 Fix: memory leak now freeing null_device and global source_password 2014-12-20 15:29:53 +00:00
Philipp Schafft
d3bba3638e Fix: Added missing includes 2014-12-20 13:40:44 +00:00
Philipp Schafft
55d429a6c8 Fix: Corrected display of "login" on status page
This corrects the creation of <authenticator> in the status output
and this way fixes the display of login link on status page.
Closes #1939
2014-12-20 09:39:26 +00:00
Philipp Schafft
3d6ea2efdb Merged support for thread-less <role>s 2014-12-19 17:30:37 +00:00
Philipp Schafft
25f6c53929 Feature: immediate mode for <role>s
This allows a <role> represented by a auth_t to run in "immediate"
mode. In this mode no thread is created for this <role>. This is a
major speedup.

Closes #2124
2014-12-19 17:27:54 +00:00
Philipp Schafft
0eb466b76d Feature: Allow mangement of <role>s via admin/ interface.
This allows to manage <role>s via admin interface if the role supports.
Also format of admin/manageauth has been changed:
- <source> was renamed to <role>.
- mount parameter was removed.
- <role> got new parameters: type, name,
  can-adduser, can-deleteuser, can-listuser.
- can-* parameters are bools ("true" or "false"). They should be used
  to show or hide elements on the admin interface.

Ticket #2123 is nearly complet with this, just admin/manageauth.xsl
needs up be updated. Please close the bug in the commit that updates
admin/manageauth.xsl.
See #2123
2014-12-19 16:14:35 +00:00
Philipp Schafft
a990756912 Feature: Also export type="" in stats.xml's <role>s 2014-12-19 11:28:49 +00:00
Philipp Schafft
7093e19523 Feature: Added support to type="static" <role> to list user
This adds support to list the user for a static <role>.
2014-12-19 11:22:36 +00:00
Philipp Schafft
1c550b0c8e Feature: Added support for management-url="" in <role>
This adds setting a URL for manegement of roles to the framework.
If no URl is given in the config file this defaults to internal
(/admin/manageauth.xsl) interface if supported by the backend.
See #2123
2014-12-19 11:16:13 +00:00
Philipp Schafft
fb088de568 Fix: only export name="" on <role> if set 2014-12-19 11:01:32 +00:00
Philipp Schafft
4c429ab01b Feature: Export <role>s on stats.xml
This exports id and name of <role>s on stats.xml output. The <role>s
are in a <authentication> container tag and mimic the format used
by the config file.

See #2123
2014-12-19 10:51:40 +00:00
Philipp Schafft
40bb04b644 Feature: Added a unique ID to each auth_t.
This added a unique ID to each auth_t instance so it can be refered
to e.g. by the web interface for mangement functionallity. Mostly
stolen from connection.[ch].
See #2123
2014-12-19 10:50:52 +00:00
Philipp Schafft
25eec22692 Cleanup: Removed a printf() leftover from debugging 2014-12-19 10:47:07 +00:00
Philipp Schafft
c5bd8ad281 Fix: Always export <metadata> in stats.xml 2014-12-18 10:24:15 +00:00
Philipp Schafft
4a0c399bf3 Added 'lagcay' mode stats.xml.
Add '?omode=legacy' to any URI or <resource ... omode="legacy" />.
Please test.
closes #2097
2014-12-18 09:56:54 +00:00
Philipp Schafft
dc016bc017 Fix: Fixed compiler warnings
This fixes some compiler warnings. The code should be warning free
if gcc with -Wall is used but for the following:
{{{
admin.c: In function 'command_manageauth':
admin.c:790: warning: unused variable 'mountinfo'
}}}
This warning is due <role> migration. See #2123 for more details on
this warning. Please test with care. closes 2063
2014-12-14 19:18:22 +00:00
Philipp Schafft
8dc069f361 Feature: Support command line arguments in <event type="exec">
This adds support to pass additional command line parameters
to called processes. closes #1752
2014-12-14 16:19:32 +00:00
Philipp Schafft
d67f0f5d91 Fix: Send Content-Disposition:-header correctly, closes #1953 2014-12-14 11:01:39 +00:00
Philipp Schafft
c73e214f8f Regression Fix: Correction of old-style <authentication>.
Old-style <authentication> within <mount> didn't work for type="url"
as well as some other parameters due to confusion between "node"
and "child" variable.

Thanks for trilliot for pointing out! Should work now.
closes #2039
2014-12-14 09:27:49 +00:00
Philipp Schafft
8a4c529347 Cleanup: make strcmp() more explicit in _start_logging()
This avoids if(strcmp()) constructs in favor of if(strcmp() == 0)
constructs. This is aligned with coding style and will improve
readability of the code.

Thanks to miksago. closes #2102
2014-12-14 08:19:58 +00:00
Philipp Schafft
28572be2ec Feature: Extract metadata and export them to stats.xml
All metadata is now extracted from Vorbis streams and ICY streams
and exported as new <metadata> tag into admin/stats if specific
mountpoint is requested.

To testers:
 - Please test with Ogg Vorbis streams.
 - Please test with Ogg Vorbis + Theora streams.
 - Please test chained Ogg streams.
 - Please test with ICY streams.

close #2106
2014-12-09 16:08:27 +00:00
Philipp Schafft
795aa278ad Speedup: Don't copy data into event if there are no registrations
If there are no reistrations that are added to an event the event
doesn't need to be emited as nobody cares anyway. We will do this
simple check before we copy data into the event object to avoid
unnecessary calls to strdup() and other allocation functions.
2014-12-08 07:58:17 +00:00
Philipp Schafft
bdcf008b7c Added <event>: Unified handling of events.
<event> has been added and can be used within <kartoffelsalat>
both in <icecast> and <mount>.
<event> takes backend depending <option> child tags.
Currently supported backends:
 - log: send message to error log.
 - exec: executes a program or script.
 - url: delivers the event via HTTP.

within <mount> <on-connect> and <on-disconnect> has been replaced by
<event>. Config parser can on-the-fly convert old tags.
Also <authentication type="url"> within <mount> has been fixed
for those cases with <option name="mount_add" .../> and
<option name="mount_remove" .../> which are now on-the-fly converted
by the parser to corresponding <event> tags.

Please also see TAGs added as per #2098. Some include hints for
documentation updates needed after this change. Those updates
should take place before 2.4.2.
2014-12-08 00:39:57 +00:00
Philipp Schafft
8f706a4c1e Cleanup: Moved config re-read function into right place
Renamed event_config_read() into config_reread_config() and moved
it into cfgfile.c. This allowed to delete event.[ch].
event.[ch] will later be used to implement <event>.
2014-12-07 10:54:34 +00:00
Philipp Schafft
5d9d9fbe48 ACL: added {allow,deny}-all, support bool notation
Added {allow,deny}-all option to ACL parser. Setting this will
set {allow,deny}-{method,admin,web} to *.

Also allow boolean values (insteed of *) for
{allow,deny}-{web,all}.
2014-12-06 20:04:21 +00:00
Philipp Schafft
f7f998e741 renamed <alias> to <resource>.
renamed <alias> to <resource> as it is planned to extent the usage
of this tag. docs and default configs should be updated by those
taking core of them.
2014-12-06 19:47:54 +00:00
Marvin Scholz
fa35f176ab Update submodules 2014-12-05 12:57:02 +01:00
Marvin Scholz
1bf41cfdb6 Epic Git migration commit
Added .gitignore and submodules
Changed paths to match new location of things
2014-12-02 22:50:57 +01:00
Philipp Schafft
93194594f7 better coding style, patch by ePirat. refs #2059
svn path=/icecast/trunk/icecast/; revision=19376
2014-11-30 20:32:30 +00:00
Philipp Schafft
ea71438af3 s/listener/client/; thanks to micheil.
svn path=/icecast/trunk/icecast/; revision=19375
2014-11-30 18:20:09 +00:00
Philipp Schafft
0ade7d3e17 cleanup: make use of const
svn path=/icecast/trunk/icecast/; revision=19373
2014-11-30 18:18:05 +00:00
Philipp Schafft
35723bed54 sock_active() is broken and can not be used
svn path=/icecast/trunk/icecast/; revision=19372
2014-11-30 18:17:10 +00:00
Philipp Schafft
dae5e45a25 that error is nonsense
svn path=/icecast/trunk/icecast/; revision=19371
2014-11-30 18:15:40 +00:00
Philipp Schafft
0eca1bcfe0 cleanup: don't include "httpp/httpp.h" if not needed
svn path=/icecast/trunk/icecast/; revision=19370
2014-11-30 09:32:06 +00:00
Philipp Schafft
8867d177c5 cleanup: converted printf() into ICECAST_LOG_DEBUG() but commented out so they do not spam logs for normal users.
svn path=/icecast/trunk/icecast/; revision=19368
2014-11-29 12:41:19 +00:00
Philipp Schafft
7a27cacf0b updated chroot and setuid/gid support. Thanks to d26264b9 for reporting. close #2096
svn path=/icecast/trunk/icecast/; revision=19365
2014-11-29 10:34:07 +00:00
Philipp Schafft
23a47c8ffc in <listener>:
- Added <role>.
- Converted <Referer> to <referer>.
- Set id="nnn" in addition to <ID>nnn</ID>.
- Added TAGged comments about next steps.

refs #2097

svn path=/icecast/trunk/icecast/; revision=19364
2014-11-29 10:16:36 +00:00
Philipp Schafft
fa9ab8eeea include <string.h>
svn path=/icecast/trunk/icecast/; revision=19361
2014-11-29 08:28:55 +00:00
Philipp Schafft
5cd1a0cb03 ensure vhost is not uninitialized
svn path=/icecast/trunk/icecast/; revision=19360
2014-11-29 08:16:42 +00:00
Philipp Schafft
373befb9cc include <stdio.h> as FILE* is used in the header
svn path=/icecast/trunk/icecast/; revision=19359
2014-11-29 08:15:23 +00:00
Philipp Schafft
a642cac542 Wow. Mega patch!
This patch *replaces* the authentication system completly.

What is new:
 - <authentication> in mount section is now a container object.
 - <authentication> in root and mount section may hold any number of <role>-Tags.
 - <role> tags:
   Those tags define a 'role' and it's ACL rules.
   A role is a instance of an authentication module (see below).
   <role> takes the following options. All but type are optional.
   - authentication related:
     - type: Type of the authentication module (values: anonymous, static, legacy-password, url or htpasswd;
             symbolic constants in auth.h)
     - name: Name for the role. For later matching. (values: any string; default: (none))
     - method: This rule is only active on the given list of HTTP methods.
               (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: *)
   - ACL related:
     - allow-method: Allowed HTTP methods.
       (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: get)
     - deny-method: Rejected HTTP methods.
       (list of enum values: methods as recognized by httpp/ (e.g: get,post); default: *)
     - allow-admin: Allowed admin commands. (list of enum values: admin command; default: buildm3u)
     - deny-admin: Rejected admin commands. (list of enum values: admin command; default: *)
     - allow-web: Allowed web pages. (values: empty or *; default: *)
     - deny-web: Rejected web pages. (values: empty or *; default: (empty))
     - connections-per-user: maximum number of simultaneous connections per role and username.
       This is only active on active sources.  (values: unlimited or number of connections; default: unlimited)
     - connection-duration: maximum time of a connection. This is only active on active sources.
       (values: unlimited or number of secounds; default: unlimited)
   <role> takes <option> child tags. <option> tags contain a name and a value option.
   Meaning of <option> tags is up to the authentication module.
 - <role>s are considered to build a stack. If a role returns with AUTH_NOMATCH the next one will be tried.
 - <role>s are tested in this order: mount specific, default mount specific, global, internal fallback.
   Internal fallback is set to allow web/ access via GET, POST and HEAD (only GET supported by this time)
   and rejects all other requests.
 - New authentication module: anonymous
   This module matches all requests. No options taken.
 - New authentication module: static
   This module matches with a static username and password.
   It takes two <option>s. One with name="username" and one with name="password" to set username and password.
   This replaces old style <*-username> and <*-password> tags.
 - New authentication module: legacy-password
   This module matches with a statich password.
   It takes one <option> with name="password" to set password.
   This replaces old ICE and ICY (shoutcast compat mode) authentication.
 - Parsing <authentication> in <mount> with a type set in a special way to allow 100% backward compatibility.
 - Parsing of <source-password>, <admin-password>, <admin-user>, <relay-password> and <relay-user> in global
   <authentication> for 100% backward compatibility.
 - <alias> is now proccessed very early. This enables them to be used for all kinds of requests.

To Do List & What does not yet work:
 - type="url" auth: mount_add and mount_remove.
   This should be replaced by an unique feature I would call '<event>'.
 - Admin commands manageauth and manageauth.xsl are disabled as they need more review:
   This code needs to be ported to support multiple <role>s per <mount>.
 - url authentication module can not yet return AUTH_NOMATCH.
   This needs to be reviewed and discussed on how to handle this case best way.
 - Default config files needs to be updated to reflect the changes.
   As this is quite some political act it should be done in dicussion with the whole team
   and permission of the release manager.
 - Docs need to be updated to reflect the changes.

How does it work:
 Code has been changed so that authentification is done early for all clients.
 This allows accessing the ACL data (client->acl) from nearly everywhere in the code.

 After accept() and initial client setup the request is parsed. In the next step
 all <alias>es are resolved. After this the client is passed for authentication.
 After authentication it is passed to the corresponding subsystem depending on kind of request.

 All authentication instances have a thread running for doing the authentication.
 This thread works on a queue of clients.

Hints for testers:
 - Test with default config.
 - Test with diffrent authentication modules in <mount>.
 - Test shoutcast compatibility mode.
 - Test with new style <authentication> and any amount of <role> (zero to quite some).
 - Test <alias> lookup on all kinds of objects.
 - Test source level credential login into the admin interface.
 - Test shoucast style meta data updates.
 - Test playlist generation.

Thank you for reading this long commit message. Have fun reading the full patch!

svn path=/icecast/trunk/icecast/; revision=19358
2014-11-28 23:46:08 +00:00
Philipp Schafft
637af17f82 some more changes for ACL framework: exported admin_get_command() and ADMIN_COMMAND_ERROR as well as introduced ADMIN_COMMAND_ANY
svn path=/icecast/trunk/icecast/; revision=19349
2014-11-22 05:42:36 +00:00
Philipp Schafft
09692dd45e expose converting of method names to enum values as httpp_str_to_method()
svn path=/icecast/trunk/httpp/; revision=19348
2014-11-22 04:44:47 +00:00
Philipp Schafft
ec439d10eb Changed ABI a bit: updated httpp_request_type_e-type. To avoid any problems do a complet rebuild of your projects. Thank you.
svn path=/icecast/trunk/httpp/; revision=19347
2014-11-22 04:06:26 +00:00
Philipp Schafft
bdc392beb1 some smaller stuff needed to get new authing stuff done
svn path=/icecast/trunk/icecast/; revision=19346
2014-11-22 03:49:36 +00:00
Philipp Schafft
6cca1c5585 allow symbolc names for bools, public settings and loglevel
svn path=/icecast/trunk/icecast/; revision=19345
2014-11-21 19:52:48 +00:00
Philipp Schafft
0df154f3bf remove client_send_[0-9]{3}() in favor of client_send_error(). Please test
svn path=/icecast/trunk/icecast/; revision=19344
2014-11-21 18:05:17 +00:00
Philipp Schafft
237eb4f770 first part of patch to allow kh like admin stats with listener tags inside
svn path=/icecast/trunk/icecast/; revision=19343
2014-11-21 15:37:50 +00:00
Philipp Schafft
1fe898adb5 allow comments to be within the <http-headers> block, not just at the end
svn path=/icecast/trunk/icecast/; revision=19342
2014-11-21 10:08:16 +00:00
Philipp Schafft
558cff06d9 (sync with my branch) Updated handling of <on-connect> and <on-disconnect> in <mount>, see r19305:r19312, refs #1354, #2089, #2087, #1752
svn path=/icecast/trunk/icecast/; revision=19340
2014-11-21 09:28:29 +00:00
Philipp Schafft
503059f481 (sync with my branch) report system name and print better warnings about <hostname> at start of process
svn path=/icecast/trunk/icecast/; revision=19339
2014-11-20 18:41:42 +00:00
Philipp Schafft
dfd6b74068 (sync with my branch) remove threadpool_size in global config, added warnings for <threadpool> and <no-yp> as well as updated warning for <source-password>
svn path=/icecast/trunk/icecast/; revision=19338
2014-11-20 18:36:57 +00:00
Philipp Schafft
6dca08ee5d (sync with my branch) Support for reloading server config using admin interface. close #2018
svn path=/icecast/trunk/icecast/; revision=19337
2014-11-20 18:34:41 +00:00
Philipp Schafft
5a8d0d1646 (sync with my branch) support vhosting on aliases
svn path=/icecast/trunk/icecast/; revision=19336
2014-11-20 18:32:14 +00:00
ePirat
95e7e42b49 Set PATH_MAX to 4096 if not defined (patch by Svante Signell <svante.signell@gmail.com>)
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767542

svn path=/icecast/trunk/icecast/; revision=19321
2014-11-19 11:30:58 +00:00
ePirat
e7d68fd3b0 Move declarations to begin of block
(patch by Andreas Mieke)

svn path=/icecast/trunk/icecast/; revision=19318
2014-11-18 17:43:34 +00:00
ePirat
42f763bf37 Experimental fix for memory errors when using a lot of headers, see #1885
svn path=/icecast/trunk/icecast/; revision=19316
2014-11-18 10:17:16 +00:00
Philipp Schafft
baee2d0c7f subset of my earlier patch so it can go into 2.4.1: disconnects stdio of <on-[dis]connect> scripts from random filehandles. closes #2087
svn path=/icecast/trunk/icecast/; revision=19313
2014-11-17 19:20:57 +00:00
Philipp Schafft
d06b6b1846 patch to fix regression on header size with large headers introduced by support of <server-id> and <http-headers>. This should ensure we have at least space for 2kB of extra headers. Depending on function and call we may have much more space.
Please test this very carefully.
Some pointers what should be in the tests (NOT complet list):
- request to 'static' web/ and admin/ pages.
- requests to playlist generation.
- requests to streams.
- requests to admin/ manipulation functions.
- test everything with at least 8kB of extra headers, then reduce in 1kB (or 512B) steps.
- see if response is correct OR 500 is returned.
- run under valgrind or similar to see no buffer overflow or similiar will happen.
- take a cookie!

svn path=/icecast/trunk/icecast/; revision=19300
2014-11-10 10:46:55 +00:00
Thomas B. "dm8tbr" Ruecker
298b1ac79a Once more updated string, same Qualys results.
String taken from:
https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29

svn path=/icecast/trunk/icecast/; revision=19295
2014-11-09 10:55:29 +00:00
Thomas B. "dm8tbr" Ruecker
574274d22e Make sure email address is up to date.
svn path=/icecast/trunk/icecast/; revision=19292
2014-11-08 17:13:48 +00:00
Thomas B. "dm8tbr" Ruecker
24b7825adb Applying patch, HTTP PUT requires content-type
In case of SOURCE we are lenient and thus quite some source clients
don't send a proper content-type, especially if they only support mp3.

This was meant to be introduced in 2.4.0 already, sadly we missed it.

All source clients MUST send proper content-type after migrating to 
Icecast HTTP PUT protocol.

closes #2082

svn path=/icecast/trunk/icecast/; revision=19288
2014-11-08 16:23:26 +00:00
Philipp Schafft
06977d788c Fixed regression introduced in r18356 (CVE-2011-4612): client duration time is now correctly logged. PRIu64 MUST NOT be used with log_write_direct() as depending on platform PRIu64 may be using something not supported by __vsnprintf() of log/log.c. close #2081, see r18356
svn path=/icecast/trunk/icecast/; revision=19287
2014-11-08 13:34:45 +00:00
Philipp Schafft
d959c20f11 make use of sizeof() not explicit magic numbers
svn path=/icecast/trunk/icecast/; revision=19286
2014-11-08 12:28:17 +00:00
Philipp Schafft
ab0ac755be fixing some compiler warnings
svn path=/icecast/trunk/net/; revision=19282
2014-11-07 23:14:29 +00:00
Philipp Schafft
9353b5e448 fixing some compiler warnings
svn path=/icecast/trunk/httpp/; revision=19281
2014-11-07 23:14:00 +00:00
Philipp Schafft
fc63b67b87 fixing some compiler warnings
svn path=/icecast/trunk/icecast/; revision=19280
2014-11-07 23:10:43 +00:00
Philipp Schafft
78ca9bd2ba updated some copyright headers
svn path=/icecast/trunk/icecast/; revision=19278
2014-11-07 22:06:06 +00:00
Philipp Schafft
29d9778c09 fix for %z on win*. hope it doesn't breaky anything else.
svn path=/icecast/trunk/icecast/; revision=19277
2014-11-07 20:56:04 +00:00
Philipp Schafft
70f8d14d1c added warnings on empty and default values of <fileserve>, <hostname>, <location>, <admin> and <server-id>
svn path=/icecast/trunk/icecast/; revision=19276
2014-11-07 19:14:28 +00:00
Philipp Schafft
0b7e65c3c9 send errorlog (loglevel WARN) to stderr prior to opening the real logfiles. closes #1886
svn path=/icecast/trunk/icecast/; revision=19271
2014-11-07 11:18:54 +00:00
Philipp Schafft
1d56769648 added support for type="" and status="" in <header> (subelement of <http-headers>).
svn path=/icecast/trunk/icecast/; revision=19270
2014-11-07 10:12:24 +00:00
Philipp Schafft
9597e2eadd Added support for <http-headers> within <mount>. Also support merging of headers (normal mount + default mount). See #1885
svn path=/icecast/trunk/icecast/; revision=19269
2014-11-07 02:55:57 +00:00
Philipp Schafft
aa869033e2 handle empty strings in config file better. Now empty strings are handled in: accesslog, errorlog, logdir, webroot, adminroot and hopefully all kinds of port. Feal free to reopen ticket if there are more that needs to be fixed. closes #1963
svn path=/icecast/trunk/icecast/; revision=19268
2014-11-07 01:40:28 +00:00
Philipp Schafft
df9d738b6e initial patch to allow adding user defined headers, closes #1885
svn path=/icecast/trunk/icecast/; revision=19267
2014-11-07 00:56:02 +00:00
Philipp Schafft
97454060eb coding style and typo correcion
svn path=/icecast/trunk/icecast/; revision=19266
2014-11-06 23:55:58 +00:00
Thomas B. "dm8tbr" Ruecker
859c761cb6 Be more verbose in case of fileserve off.
svn path=/icecast/trunk/icecast/; revision=19265
2014-11-06 12:02:00 +00:00
Thomas B. "dm8tbr" Ruecker
0eff9a91e9 applied patch to update the default ciphers to be more secure (close #2072)
This was taken from: https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/#fnref2 (scroll up 2 lines)

I've tested this successfully against https://www.ssllabs.com/ssltest/ in combination with the patch for #2071. The only OS/Browser combination failing is: IE 6 / XP

svn path=/icecast/trunk/icecast/; revision=19264
2014-11-05 10:09:07 +00:00
Philipp Schafft
a3b50beabd applied patch to disable SSLv3 and SSL compression explicitly (close #2071)
svn path=/icecast/trunk/icecast/; revision=19263
2014-11-03 19:34:10 +00:00
Philipp Schafft
e6ce60e630 rename ICE_LISTEN_QUEUE, ICE_RUNNING and ICE_HALTING so they have a prefix of ICECAST_
svn path=/icecast/trunk/icecast/; revision=19258
2014-10-31 09:00:45 +00:00
Philipp Schafft
2b7cb1c641 LOG_{ERROR|WARN|INFO|DEBUG}() -> ICECAST_LOG_{ERROR|WARN|INFO|DEBUG}(); this is to avoid collision with LOG_INFO that is defined as part of syslog.
svn path=/icecast/trunk/icecast/; revision=19257
2014-10-31 08:46:58 +00:00
Philipp Schafft
cf419cc1df make <auth> in <mount type="default"> work if no <mount-name> is given.
svn path=/icecast/trunk/icecast/; revision=19251
2014-10-26 14:03:57 +00:00
ePirat
461a537561 More detailed logging
Add source IP adress to startup and source exit logging, see #2016
Add mountpoint to some log lines, see #1388


svn path=/icecast/trunk/icecast/; revision=19250
2014-10-23 20:41:38 +00:00
Philipp Schafft
634ab4ffc2 fix warnings, mostly related to win*-builds
svn path=/icecast/trunk/icecast/; revision=19246
2014-10-18 16:25:29 +00:00
Philipp Schafft
7ae4664780 Replace the old logging macros with variadic argument macros. (patch by ePirat) (close #2058)
svn path=/icecast/trunk/icecast/; revision=19229
2014-10-09 10:39:13 +00:00
Thomas B. "dm8tbr" Ruecker
53e6ee7abb SECURITY FIX - Override supplementary groups
In case of <changeowner> only UID and GID were changed, 
supplementary groups were left in place.
This is a potential security issue only if <changeowner> is used.
New behaviour is to set UID, GID and set supplementary groups 
based on the UID
Even in case of icecast remaining in supplementary group 0 
this "only" gives it things like access to files that are owned 
by group 0 and according to their umask. This is obviously bad,
but not as bad as UID 0 with all its other special rights.
It's a security issue and we fix immediately and recommend users to update.

PS: Cherry picking this should be fine by distros for fixing older releases.

svn path=/icecast/trunk/icecast/; revision=19137
2014-05-06 04:53:24 +00:00
Thomas B. "dm8tbr" Ruecker
db99c66aa0 Fix email address, my work email was fixed since.
svn path=/icecast/trunk/icecast/; revision=19123
2014-05-04 08:07:25 +00:00
Thomas B. "dm8tbr" Ruecker
9b823cb879 Adding stream_start_iso8601, server_start_iso8601
ISO8601 compliante timestamps for statistics. Should make usage in e.g. JSON
much easier.
Added as new variables to avoid breaking backwards compatibility.

svn path=/icecast/trunk/icecast/; revision=19122
2014-05-04 07:14:54 +00:00
Thomas B. "dm8tbr" Ruecker
2cf9930e91 Reverting r18945 for now as using -b breaks things.
Reopening #1886

svn path=/icecast/trunk/icecast/; revision=19100
2014-03-01 17:37:38 +00:00
Thomas B. "dm8tbr" Ruecker
110a84146d Send charset in headers for everything, excluding file-serv and streams.
svn path=/icecast/trunk/icecast/; revision=19096
2014-02-23 21:29:35 +00:00
Philipp Schafft
518ec953f7 fixed(?) a memory leak: lost headers of stream because of wrong ref counter in associated refbuf objects. I HATE refbuf.
svn path=/icecast/trunk/icecast/; revision=19054
2014-01-12 21:09:04 +00:00
Philipp Schafft
c9b6d627ab send 100-continue-header if client requests it
svn path=/icecast/trunk/icecast/; revision=19053
2014-01-12 12:29:27 +00:00
Philipp Schafft
c88f7d7de2 avoid memory leak in _parse_mount() when "type"-attribuet is set
svn path=/icecast/trunk/icecast/; revision=19052
2014-01-12 12:09:59 +00:00
Philipp Schafft
3f0d8a097e corrected Date:-header format to conform the standard (see RFC1123). Thanks to cato for reporting.
svn path=/icecast/trunk/icecast/; revision=19012
2013-11-06 01:01:31 +00:00
Philipp Schafft
917ace89da corrected logic checking argument. Thanks to David Binderman for reporting
svn path=/icecast/trunk/log/; revision=18961
2013-07-04 12:31:17 +00:00
Thomas B. "dm8tbr" Ruecker
5a26946236 This patch closes ticket #1886.
I've rethought the approach and found a much cleaner way. 
We now split handling of command line arguments into two parts.
Only the critical part of getting the config file is done first (and -v as it prevents startup).
The rest (currently only -b) is deferred.

This achieves the important bit why #1886 was created. 
It allows us to log error messages to stderr even if the -b argument is passed.
This is mainly for the case where the logfile or TCP port can't be opened.

svn path=/icecast/trunk/icecast/; revision=18945
2013-05-15 16:45:55 +00:00
Thomas B. "dm8tbr" Ruecker
115d64d8b4 Edited warning for clarity.
svn path=/icecast/trunk/icecast/; revision=18910
2013-04-05 20:13:18 +00:00
Philipp Schafft
b4887fc581 added a warning in case mount of type default is defined but a mountname is set
svn path=/icecast/trunk/icecast/; revision=18909
2013-04-05 19:49:13 +00:00
Thomas B. "dm8tbr" Ruecker
ff4649bc49 Add warning when using generic handler for stream sent to Icecast.
All bets are off, we're trying our best using legacy handling code.

svn path=/icecast/trunk/icecast/; revision=18907
2013-04-05 16:43:16 +00:00
Philipp Schafft
f19107adc7 avoid fnmatch() on _WIN32 and fall back to strcmp(). Seems that MinGW does half-implement fnmatch()...
svn path=/icecast/trunk/icecast/; revision=18905
2013-04-03 02:04:38 +00:00
Philipp Schafft
47dd39a67c do fuzzy(fnmatch) matching for mountpoint names of non-normal mounts, see #1914
svn path=/icecast/trunk/icecast/; revision=18904
2013-04-03 00:46:55 +00:00
Philipp Schafft
53e8553035 mount points defined in config should use data from default mounts as well, see #1914
svn path=/icecast/trunk/icecast/; revision=18903
2013-04-03 00:33:10 +00:00
Philipp Schafft
d54c61bf13 Added support for a default mount. See #1914.
The default mount is a block in the config file that contains settings for
all mount points that do not have a block in configfile themself.
This is implemented by a <mount type="default">-block.
In this case the <mount>-block MUST NOT contain a <mount-name>-subblock.

svn path=/icecast/trunk/icecast/; revision=18902
2013-04-02 18:46:44 +00:00
Philipp Schafft
f9cfeb51ab Throw away the reqbuf stuff as it was not well designed. Removing it and restoring usage of %H *fixes* #1942 not just workaround it with opening security holes. close #1942
svn path=/icecast/trunk/icecast/; revision=18901
2013-04-02 12:19:33 +00:00
Philipp Schafft
3d9f6643bc allow space in format string for %H to allow spaces in output
svn path=/icecast/trunk/log/; revision=18900
2013-04-02 12:17:43 +00:00
Philipp Schafft
c502c9cc27 make use of const keyword in _fatal_error()
svn path=/icecast/trunk/icecast/; revision=18899
2013-04-02 11:51:47 +00:00
Philipp Schafft
e0b6d1396d allow --version as alias to -v (printing version number)
svn path=/icecast/trunk/icecast/; revision=18898
2013-04-02 11:48:40 +00:00
Thomas B. "dm8tbr" Ruecker
3c359b62dd Highly experimental HTTP PUT support. ref #1812
We are handling it the same as we would handle a SOURCE request.
Due to legacy code, sender MUST send proper content-type header,
if content type is not audio/mpeg!
Can be tested using real-time encoded output and piping it into
| curl -u username:password -H "Content-type: application/ogg" -T - http://localhost:8000/mountname.ogg
Note that this example has ZERO timing, so a simple 'cat *.ogg' will fail.
Whatever feeds the pipe must do it at proper timing for real-time playback!

svn path=/icecast/trunk/icecast/; revision=18888
2013-03-29 15:07:33 +00:00
Thomas B. "dm8tbr" Ruecker
26640bb58d Backing out part of r18755 touching this file.
fixes #1942

svn path=/icecast/trunk/icecast/; revision=18887
2013-03-29 14:41:24 +00:00
Philipp Schafft
aec4326149 corrected mime type of plain text mount point list, thanks to cato
svn path=/icecast/trunk/icecast/; revision=18807
2013-02-24 14:25:37 +00:00
Philipp Schafft
6e7c65bc10 send Expires:-headers on all cache=0 requests, close #1870
svn path=/icecast/trunk/icecast/; revision=18805
2013-02-24 02:04:43 +00:00
Philipp Schafft
d0bf2c64ed handle yp headers case insensetive, close #1873
svn path=/icecast/trunk/icecast/; revision=18804
2013-02-24 00:53:09 +00:00
Philipp Schafft
1f833eb244 Allow full URLs to be returned by the master server. close #1878
svn path=/icecast/trunk/icecast/; revision=18799
2013-02-23 20:55:58 +00:00
Philipp Schafft
40bc1e7659 Updated listener_remove handler:
* added ip= and agent=,
 * Some cleanup && made code more uniform,
 * avoid int for size_t vars.
actions: close #1422

svn path=/icecast/trunk/icecast/; revision=18798
2013-02-23 17:51:16 +00:00
Philipp Schafft
2c3108387b format fix
svn path=/icecast/trunk/icecast/; revision=18797
2013-02-23 17:05:54 +00:00
Philipp Schafft
a5163365a0 do not call xmlCleanupParser() too often, close #1931
svn path=/icecast/trunk/icecast/; revision=18796
2013-02-23 16:38:23 +00:00
Philipp Schafft
af068a72a6 Replaced usage of sprintf() with snprintf(). Also exported size of key printer's buffer in avl/.
svn path=/icecast/trunk/avl/; revision=18771
2013-01-16 12:02:14 +00:00
Philipp Schafft
3d504e9e6c Escape log entries in access log (close: #1916)
svn path=/icecast/trunk/log/; revision=18756
2013-01-02 14:44:43 +00:00
Philipp Schafft
bb07af1eb7 Escape log entries in access log (close: #1916)
svn path=/icecast/trunk/icecast/; revision=18755
2013-01-02 14:44:08 +00:00
Philipp Schafft
67d91cc3d2 corrected Content-Length: header in admin (raw) requests. Thanks to paluh for reporting.
svn path=/icecast/trunk/icecast/; revision=18698
2012-11-13 14:40:48 +00:00
Philipp Schafft
5b8e359f10 cleanup unused var schedule_config_reread.
svn path=/icecast/trunk/icecast/; revision=18693
2012-11-13 11:25:46 +00:00
Philipp Schafft
d0aa6c8769 correction for win32 build to avoid segfault if build with mingw (who wrote that code?)
svn path=/icecast/trunk/icecast/; revision=18688
2012-11-12 21:01:57 +00:00
Philipp Schafft
4e7434c71c corrected coding style
svn path=/icecast/trunk/icecast/; revision=18666
2012-10-14 23:50:15 +00:00
Philipp Schafft
2b40660a20 removed useless blank line
svn path=/icecast/trunk/icecast/; revision=18665
2012-10-14 21:36:10 +00:00
Philipp Schafft
98935fcc6e removed \r at end of lines
svn path=/icecast/trunk/icecast/; revision=18655
2012-10-12 14:41:12 +00:00
Philipp Schafft
6cbd28a057 updated copyright notices.
svn path=/icecast/trunk/icecast/; revision=18651
2012-10-11 22:54:53 +00:00
Philipp Schafft
27ba19f014 avoid compiler warnings; send /message/ in case of 403.
svn path=/icecast/trunk/icecast/; revision=18650
2012-10-11 22:49:57 +00:00
Philipp Schafft
61c9def238 cleanup of <source-password> parser code
svn path=/icecast/trunk/icecast/; revision=18649
2012-10-11 22:28:40 +00:00
Philipp Schafft
fdcef55ce1 Added options "headers" and "header_prefix" to URL based listener auth.
Someone should update the docs/ textes to good english.

svn path=/icecast/trunk/icecast/; revision=18648
2012-10-11 18:06:30 +00:00
Philipp Schafft
a424a4e1fe Fix win32 patches (r18642) so it builds corectly on non-win32 again.
svn path=/icecast/trunk/icecast/; revision=18646
2012-10-11 00:26:38 +00:00
Philipp Schafft
91b49c583b use correct prototype.
svn path=/icecast/trunk/icecast/; revision=18645
2012-10-10 23:34:54 +00:00
Philipp Schafft
9872182a09 Improved handling of HTTP client errors:
* Make the internal API more uniform,
 * Improved error pages slightly (See: #1889).

svn path=/icecast/trunk/icecast/; revision=18644
2012-10-10 23:15:05 +00:00
Philipp Schafft
469844374a Make some more vars local (static).
svn path=/icecast/trunk/icecast/; revision=18643
2012-10-10 22:48:15 +00:00
Philipp Schafft
4927a1109d fixes for win32 (ported 2.3.99.0 patches). Thanks to LRN (from Mailing list).
svn path=/icecast/trunk/icecast/; revision=18642
2012-10-10 22:41:30 +00:00
Philipp Schafft
8e0777a4bd allow <stream-name> to override the icy-name: HTTP header, close #1359
svn path=/icecast/trunk/icecast/; revision=18543
2012-08-18 20:34:11 +00:00
Philipp Schafft
7eb5e1b6e4 Corrected check for the value of priority to be within valid range.
svn path=/icecast/trunk/log/; revision=18485
2012-07-31 23:09:42 +00:00
Philipp Schafft
2abd67d497 remove unused variable "ice_config_t *config" from format_prepare_headers()
svn path=/icecast/trunk/icecast/; revision=18465
2012-07-18 01:40:55 +00:00
Philipp Schafft
abf6c134d0 Send proper HTTP headers in responses to clients.
This is currently not implemented for SOURCE and STATS clients as
I suspect to break them. This needs some more research.
close #1639, see #1870 and #1885.

svn path=/icecast/trunk/icecast/; revision=18464
2012-07-17 23:55:09 +00:00
Thomas B. "dm8tbr" Ruecker
9c2db2107f Adding limits.h to fix build problems on e.g. newer glibc.
svn path=/icecast/trunk/icecast/; revision=18459
2012-07-17 21:24:45 +00:00
Philipp Schafft
55c9b45f0e added new lion at end of file so it does not mess up my console.
svn path=/icecast/trunk/icecast/; revision=18456
2012-07-17 14:50:44 +00:00
Philipp Schafft
9967447544 Allow (standard strftime(3)) %x codes in mount's <dump-file> to embedd timestamps in filenames. This currently only works on non windows. closes #1823
svn path=/icecast/trunk/icecast/; revision=18455
2012-07-17 14:42:16 +00:00
Philipp Schafft
2cb0e3180d race condition patch as submitted by lds and remi, slightly motified by me. closes #1810
svn path=/icecast/trunk/icecast/; revision=18454
2012-07-17 14:03:37 +00:00
Philipp Schafft
eea84fca6c commited support for HTTP PUT, See #1812
svn path=/icecast/trunk/httpp/; revision=18452
2012-07-16 16:05:21 +00:00
giles
818c1aff71 Add WebM support.
This is David Richard's webm support patch from the icecast-webm branch.

svn path=/icecast/trunk/icecast/; revision=18402
2012-06-13 21:24:23 +00:00
giles
1295a56c4d Add support for Opus audio in the Ogg container.
Patch by David Richards from the icecast-webm branch.

svn path=/icecast/trunk/icecast/; revision=18401
2012-06-13 21:11:07 +00:00
Philipp Schafft
1b071ba395 support field width with (most common) %Ns and %NH syntax.
svn path=/icecast/trunk/log/; revision=18363
2012-06-07 18:27:58 +00:00
Philipp Schafft
5dede89f82 honor field width in %s and %H
svn path=/icecast/trunk/log/; revision=18362
2012-06-07 18:13:28 +00:00
Philipp Schafft
95105687f1 consider backticks as well as backslashes invalid chars
svn path=/icecast/trunk/log/; revision=18361
2012-06-07 18:09:48 +00:00
giles
636a2959f3 Merge fixes from trunk.
svn path=/icecast/branches/icecast-webm/; revision=18358
2012-06-07 16:51:03 +00:00
Thomas B. "dm8tbr" Ruecker
ddbce35678 This is part of the patch-set addressing CVE-2011-4612.
svn path=/icecast/trunk/log/; revision=18356
2012-06-07 15:57:59 +00:00
Thomas B. "dm8tbr" Ruecker
38cad36049 This is part of the patch-set addressing CVE-2011-4612.
svn path=/icecast/trunk/icecast/; revision=18355
2012-06-07 15:57:11 +00:00
giles
e6cd0cff1f Clarify that only these specific files are GPLv2 or v3.
Icecast itself remains GPLv2 only.

svn path=/icecast/branches/icecast-webm/; revision=18307
2012-05-24 18:32:06 +00:00
giles
1c0b051b80 Update copyright headers for the new code.
Also update the license statement to GPL2 or later.

svn path=/icecast/branches/icecast-webm/; revision=18303
2012-05-24 16:10:20 +00:00
giles
0fce619138 Add opus support.
This is David Richards' support patch for Ogg encapsulated
Opus streams.

From 35927ca52f

svn path=/icecast/branches/icecast-webm/; revision=18302
2012-05-24 16:04:27 +00:00
giles
835408b7eb Add David Richard's webm support patch.
This is a self-contained ebml parser. It just looks
for cluster boundaries and breaks the stream there.

svn path=/icecast/branches/icecast-webm/; revision=18297
2012-05-18 17:33:17 +00:00
Philipp Schafft
446053dd9a corrected some small formating errors and typos
svn path=/icecast/trunk/icecast/; revision=18131
2011-11-26 02:39:30 +00:00
Philipp Schafft
17db41eba1 Added VCLT playlist support.
svn path=/icecast/trunk/icecast/; revision=18130
2011-11-26 02:37:39 +00:00
Philipp Schafft
e157de2321 Updated <alias> to use destination="" not dest="".
The old dest="" attribute is still supported.

svn path=/icecast/trunk/icecast/; revision=18128
2011-11-25 22:22:48 +00:00
Thomas B. "dm8tbr" Ruecker
f57110d7e5 Applied justdave's patches, fixing #1717 and #1718.
HTTPS now with better security and support for chained
certificates

svn path=/icecast/trunk/icecast/; revision=18127
2011-11-25 22:12:11 +00:00
Philipp Schafft
d66c53987c added a missing '*' to the copyright header
svn path=/icecast/trunk/icecast/; revision=18126
2011-11-25 22:00:36 +00:00
Philipp Schafft
530b78d7a1 Allow the source password to be undefined.
This is to avoid falling back to a default password which may open security holes.

svn path=/icecast/trunk/icecast/; revision=18125
2011-11-25 21:24:28 +00:00
Thomas B. "dm8tbr" Ruecker
99788838ac First part of security fix for #1846
svn path=/icecast/trunk/icecast/; revision=18124
2011-11-25 19:59:03 +00:00
Karl Heyes
3c4816555e win32 updates. cleanup of the start and finish of the gui and service
svn path=/icecast/trunk/icecast/; revision=16440
2009-08-05 22:32:47 +00:00
Karl Heyes
1f92e2ab1c setting an interval of 0 in mount should disable shoutcast metadata inserts.
svn path=/icecast/trunk/icecast/; revision=16439
2009-08-05 22:24:04 +00:00
Karl Heyes
fa7b8bb814 send host header on relay connect
svn path=/icecast/trunk/icecast/; revision=16257
2009-07-11 01:23:16 +00:00
Karl Heyes
74e11b7194 fix case of global listeners count becoming out of sync. It is possible that
connecting listeners will disconnect before any processing is done on them.

svn path=/icecast/trunk/icecast/; revision=16254
2009-07-10 15:08:30 +00:00
Karl Heyes
44c05662c7 minor cleanups.
svn path=/icecast/trunk/httpp/; revision=16213
2009-07-07 16:37:31 +00:00
Karl Heyes
b9b94478c7 bug+fix reported on icecast-dev (Petr Pisar, 06/07/2009). poll implementation
of sock_connected had incorrect return in failure case.

svn path=/icecast/trunk/net/; revision=16209
2009-07-06 14:28:16 +00:00
Karl Heyes
5597e2b874 prevent a debug message from triggering
svn path=/icecast/trunk/icecast/; revision=15784
2009-03-17 02:59:50 +00:00
Karl Heyes
ed7e707f11 add optional bind setting to relays
svn path=/icecast/trunk/icecast/; revision=15783
2009-03-17 01:45:41 +00:00
Karl Heyes
d784622396 non-blocking setting on win32 broke with previous patch. Add optional xml setting for
specifying the TCP send buffer size, it seems that on at least some win32 systems,
the window size stays at 8k (even with registry settings) which could limit available
streaming bandwidth.

svn path=/icecast/trunk/icecast/; revision=15766
2009-03-14 16:05:12 +00:00
Karl Heyes
1ab9b4a887 prevent logging lots of failed to reserve relay mountpoint. close #1513
svn path=/icecast/trunk/icecast/; revision=15764
2009-03-14 02:46:40 +00:00
Karl Heyes
9e118ca72b explicitly flag up a metadata update after they have been set. Could of led to
a non-crash type race between artist and title fields updating.  Also allow
passing a url setting, mapping to StreamURL in the icy metadata block, but do
not override any existing inline setting.

svn path=/icecast/trunk/icecast/; revision=15622
2009-01-15 03:38:49 +00:00
Karl Heyes
e6dfee632c Allow source client authentication via auth handler. Here the URL handler can
issue requests (using ithe stream_auth option) to allow external engines to
determine whether a client can stream or not. Admin requests using source auth
are able to use this mechanism however source clients using the icy protocol
cannot yet.


svn path=/icecast/trunk/icecast/; revision=15621
2009-01-14 01:18:22 +00:00
Karl Heyes
d49fd42eec lock order updates. hard to trigger case in source fallback. The other changes
are for consistency.

svn path=/icecast/trunk/icecast/; revision=15619
2009-01-11 16:46:08 +00:00
Karl Heyes
ed58514eaa Add handlers for spinlocks if available, map to mutexes when not.
svn path=/icecast/trunk/icecast/; revision=15614
2009-01-09 03:18:03 +00:00
Karl Heyes
add7342a14 Don't free up the second, third... header pages, as those are only referenced
once, only the first page is refcounted multiple times by the queue. Put some
checks in to help capture odd cases if they arise.

svn path=/icecast/trunk/icecast/; revision=15613
2009-01-08 03:35:54 +00:00
Karl Heyes
52129d4c5e oops, missed one from previous commit
svn path=/icecast/trunk/icecast/; revision=15612
2009-01-08 03:20:10 +00:00
Karl Heyes
deff3aa0ca avoid SOCK_NONBLOCK name clash with recent glibc. Add support for optional
bind parameter to connect_wto call. Some small compiler cleanups.

svn path=/icecast/trunk/icecast/; revision=15611
2009-01-08 02:47:44 +00:00
Karl Heyes
4ec4a90cb8 log: When keeping around log lines, only allocate what we actually use. Allow
compiler printf arg checking.
timing: win32 fix, don't use timeGetTime, fixes access log timestamp

svn path=/icecast/trunk/log/; revision=15610
2009-01-08 02:18:11 +00:00
ivo
cf3e3c8011 Do not allow Skeleton from taking control over the sync marks. Karl's proposal for the Vorbis+Skeleton issue.
svn path=/icecast/trunk/icecast/; revision=15529
2008-11-23 23:31:36 +00:00
Karl Heyes
3addc16981 reduce memory allocation and processing when retrieving stats for xsl pages
svn path=/icecast/trunk/icecast/; revision=15462
2008-10-29 02:47:41 +00:00
Karl Heyes
544c41ce60 missed from previous commit. we don't cleanup at this point anymore, doing so
could cause lost client connections.

svn path=/icecast/trunk/icecast/; revision=15426
2008-10-21 02:30:43 +00:00
Karl Heyes
d503f0bf5c guard for 2 NULL pointer cases raised by coverity. Neither should occur in practice
svn path=/icecast/trunk/icecast/; revision=15358
2008-10-01 01:07:29 +00:00
Karl Heyes
7b9b682a94 prevent minor memory leak, not usually triggered
svn path=/icecast/trunk/icecast/; revision=15318
2008-09-19 00:23:16 +00:00
Karl Heyes
72f8944c90 fix starting point problem with low bandwidth theroa streams. listener could
connect and be waiting a while before receiving stream content.

When retrieving streamlist, don't wait too long for connection to master

schedule a full stats rebuild on source disconnect.

Minor build fix for certain platforms with missing defines

svn path=/icecast/trunk/icecast/; revision=15276
2008-09-09 02:18:22 +00:00
Karl Heyes
a520a18e53 allow listener_remove only cases. clients were not attached to the auth at
connection time so the remove trigger could not be processed.

svn path=/icecast/trunk/icecast/; revision=15265
2008-09-08 00:40:25 +00:00
Karl Heyes
4c841bbe21 only allow raw admin metadata updates from the IP of the source client unless
the user is admin. It seems that some source clients issue metadata updates
even if they are rejected due to the mountpoint being in use.

svn path=/icecast/trunk/icecast/; revision=15264
2008-09-08 00:30:37 +00:00
Karl Heyes
30836f31c9 have a minimum update duration to prevent very frequent touch updates, no
point in creating extra YP load for this case.

svn path=/icecast/trunk/icecast/; revision=15263
2008-09-08 00:22:37 +00:00
Karl Heyes
d97233258c Make fserve thread start up only when required. In most cases this thread is
just in a sleep loop which means most clients getting to it have to wait. We
now just start the thread when there is work to do.  There is also some small
cleanup for the off_t type usage as well.

svn path=/icecast/trunk/icecast/; revision=15124
2008-07-22 02:37:32 +00:00
Karl Heyes
0bd5f9e74f Some have reported that if they do a series of requests in succession that
the overall time is very slow. This lag is mainly down to the sleep that
the connection and fserve threads do to prevent busy looping when idle. The
sleep has to expire even if requests are waiting.

This patch merges the tasks done by the connection and listener thread into
one thread.  It allows us to remove some locking, reduce thread usage and
service new connections more quickly as the poll/select acts as the busy
CPU prevention.

svn path=/icecast/trunk/icecast/; revision=15123
2008-07-22 02:24:30 +00:00
Karl Heyes
c6a0b4cc8b 2 on-demand relay fixups.
We prevent a failed relay from restarting too quickly but don't prevent
connecting listeners from getting to the source_t during that time. Drop the
on-demand status in the source_t during this period so listeners are rejected.
The setting is reset from relay eventually.

Relays without matching mount sections had no stats initially.


svn path=/icecast/trunk/icecast/; revision=15122
2008-07-19 01:57:53 +00:00
Karl Heyes
26c9b65eb0 expand debug log message to include a mountpoint reference
svn path=/icecast/trunk/icecast/; revision=15121
2008-07-19 01:36:16 +00:00
Karl Heyes
385d65b838 Don't include a per node lock unless it is really wanted. I don't think anyone
is using them currently, so lets reduce the structure size.  On win32, this
extra lock increases the handles usage considerably.

svn path=/icecast/trunk/avl/; revision=15120
2008-07-19 01:30:16 +00:00
Karl Heyes
1645c82128 handle a couple of possible odd misconfiguration cases with YP. Make sure the
peak_listeners stat is shown when relays are inactive.

svn path=/icecast/trunk/icecast/; revision=14934
2008-05-21 02:19:47 +00:00
Karl Heyes
06510b997b update from win32 build. Mostly cleanup work
svn path=/icecast/trunk/icecast/; revision=14867
2008-05-12 01:21:06 +00:00
Karl Heyes
90b705986c sanity check for unspecifed url
svn path=/icecast/trunk/icecast/; revision=14866
2008-05-11 23:20:50 +00:00
Karl Heyes
c59afc60d2 check if function exists, some older versions don't have this
svn path=/icecast/trunk/icecast/; revision=14825
2008-05-02 23:18:52 +00:00
Karl Heyes
f7e64956df fix busy retry bug on failure from previous patch
svn path=/icecast/trunk/icecast/; revision=14824
2008-05-02 16:10:22 +00:00
Karl Heyes
cbb7643b43 Allow any number of mountpoints to be returned for streamlist. You would
need a large number of mountpoints to trigger a truncation.  Allow file
serving thread to process a list of blocks for sending back to
the client. Then build the block list in the stats engine for returning.

svn path=/icecast/trunk/icecast/; revision=14812
2008-04-29 04:50:23 +00:00
Karl Heyes
2822e350bb htpasswd auth should apply even if no filename is specified, just reject all
new listeners with the reason logged. auth_t refcount was getting out of sync
which is a potential small memory leak.

svn path=/icecast/trunk/icecast/; revision=14788
2008-04-23 02:48:53 +00:00
Karl Heyes
a3d1ff8098 YP fixup for unusual cases. Inactive on-demand relays were not sending certain
details to stats engine.  On YP remove, make sure we find all nodes for that
montpoint not just the first. Allow at least 20mins from a failed touch before
next add, allows YP to give a longer wait period for misconfigured setups by
issuing a TouchFreq header on rejection.

svn path=/icecast/trunk/icecast/; revision=14787
2008-04-23 01:45:38 +00:00
Karl Heyes
cdfeb30444 handle new content-types
svn path=/icecast/trunk/icecast/; revision=14786
2008-04-23 00:32:20 +00:00
Karl Heyes
b2ce433a8f Add Kate and Skeleton codecs to ogg handler. patch by ogg.k.ogg.k
svn path=/icecast/trunk/icecast/; revision=14778
2008-04-19 02:11:37 +00:00
Karl Heyes
bded7d2564 Small cleanups. Prevent possible segv in relay definition if missing server tag.
Don't add to stream directory until a minute has passed, it seems like a few sites
are triggering YP requests because they are connecting and then dropping (probably
due to timeout), so at least make sure the stream is running a little while.

svn path=/icecast/trunk/icecast/; revision=14777
2008-04-19 02:04:17 +00:00
Karl Heyes
0047edd51c small update for failure case. retry times changed and limited redirection allowed
svn path=/icecast/trunk/icecast/; revision=14773
2008-04-18 01:12:45 +00:00
Karl Heyes
649c4fdc70 build fix for older setups with IPv6
svn path=/icecast/trunk/net/; revision=14545
2008-02-28 02:16:23 +00:00
Karl Heyes
c37e770ee0 avoid duplicate entries in playlist log
svn path=/icecast/trunk/icecast/; revision=14483
2008-02-12 04:15:45 +00:00
Karl Heyes
0868602bc0 win32 update. change build settings so that we make the process simpler, it
was very easy for the intermediate files to clash between projects.  The newer
libxml2/libxslt/libcurl also were causing some threading issues due to
library initialization


svn path=/icecast/trunk/icecast/; revision=14465
2008-02-11 01:00:41 +00:00
Karl Heyes
1cdc68cf1d Use poll if available, select can cause stack corruption if descriptor value is over 1024
svn path=/icecast/trunk/net/; revision=14457
2008-02-05 04:21:12 +00:00
Karl Heyes
3344ff6f09 if a directory server times out, reset the failing server stream entries so
that the streams go through the add process again in 15 mins. closes #689

svn path=/icecast/trunk/icecast/; revision=14452
2008-02-03 05:43:32 +00:00
Karl Heyes
22ee7b6b6e minor xml cleanup, reduce default log level, closes #775
svn path=/icecast/trunk/icecast/; revision=14450
2008-02-03 03:11:54 +00:00
Karl Heyes
22654d271c Handle missing mount in relay case, and add checks for NULL which may be an issue for libxml2.
svn path=/icecast/trunk/icecast/; revision=14430
2008-01-24 03:31:25 +00:00
Karl Heyes
4aa2f1e0eb fix possible junk chars passed back and don't call strftime each log line, under
glibc this calls for a stat of /etc/localtime each time

svn path=/icecast/trunk/log/; revision=14429
2008-01-24 03:28:11 +00:00
Karl Heyes
6331e2ee77 fix default operation for manageauth
svn path=/icecast/trunk/icecast/; revision=14339
2008-01-03 15:18:52 +00:00
Karl Heyes
03e18677e4 drop const usage and work around a FBSD issue with listening sockets
svn path=/icecast/trunk/net/; revision=14319
2007-12-20 16:49:02 +00:00
Karl Heyes
6bcbb416b9 make sure we report the correct port for m3u and YP when not using the default port
svn path=/icecast/trunk/icecast/; revision=14318
2007-12-20 16:36:37 +00:00
Karl Heyes
2ccfe3caa5 port 8000 could be set to listen on when not wanted
svn path=/icecast/trunk/icecast/; revision=14314
2007-12-19 19:09:04 +00:00
Karl Heyes
0e533ac490 reduce wasted memory on 64bit systems, 32bit has no change
svn path=/icecast/trunk/avl/; revision=14308
2007-12-15 17:51:33 +00:00
Karl Heyes
73401b80d5 prevent NULL dereference
svn path=/icecast/trunk/icecast/; revision=14307
2007-12-15 17:21:22 +00:00
Karl Heyes
02cc6c5f10 type cleanups. reduces memory usage on 64bit, no difference on 32bit. closes #780
svn path=/icecast/trunk/icecast/; revision=14306
2007-12-15 17:02:16 +00:00
Karl Heyes
7b6b874b02 type cleanups. Use C99 defines if available and a missed sock_t on win32. This
resolves some warnings on win32 and x86_64

svn path=/icecast/trunk/icecast/; revision=14223
2007-11-23 16:27:10 +00:00
Karl Heyes
89dac2e3cf minor header cleanup
svn path=/icecast/trunk/icecast/; revision=14219
2007-11-23 03:17:39 +00:00
Karl Heyes
6ee33215e8 fix long standing copy+paste error.
svn path=/icecast/trunk/icecast/; revision=14218
2007-11-23 02:48:37 +00:00
Karl Heyes
7d8182eef5 minor cleanups, no functional change
svn path=/icecast/trunk/icecast/; revision=14206
2007-11-21 02:55:11 +00:00
Michael Smith
ab1447d35b Don't make autogen.sh look for a specific version of automake (seems to still
work)

Include <errno.h> in connection.c; hopefully fixes Geoff Shang's compilation
problems.

svn path=/icecast/trunk/icecast/; revision=14155
2007-11-15 15:12:21 +00:00
Karl Heyes
197be21d1c only pass clients to url auth handler if the trigger is defined in the xml
svn path=/icecast/trunk/icecast/; revision=14115
2007-11-08 20:00:54 +00:00
Karl Heyes
66b68170cc auth sync up. Fix longstanding race bug and make stream start/stop triggers work again.
svn path=/icecast/trunk/icecast/; revision=14114
2007-11-08 19:52:51 +00:00
Karl Heyes
b4b8e3e552 fix bad pointer bug for libcurl and small memory leak over reload of xml
svn path=/icecast/trunk/icecast/; revision=14108
2007-11-08 03:21:33 +00:00
Karl Heyes
0a347a6817 allow for multiple shoutcast style source clients to connect. They don't
provide a mountpoint so you specify a shoutcast-mount in the listen-socket
section. Specifying this will automatically define the port+1 with the same
settings however the original shoutcast-compat approach is maintained.

svn path=/icecast/trunk/icecast/; revision=14045
2007-10-25 02:25:49 +00:00
Karl Heyes
88514b9c8e fix minor memory leak on failed shoutcast source auth
svn path=/icecast/trunk/icecast/; revision=14044
2007-10-25 01:03:47 +00:00
Karl Heyes
af1c8da6b6 more sock_t cleanups, win32 should have less warnings now
svn path=/icecast/trunk/icecast/; revision=14043
2007-10-24 22:42:49 +00:00
Karl Heyes
089dd4c273 return type was wrong, although it probably won't affect stability
svn path=/icecast/trunk/icecast/; revision=14042
2007-10-24 22:40:42 +00:00
Karl Heyes
9c155dda50 clean up prototypes and sock_t handling, for win32 mainly, no functional change
svn path=/icecast/trunk/net/; revision=14041
2007-10-24 21:42:01 +00:00
Karl Heyes
4b5f00993d Allow for files to be specified that will contain IPs that can be used to
accept or deny client connections.

svn path=/icecast/trunk/icecast/; revision=14039
2007-10-23 22:25:31 +00:00
Karl Heyes
9379e4e051 *sigh, missing ; at least the coverity list should be clear again
svn path=/icecast/trunk/icecast/; revision=14033
2007-10-22 02:57:56 +00:00
Karl Heyes
ef8a91c8e6 minor memory leak on resource failure case
svn path=/icecast/trunk/icecast/; revision=14032
2007-10-22 02:52:16 +00:00
Karl Heyes
148af4e6ee merge work. mainly stats and some log message updates
svn path=/icecast/trunk/icecast/; revision=14031
2007-10-22 02:29:49 +00:00
Karl Heyes
27f58c1189 boundary limit check was wrong, we won't be able to match any of the listen sockets
svn path=/icecast/trunk/icecast/; revision=14030
2007-10-22 02:23:10 +00:00
Karl Heyes
a26bb50004 fix some potential minor memory leaks
svn path=/icecast/trunk/icecast/; revision=14018
2007-10-20 01:58:14 +00:00
Karl Heyes
549127b9f5 a missing break from a previous auth update was preventing url auth from being
used

svn path=/icecast/trunk/icecast/; revision=14017
2007-10-20 01:55:18 +00:00
Karl Heyes
ab75a3297f add global listeners stat
svn path=/icecast/trunk/icecast/; revision=14016
2007-10-20 00:58:05 +00:00
Karl Heyes
dcffbb38ad header fixup for listeners. Tell any proxies to not cache and add minor tweaks
for flash players. closes #1115

svn path=/icecast/trunk/icecast/; revision=14014
2007-10-19 14:06:07 +00:00
Karl Heyes
f9c3fc91a7 updates to range header handling. closes #1246, #810
svn path=/icecast/trunk/icecast/; revision=14006
2007-10-17 23:49:14 +00:00
Karl Heyes
55b5b7eb80 minor memory leak fixed
svn path=/icecast/trunk/icecast/; revision=14004
2007-10-17 02:35:48 +00:00
Karl Heyes
ba438dd7b5 Don't impose a limit on the number of listening sockets allowed in the xml
svn path=/icecast/trunk/icecast/; revision=13995
2007-10-16 01:53:06 +00:00
Karl Heyes
e065acb7f1 no functional/structural change but cleans up the annoying signed/unsigned pointer warnings
here with xmlChar, based on work originally done by gtgbr@gmx.net.
closes #783, #784, #785, #787

svn path=/icecast/trunk/icecast/; revision=13933
2007-10-04 16:48:38 +00:00
Karl Heyes
da893d8b3b missed these from previous commit, these checks are redundant now
svn path=/icecast/trunk/icecast/; revision=13930
2007-10-04 01:44:05 +00:00
Karl Heyes
807f95243f Make copies of the default string values instead of relying on the compiler to check
for duplicate string literals.

svn path=/icecast/trunk/icecast/; revision=13929
2007-10-04 00:55:13 +00:00
Karl Heyes
43988cac59 Allow buildm3u to work with the mount given, no need to check the source tree. closes #866
svn path=/icecast/trunk/icecast/; revision=13908
2007-09-28 00:54:01 +00:00
Karl Heyes
b8ab793867 make sure mount authentication has a type specified
svn path=/icecast/trunk/icecast/; revision=13877
2007-09-22 01:21:17 +00:00
Karl Heyes
7735a94ee6 add guards for NULL dereference
svn path=/icecast/trunk/avl/; revision=13799
2007-09-14 03:09:32 +00:00
Karl Heyes
e99eee6c80 small build fix and a minor issue highlighted by coverity
svn path=/icecast/trunk/icecast/; revision=13798
2007-09-14 03:01:17 +00:00
Karl Heyes
337f4a3272 make sure config lock is released in all failure cases of manageauth
svn path=/icecast/trunk/icecast/; revision=13792
2007-09-13 01:32:15 +00:00
Karl Heyes
03a4d5298f convert the passed value
svn path=/icecast/trunk/icecast/; revision=13755
2007-09-05 03:25:14 +00:00
Karl Heyes
d43254853f allow mount param for webroot xsl pages, closes #990
svn path=/icecast/trunk/icecast/; revision=13754
2007-09-05 02:16:45 +00:00
Karl Heyes
2c67cfffb2 fix for #734. Allow /admin/stats[.xsl] to take an optional mount arg which only
returns global stats and stats for that particular mountpoint.


svn path=/icecast/trunk/icecast/; revision=13709
2007-09-03 22:04:04 +00:00
Karl Heyes
d327fc8914 close report #704, add server-id tag, default stays as the server version string.
svn path=/icecast/trunk/icecast/; revision=13704
2007-09-03 00:55:27 +00:00
Karl Heyes
47def32074 missed some NULL checks from previous character set commit. Add optional charset
setting on metadata update request and conversion code for it.


svn path=/icecast/trunk/icecast/; revision=13663
2007-08-30 23:36:19 +00:00
Karl Heyes
7e5604b993 merge work. allow sockets to be marked as ssl capable. This is mainly for /admin
requests but can be used for sources and listeners

svn path=/icecast/trunk/icecast/; revision=13650
2007-08-29 03:51:22 +00:00
Karl Heyes
31ce005ef3 small const update, add NULL check, NULL shouldn't occur here but it's better to play safe
svn path=/icecast/trunk/icecast/; revision=13649
2007-08-29 02:01:28 +00:00
Karl Heyes
9e078e714f allow xsl requests to go through the authentication code
svn path=/icecast/trunk/icecast/; revision=13628
2007-08-25 16:04:33 +00:00
Karl Heyes
5a7111fc82 Fix bug #895. Most if not all non-Ogg streams send metadata as non-UTF8, typically
ISO-8859-1 is assumed as there is no real clarity wrt the spec. In most cases people
send ASCII so it's not an issue, but for some, the extended characters they send
can cause problems with XML processing.  As stats and YP require UTF8 we need to
translate them and block invalid cases.

For the moment, for non-Ogg streams only, we assume that the metadata needs converting
from ISO-8859-1. Ogg streams are UTF8 so no conversion needed. You can override the
default with a charset mount option.


svn path=/icecast/trunk/icecast/; revision=13615
2007-08-24 15:44:37 +00:00
Karl Heyes
fe0e17dbaa fix bug #1141
svn path=/icecast/trunk/icecast/; revision=13595
2007-08-23 16:58:18 +00:00
Karl Heyes
176b9f7eca Auth update. Have each auth_t has its own queue of requests and thread to process
them. Each listener connection for each request is checked as connected before
performing the request (so that time isn't wasted on slow authentication). Various
name/comment cleanups as well.

svn path=/icecast/trunk/icecast/; revision=13583
2007-08-21 22:30:30 +00:00
Karl Heyes
620c51f699 added function to check whether the socket is still alive
svn path=/icecast/trunk/net/; revision=13582
2007-08-21 22:17:13 +00:00