1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00
Commit Graph

212 Commits

Author SHA1 Message Date
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
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
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
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
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
4e7434c71c corrected coding style
svn path=/icecast/trunk/icecast/; revision=18666
2012-10-14 23:50:15 +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
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
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
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
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
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
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
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
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
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
ab75a3297f add global listeners stat
svn path=/icecast/trunk/icecast/; revision=14016
2007-10-20 00:58:05 +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
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
5f8cfd70f7 const updates, no functional changes
svn path=/icecast/trunk/icecast/; revision=13559
2007-08-16 22:49:13 +00:00
Karl Heyes
f1c6cf9d4e Allow rereading of the mime types file on xml reload. Also allow for specifying
an alternative filename in the xml.

svn path=/icecast/trunk/icecast/; revision=13541
2007-08-13 21:33:27 +00:00
Karl Heyes
bb0b1a2a32 Triggers for source stats updated. No point updating all source stats if fewer
need updating. Fixes a few unusual cases, if a mount was removed (with xml reload)
whilst no source was reserved then those stats were left behind.

svn path=/icecast/trunk/icecast/; revision=13538
2007-08-11 17:44:45 +00:00
Karl Heyes
3e8f2c39d4 fix problem case when listeners are moved by another thread, eg a fallback
override is triggered, and on-demand relays are not shut down or stats are
not updated.

svn path=/icecast/trunk/icecast/; revision=13496
2007-08-09 15:43:00 +00:00
Karl Heyes
9e96120398 When modifying source_t contents we should take a write lock to prevent
races with other threads. so take a write lock on the client tree.

svn path=/icecast/trunk/icecast/; revision=11007
2006-03-15 02:42:18 +00:00
Karl Heyes
c81a42cb3b close report #842. It's more informative to report the read bytes
svn path=/icecast/trunk/icecast/; revision=11006
2006-03-15 02:34:39 +00:00
Michael Smith
14e0cfcdac Remove a bogus non-null check
svn path=/icecast/trunk/icecast/; revision=10979
2006-03-07 19:39:16 +00:00
Michael Smith
739d544c34 Having both os.h and compat.h to do similar things is pointless; remove os.h
svn path=/icecast/trunk/icecast/; revision=10620
2005-12-17 12:41:34 +00:00
Karl Heyes
d670683e1e allow for the intro file to change over HUP
svn path=/icecast/trunk/icecast/; revision=10411
2005-11-20 13:53:29 +00:00
Karl Heyes
fce4c2263d maintain the listener_peak stat across relay restarts
svn path=/icecast/trunk/icecast/; revision=10033
2005-09-19 02:11:16 +00:00
Michael Smith
9a78c1b735 Fix deadlock when moving clients. Thanks to oddsock for producing a testcase and
backtrace, and karl for fixing my brain

svn path=/icecast/trunk/icecast/; revision=10017
2005-09-15 19:31:38 +00:00
Karl Heyes
a4b03ad26c minor memory leak, and compiler warning cleanup
svn path=/icecast/trunk/icecast/; revision=9857
2005-08-27 01:01:29 +00:00
Karl Heyes
76b8ec882f hide fallback file from webroot stats, still accessible from admin. Missed
log debug line from apply function

svn path=/icecast/trunk/icecast/; revision=9848
2005-08-25 01:03:33 +00:00
Karl Heyes
d07723c997 fixes for client handling, these are all related to the handling of max clients.
I've taken out the client_create out of the connection_complete_source and put
it in slave, that way we can control the cleanup of the memory/socket better, the
change also meant fallback to file tests were slghtly different.

svn path=/icecast/trunk/icecast/; revision=9847
2005-08-25 00:07:17 +00:00
Karl Heyes
82e12b4d96 Allow for new listeners to fallback if there are max listeners on the
current mountpoint

svn path=/icecast/trunk/icecast/; revision=9833
2005-08-23 18:40:20 +00:00
Michael Smith
663bd804dc Some versions of gcc complain about the missing cast here; it's apparently
needed because some systems don't define NULL as a pointer (weird). Patch
from Moritz Grimm.


svn path=/icecast/trunk/icecast/; revision=9832
2005-08-23 10:48:09 +00:00
Karl Heyes
400d297a92 merge fix, oddcast (maybe other shoutcast source clients) don't wait for OK
response, so we may have surplus data already read, so keep it.

svn path=/icecast/trunk/icecast/; revision=9772
2005-08-18 20:37:35 +00:00
Karl Heyes
dde143d4b1 make various responses going back to the client be done via the file serving thread
svn path=/icecast/trunk/icecast/; revision=9740
2005-08-12 15:27:32 +00:00
Karl Heyes
a528108e10 merge in client timelimit, only auth_url sets this currently. Add missing
prototypes for compile warning

svn path=/icecast/trunk/icecast/; revision=9736
2005-08-12 02:40:25 +00:00
Karl Heyes
d7f1285ba2 drop the thread pool of connection threads, they were using a blocking socket
on incoming connections. Now we get the accept thread to create a client_t
and mark it as a shoutcast client if need be.  Then use a single connection
thread to poll the non-blocking sockets for the headers. When complete they
get handled as usual.

svn path=/icecast/trunk/icecast/; revision=9733
2005-08-11 23:29:58 +00:00
Karl Heyes
af9bc6bfb8 make sure we have the initial listeners stat
svn path=/icecast/trunk/icecast/; revision=9721
2005-08-09 02:55:38 +00:00
Karl Heyes
15b3a5f853 Initial auth merge. Add an auth thread (multiple threads can be done later)
which can be used to handle authentication mechanisms without taking locks
for long periods.  Non-authenticated mountpoints bypass the auth thread.

The lookup/checking of the source_t is done after the authentication succeeds
so the fallback mechanism does not affect which authenticator is used. This
can be extended to allow us to authenticate in webroot as well. XML re-read
changes will take effect immediately for new listeners but existing listeners
will use the original auth_t (refcounted) when they exit.

htpasswd access has been seperated out from auth.c, and implements an AVL
tree for a faster username lookup.  The htpasswd file timestamp is checked
just in case there are changes made externally

svn path=/icecast/trunk/icecast/; revision=9713
2005-08-07 23:01:04 +00:00
Karl Heyes
33cf86f527 merge extra checks. minor cleanup work
svn path=/icecast/trunk/icecast/; revision=9711
2005-08-07 14:50:59 +00:00
Karl Heyes
29c83ae4eb update a few stats
svn path=/icecast/trunk/icecast/; revision=9437
2005-06-11 01:24:58 +00:00
Karl Heyes
be78a3ae11 merge in fallback to file, override also works
svn path=/icecast/trunk/icecast/; revision=9434
2005-06-10 15:42:06 +00:00
Karl Heyes
05a14555d9 merge per-mount on-[dis]connect script handling
svn path=/icecast/trunk/icecast/; revision=9424
2005-06-10 00:37:09 +00:00
Karl Heyes
84a0892cff add a few more informational stats
svn path=/icecast/trunk/icecast/; revision=9423
2005-06-09 20:54:08 +00:00
Karl Heyes
39c5021b7c don't be too quick when dealing with files. allow the limited per-client
loop but don't trigger a small poll timeout

svn path=/icecast/trunk/icecast/; revision=9418
2005-06-09 13:29:11 +00:00
Karl Heyes
ad1e6c41b0 merge in the on-demand relay implementation.
svn path=/icecast/trunk/icecast/; revision=9406
2005-06-09 01:51:47 +00:00
Karl Heyes
743dbbaeca Do normal http header writing in source thread instead of the connection
thread, this will allow on-demand relays to fail and still handle the initial
listener correctly (fallback or 404 response).

svn path=/icecast/trunk/icecast/; revision=9399
2005-06-08 01:36:51 +00:00
Karl Heyes
2896db1f3c merge intro file implementation
svn path=/icecast/trunk/icecast/; revision=9345
2005-06-03 15:35:52 +00:00
Karl Heyes
72ad63f763 missed a merge for stats update for when the relay ends. The rest is minor
stuff, type check cleanup and code reduction in YP

svn path=/icecast/trunk/icecast/; revision=9331
2005-05-31 02:48:40 +00:00
Karl Heyes
79adab0133 allow for more updating over HUP. Made the YP engine only read the stats instead
of updating them, so source header parsing is done in the apply mount. Per-mount
stream settings also allow for overriding the incoming settings.

svn path=/icecast/trunk/icecast/; revision=9325
2005-05-30 14:50:57 +00:00
Karl Heyes
d57a19acac various small things. type cleanups, loop over the burst point to make sure
it is at the right point. kick off the YP 'add' 5 seconds after source startup
so that any stats are processed.

svn path=/icecast/trunk/icecast/; revision=9314
2005-05-26 03:04:48 +00:00
Karl Heyes
5b9e7f1660 use minimal stats for inactive mountpoints that have an active fallback.
svn path=/icecast/trunk/icecast/; revision=9286
2005-05-16 00:16:12 +00:00
Karl Heyes
7fadd89273 use a client function to read an incoming stream, simplifies handling within
the format specific files. Also add total read/sent stats per mountpoint.
Updates the stats every 5 secs currently

svn path=/icecast/trunk/icecast/; revision=9241
2005-05-08 13:51:05 +00:00
Karl Heyes
e2d6bdb86a add function to do mount list search (could be extended later), call it from
various places including the shoutcast source client auth which previously
only used the global source password.

svn path=/icecast/trunk/icecast/; revision=9240
2005-05-08 11:54:46 +00:00
Karl Heyes
6d48d6c4f9 Allow for specifiying a per-mount metadata interval for shoutcast style streams
svn path=/icecast/trunk/icecast/; revision=9233
2005-05-07 20:18:13 +00:00
Karl Heyes
2a2938b68b merge from branch. push clients count handling to the client_create/_destroy
functions. call client_create in the general handler and pass client_t to the
specific handler including the stats request handler, which now logs in the
access log.

svn path=/icecast/trunk/icecast/; revision=9220
2005-05-06 15:57:15 +00:00
Karl Heyes
8e99b390f2 safety check, avoid the case of a cyclic cascading fallback
svn path=/icecast/trunk/icecast/; revision=9196
2005-05-01 02:30:06 +00:00
Karl Heyes
19cb11cc31 merge in a few fixes and cleanups I've accumulated in my branch.
svn path=/icecast/trunk/icecast/; revision=9152
2005-04-18 14:32:26 +00:00
Michael Smith
d43484d49a Fix various places where "clients" stats value was decremented without having
previously been incremented. 

svn path=/icecast/trunk/icecast/; revision=9074
2005-03-14 23:07:34 +00:00
Karl Heyes
2bd23d9050 merge multi ogg codec handling. Handle theora and/or vorbis. Place new
clients before keyframe. For vorbis-only streams, perform rebuild to
flush pages more frequently and to provide url updating mechanism for
titles 

svn path=/icecast/trunk/icecast/; revision=8341
2004-12-07 21:06:26 +00:00
Karl Heyes
a521d15d74 merge per-mount hidden setting. prevent specific mountpoints being listed
on status.xsl and streamlist

svn path=/icecast/trunk/icecast/; revision=8245
2004-11-22 18:21:48 +00:00
Karl Heyes
2b4ee737db add per-mount no-yp tag handling
svn path=/icecast/trunk/icecast/; revision=8241
2004-11-21 15:51:49 +00:00
oddsock
731f24d050 handle supported content-types in a more generic way now. This will allow things like AAC, AACPlus, NSV, and others to be streamed through icecast. We have a special case for vorbis streams, and everything else falls into the generic case.
svn path=/icecast/trunk/icecast/; revision=8226
2004-11-18 23:49:59 +00:00
Karl Heyes
1e6232c531 add <shoutcast-mount>. drop the hardcoded mountpoint hacks for NSV
svn path=/icecast/trunk/icecast/; revision=8213
2004-11-17 16:02:04 +00:00
oddsock
80078cce1d * support for the Shoutcast DSP (yay!).
You can now use the Shoutcast DSP as a source client.  The connection 
    protocol is a bit odd, and we had to handle it separately, and thus 
    we've added a new config option (<shoutcast-compat>) that is set at 
    the listener port level.
* support for NSV (and the nsvscsrc source client).
    After adding support for the connection protocol of the shoutcast DSP, 
    adding NSV was just a simple of a few special handling cases.
* removed all traces of the earlier attempt at the shoutcast DSP connection 
  protocol
* Due to the growing complexity of the config files, I've also created a 
  few alternate config files, namely one for a "shoutcast compat" setup
  as well as a "minimal" one for quick basic configurations.

svn path=/icecast/trunk/icecast/; revision=8191
2004-11-11 15:47:33 +00:00
oddsock
6127fea475 * fix bug of not using url decoding value when processing audio_info string
* we now process server name and description if we are not a public stream
* Added quality to status.xsl

svn path=/icecast/trunk/icecast/; revision=8131
2004-10-29 15:31:56 +00:00
Karl Heyes
3026e1d089 small cleanups. fix buffer sizing, const and unused struct member
svn path=/icecast/trunk/icecast/; revision=8104
2004-10-26 14:21:36 +00:00
Karl Heyes
82c116a72d the check for the public stream flag wasn't working correctly in all cases
svn path=/icecast/trunk/icecast/; revision=8100
2004-10-25 20:46:12 +00:00
Karl Heyes
8aaf433aa4 add check for header when relaying from v2.0
svn path=/icecast/trunk/icecast/; revision=8098
2004-10-25 18:51:45 +00:00
Karl Heyes
7b9b8e70a3 The _inc/_dec routines can race causing incorrect values as they don't account
for unprocessed stat events.  Here I push the actual calculations to the stats
thread. The API is maintained however all stats for a specific source can be
dropped with one call now.

svn path=/icecast/trunk/icecast/; revision=8090
2004-10-25 14:03:42 +00:00
Michael Smith
b6e001ce8d When creating a source (in source_reserve), issue a warning if the mountpoint
does not start with a /, since clients will then be unable to connect to it

svn path=/icecast/trunk/icecast/; revision=7899
2004-10-01 00:42:19 +00:00
Karl Heyes
69af6210c0 small memory leak, only happened when a source exited
svn path=/icecast/trunk/icecast/; revision=7596
2004-08-20 22:55:27 +00:00
Karl Heyes
9c44a7d184 merged singleq branch 7177:7591
svn path=/icecast/trunk/icecast/; revision=7592
2004-08-20 15:13:59 +00:00
Karl Heyes
94d24f406e cleanup patch, push per client write error trap lower down
svn path=/icecast/trunk/icecast/; revision=7165
2004-07-16 15:47:12 +00:00
giles
d6d634ac02 Recommit of changes lost in the server migration
Original commit (r6810) 2004-06-04 03:15:36 -0400 (Fri, 04 Jun 2004) by msmith.

Fix #526. Fallbacks weren't being found when the primary was disconnected (for
newly-connecting clients).

svn path=/icecast/trunk/icecast/; revision=6810
2004-06-06 03:08:19 +00:00
Karl Heyes
55ba59f3f7 Update of the YP code. This should resolve several YP issues that
have been reported, the main one being icecast instability when
there is a YP server outage.


svn path=/icecast/trunk/icecast/; revision=6646
2004-05-10 16:17:56 +00:00
oddsock
d642846c80 added web based interface to htpasswd client authentication
svn path=/icecast/trunk/icecast/; revision=6610
2004-04-30 14:36:07 +00:00
oddsock
32718b5b4e new feature in icecast : burst-on-connect - allows an initial burst of data to connecting listeners, thus reducing the startup time of a stream.
svn path=/icecast/trunk/icecast/; revision=6606
2004-04-29 15:23:13 +00:00
oddsock
89f9f38d78 added HAVE_LOCALTIME_R to project file
added #define for snprintf (win32 requires _snprintf)

svn path=/icecast/trunk/icecast/; revision=6594
2004-04-25 23:28:36 +00:00
Michael Smith
5323b27c95 Couple of minor contributed patches.
- Solaris/autoconf nanosleep checking
- use time_t as appropriate for yp

svn path=/trunk/icecast/; revision=5921
2004-03-09 02:36:01 +00:00
Karl Heyes
a255c92b5f update move clients code, small cleanups in other places
svn path=/trunk/icecast/; revision=5869
2004-02-27 15:15:40 +00:00
Karl Heyes
9916341436 separate source initialisation, and collect the YP setup code into one area
svn path=/trunk/icecast/; revision=5868
2004-02-26 16:51:43 +00:00
Karl Heyes
aff756a4c7 Add per mount queue size and source timeout, which can override the
general settings.

svn path=/trunk/icecast/; revision=5867
2004-02-26 11:56:48 +00:00
Karl Heyes
7371d0ab21 move the source client '200 OK' response to the source client specific part
of the source thread, and rearrange stats around that

svn path=/trunk/icecast/; revision=5862
2004-02-25 16:24:30 +00:00
Karl Heyes
176804e436 Add accumulative stats back for source connections and don't hold locks
while writing responses back to the client.

svn path=/trunk/icecast/; revision=5853
2004-02-20 17:42:57 +00:00
Karl Heyes
466a5cb60c Make source client connections reserve the source mountpoint and get rid
of the unused source setup code.

svn path=/trunk/icecast/; revision=5846
2004-02-19 21:16:59 +00:00
Karl Heyes
ae825afd3e Make the slave thread reserve relay mountpoints, and prevent reconnection
when a relay is currently active.

svn path=/trunk/icecast/; revision=5845
2004-02-19 20:28:21 +00:00
Karl Heyes
a83553ad8f functions to allow for reserving a source_t with a mountpoint
svn path=/trunk/icecast/; revision=5844
2004-02-19 16:32:26 +00:00
Karl Heyes
ebf6603c07 small YP memory cleanup
svn path=/trunk/icecast/; revision=5842
2004-02-19 14:48:31 +00:00
Karl Heyes
66082000b4 minor cleanup
svn path=/trunk/icecast/; revision=5834
2004-02-17 15:46:05 +00:00
Karl Heyes
2accfe55e5 fix possible bad pointer reference when finding fallback mount
svn path=/trunk/icecast/; revision=5830
2004-02-17 00:09:14 +00:00
Karl Heyes
012b3f4246 YP related cleanup, avoid bad pointer reference on HUP
svn path=/trunk/icecast/; revision=5829
2004-02-16 21:59:08 +00:00
Karl Heyes
c90fb2ea55 cleanup duplicate work, fix rare but potential deadlock, and
fix silly bug introduced ealrier

svn path=/trunk/icecast/; revision=5794
2004-01-29 16:46:54 +00:00
Michael Smith
0aad6d849c Add Copyright notice to each source file, as requested by debian.
svn path=/trunk/httpp/; revision=5792
2004-01-29 01:02:12 +00:00
oddsock
610a2c022a fixed small bug where if using fallbacks and the main mount was not connected, icecast was not connecting client to the fallback mount.
svn path=/trunk/icecast/; revision=5780
2004-01-21 15:19:48 +00:00
oddsock
8a78baa149 - properly initialize the authorizer structure, otherwise by default it is enabled
- add new element (listenurl) to the stats for use in things like java player applets

svn path=/trunk/icecast/; revision=5763
2004-01-15 15:37:25 +00:00
Michael Smith
57dd5f71a5 Client authentication added.
Melanie's multilevel fallbacks added (after major changes).

svn path=/trunk/icecast/; revision=5760
2004-01-15 01:01:09 +00:00