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

289 Commits

Author SHA1 Message Date
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
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
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
a52e2e1a35 Fix: SECURITY allow global admins to access all mounts 2015-01-05 16:58:43 +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
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
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
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
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
dae5e45a25 that error is nonsense
svn path=/icecast/trunk/icecast/; revision=19371
2014-11-30 18:15:40 +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
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
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
5a8d0d1646 (sync with my branch) support vhosting on aliases
svn path=/icecast/trunk/icecast/; revision=19336
2014-11-20 18:32:14 +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
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
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
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
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
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
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
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
446053dd9a corrected some small formating errors and typos
svn path=/icecast/trunk/icecast/; revision=18131
2011-11-26 02:39:30 +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
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
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
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
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
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
89dac2e3cf minor header cleanup
svn path=/icecast/trunk/icecast/; revision=14219
2007-11-23 03:17:39 +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
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
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
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
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
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
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
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
5f8cfd70f7 const updates, no functional changes
svn path=/icecast/trunk/icecast/; revision=13559
2007-08-16 22:49:13 +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
adac7ebee4 if addresses come back as IPv4-mapped IPv6 then make it look like IPv4 or else
we'll get queries about the access log.  Fix a potential FD leak and add a
small delay into the listener thread if accept fails, the usual cause is an FD
limit being reached triggering logs to fill up and CPU to max out.


svn path=/icecast/trunk/icecast/; revision=13492
2007-08-09 03:36:03 +00:00
Karl Heyes
e663a238ee prevent race case when dealing with shoutcast style source clients and update
response headers to those clients.

svn path=/icecast/trunk/icecast/; revision=13490
2007-08-09 02:51:53 +00:00
Karl Heyes
8ec568d5b5 fix possible bad pointer dereference bug when processing new clients
svn path=/icecast/trunk/icecast/; revision=11005
2006-03-15 02:30:26 +00:00
Michael Smith
043aa0b009 Don't leak parsers when we fail to parse a shoutcast-compatible request.
svn path=/icecast/trunk/icecast/; revision=10978
2006-03-07 19:35:18 +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
Michael Smith
37a6bb18d6 Patch from gtgbr@gmx.net to fix (void) function prototypes, with some minor
changes.


svn path=/icecast/trunk/icecast/; revision=10615
2005-12-17 12:23:09 +00:00
Karl Heyes
11c6e1039c change status code for server/stream full cases (#738), also some others places
where connections are terminated.

svn path=/icecast/trunk/icecast/; revision=10393
2005-11-17 00:54:28 +00:00
Karl Heyes
24a24d8df0 add hack for nsvcap, apparently EOL is 3 chars
svn path=/icecast/trunk/icecast/; revision=10110
2005-10-01 14:08:36 +00:00
Karl Heyes
f869415cf7 Fix a bug where a shoutcast source client (nsvtools) does not wait for the
OK response. Icecast was dropping the connection preventing the stream

svn path=/icecast/trunk/icecast/; revision=10076
2005-09-26 16:34:51 +00:00
Karl Heyes
7cad0b70d6 do proper cleanup on odd cases of source client startup, also take mutex
lock for client_create at relay startup to prevent race

svn path=/icecast/trunk/icecast/; revision=10004
2005-09-08 13:32:17 +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
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
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
c7e04b2852 allow for webroot requests to be sent via an authenticator
svn path=/icecast/trunk/icecast/; revision=9717
2005-08-08 18:39:34 +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
e9adc91bee make admin and web root pages use file serving thread to send back responses
svn path=/icecast/trunk/icecast/; revision=9464
2005-06-18 10:54:53 +00:00
Karl Heyes
4f4e7be98f push HTTP header writing for file download into file serving thread to prevent
stalls in connection thread.  perform most file checking in fserve but allow
for m3u file override and using the Host header if available.

svn path=/icecast/trunk/icecast/; revision=9462
2005-06-17 22:55: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
84a0892cff add a few more informational stats
svn path=/icecast/trunk/icecast/; revision=9423
2005-06-09 20:54:08 +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
f1d39a8788 send response header to stats client
svn path=/icecast/trunk/icecast/; revision=9330
2005-05-31 02:40:23 +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
018fff1158 Allow for username to be stated for master/slave setups, we still default
to 'relay' though

svn path=/icecast/trunk/icecast/; revision=9274
2005-05-13 00:35:08 +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
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
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
889e260490 allow for shoutcast metadata updates to auth with admin/per-mount/global
source password

svn path=/icecast/trunk/icecast/; revision=8232
2004-11-19 15:05:36 +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
Karl Heyes
17c178555f correct type for volatile usage and uncomment log message for stats updating
svn path=/icecast/trunk/icecast/; revision=8123
2004-10-27 14:13:29 +00:00
Karl Heyes
9652319c38 An alias could disappear from under us, so copy the string
svn path=/icecast/trunk/icecast/; revision=8108
2004-10-26 19:29:12 +00:00
Karl Heyes
7eed9c793b small updates. reject source client with invalid mountpoint, avoid aliasing
issues with queue and id, and change handler to avoid leaving clients on the
connection queue (rare)

svn path=/icecast/trunk/icecast/; revision=8107
2004-10-26 16:31:16 +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
oddsock
ebecd7cb0a fix m3u generation logic that was not working for static files
svn path=/icecast/trunk/icecast/; revision=7439
2004-07-31 22:25:07 +00:00
oddsock
56cd1de3c5 added ability to disallow concurrent connections from the same username if using htpasswd listener authentication.
svn path=/icecast/trunk/icecast/; revision=6711
2004-05-17 04:33:46 +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
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
6d969934f5 Add checks for whether a source is active
svn path=/trunk/icecast/; revision=5843
2004-02-19 15:24:06 +00:00
Karl Heyes
d7dc5d327c minor cleanup
svn path=/trunk/icecast/; revision=5795
2004-01-29 23:23:53 +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
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
oddsock
e8a61ce5d3 fixed master-slave relaying...
* slaves now ask for /admin/streamlist.txt which serves a plaintext version of the source list (this is what it was expecting to get)
* /admin/streamlist still serves XML (which slave.c wasn't expecting)
* fixed a few cases of pointer invalidation due to possible config re-reading.
* slave relay now uses relay password to get the list of streams to relay

svn path=/trunk/icecast/; revision=5695
2003-12-12 23:06:44 +00:00
Karl Heyes
b795bb58dc cleanup bad pointer access after config re-read
svn path=/trunk/icecast/; revision=5673
2003-12-01 17:18:37 +00:00
Karl Heyes
0c6493aa6d place the config reread flag in the global structure
svn path=/trunk/icecast/; revision=5175
2003-07-25 14:29:33 +00:00
Karl Heyes
9482db6016 avoid hitting the mutex's in the signal handler, we could block, which is
not something we want to do. Some mutex implementations are signal based.

svn path=/trunk/icecast/; revision=5174
2003-07-24 23:45:29 +00:00
Karl Heyes
8654a18f72 minor cleanups
svn path=/trunk/icecast/; revision=5168
2003-07-23 00:27:10 +00:00
Karl Heyes
43953202a2 refer to cfgfile.h instead of config.h for icecast.xml, and use config.h
for autoconf

svn path=/trunk/icecast/; revision=5156
2003-07-21 01:58:54 +00:00
Karl Heyes
508d25641d avoid header namespace clashes
svn path=/trunk/icecast/; revision=5146
2003-07-16 19:41:59 +00:00
brendan
004152cf7a Write a newline after the m3u entry (patch by Paul Bryan).
svn path=/trunk/icecast/; revision=5067
2003-07-05 06:36:16 +00:00
Karl Heyes
f2e1bc2419 handle error returned from listening sockets, can cause busy looping
svn path=/trunk/icecast/; revision=4986
2003-06-20 18:50:24 +00:00
oddsock
a8d602fe33 fixed check for regular file type in win32-specific code
svn path=/trunk/icecast/; revision=4879
2003-06-05 04:15:58 +00:00
oddsock
8f84c0188a some win32-isms
and a bad free that valgrind yelled at me about

svn path=/trunk/icecast/; revision=4711
2003-05-15 23:19:57 +00:00
Michael Smith
8527ed7b43 Implementation of aliases contributed by Paul Donohue <icecast@TopQuark.net>
svn path=/trunk/icecast/; revision=4629
2003-04-23 12:44:29 +00:00
Michael Smith
5c5155b8d9 Only consider a path a candidate for file-serving if it exists AND is a normal
file (not a directory, etc.)

svn path=/trunk/icecast/; revision=4616
2003-04-18 14:59:26 +00:00
brendan
8651aabcbb First crack at making YP/curl optional.
svn path=/trunk/icecast/; revision=4552
2003-03-27 17:10:14 +00:00
Michael Smith
3b2df1d0d9 Brendan was getting pissed off about inconsistent indentation styles.
Convert all tabs to 4 spaces. All code must now use 4 space indents.

svn path=/trunk/avl/; revision=4492
2003-03-15 02:10:19 +00:00
brendan
1198cbb982 Typo (no sleeping between select()s waiting for connections)
svn path=/trunk/icecast/; revision=4478
2003-03-12 05:40:45 +00:00
Michael Smith
596922217b Fix relay stream listing. Remove seperate relay password, there's no
need for it.

svn path=/trunk/icecast/; revision=4464
2003-03-10 22:20:16 +00:00
Michael Smith
eba22526aa Support listening on multiple sockets.
svn path=/trunk/icecast/; revision=4454
2003-03-09 11:27:06 +00:00
Michael Smith
a3716577ec Check the right variable for password in icy logins
svn path=/trunk/icecast/; revision=4447
2003-03-08 05:38:52 +00:00
Michael Smith
e921a67bd1 create /icy_0 (and incrementing numbers) for incoming icy protocol connections
if the / mountpoint is taken

svn path=/trunk/icecast/; revision=4445
2003-03-08 05:02:13 +00:00
Michael Smith
b2b618c62f Added support for shoutcast login protocol (ewww...)
svn path=/trunk/httpp/; revision=4444
2003-03-08 04:57:02 +00:00
Michael Smith
f8783aedac Check admin password against the correct username
svn path=/trunk/icecast/; revision=4416
2003-03-06 14:46:33 +00:00
Michael Smith
a79f0b6cae Split admin stuff out into a seperate file, add various utility functions there.
rename util_url_escape to util_url_unescape, and write a util_escape function
that actually DOES escape things. Fix all the callers of the function to call
the correct one of these two.

svn path=/trunk/icecast/; revision=4414
2003-03-06 14:17:33 +00:00
Michael Smith
d13ebde7a3 Allow rereading config files.
Lots of new locking happening so that it's safe to have the config file
disappear under the rest of the program

Does NOT affect currently-running sources at the moment

svn path=/trunk/icecast/; revision=4406
2003-03-05 13:03:35 +00:00
Michael Smith
5252a14068 Fix various minor bugs in per-mountpoint configs.
svn path=/trunk/icecast/; revision=4385
2003-03-02 10:36:24 +00:00
Michael Smith
c359faf1de More features:
-- per mountpoint listener maxima
  -- static configuration of mountpoint fallbacks
  -- stream dumping (write incoming stream to disk)

Fixed some warnings that other people introduced.

svn path=/trunk/icecast/; revision=4383
2003-03-02 10:13:59 +00:00
Michael Smith
5019130d27 Max queue length for clients is now
a) based on total bytes in queue, not total number of buffers in queue
    b) configurable (defaults to 100 kB)

mp3 metadata relaying (inline). Untested.

svn path=/trunk/icecast/; revision=4364
2003-02-24 13:37:15 +00:00
Michael Smith
8c14c0e0db Oops. Very broken password checking, fix from Karl Heyes.
svn path=/trunk/icecast/; revision=4358
2003-02-20 22:18:24 +00:00
Michael Smith
83b41e2beb Fix previous changes to source creation - misunderstood requirements for
unlocking rwlocks. Move more checks and some other logic into source.c

svn path=/trunk/icecast/; revision=4354
2003-02-17 13:01:37 +00:00
Michael Smith
76fc62810e Fix a serious bug with source creation in relays when local-mount != mount,
and fix a series of locking bugs in source creation.

svn path=/trunk/icecast/; revision=4352
2003-02-17 11:56:12 +00:00
Michael Smith
1644a6f718 Fix incorrect use of enum that was leading to crashes on source connect for
unknown mimetype.

svn path=/trunk/icecast/; revision=4344
2003-02-14 10:31:21 +00:00
Michael Smith
b6c18398cd Better IPv6 support. Hopefully logging will work correctly now.
However, some things still won't work, notably relaying (the relay can be
ipv6, the server being relayed _from_ may not be).
I'll fix that some time soon.

svn path=/trunk/icecast/; revision=4342
2003-02-13 11:29:07 +00:00
Michael Smith
38e3bfb88f Increase buffer size for IPs so that logging works better for v6 clients.
svn path=/trunk/icecast/; revision=4341
2003-02-12 22:50:59 +00:00
Michael Smith
9acef4801e Per mountpoint usernames, passwords, and some infrastructure for other
per-mountpoint configuration (some of these are given as examples in
the config file, but they aren't yet used).

svn path=/trunk/icecast/; revision=4338
2003-02-11 14:23:34 +00:00
Michael Smith
248a0874a4 Grumble. Silly gcc.
svn path=/trunk/icecast/; revision=4331
2003-02-07 13:56:33 +00:00
Michael Smith
037789bc1a Add format detection workaround for icecast 1.x, which is buggy and doesn't
send a content-type header.

svn path=/trunk/icecast/; revision=4329
2003-02-07 11:56:40 +00:00
Michael Smith
9e168dc870 Lots of fixes for screwy code formatting, plus:
make streams public by default, send ice-private: 1 to make them private.
However, default config file has yp servers commented out.

A little fix for compilation on some solaris systems

Redo some config file stuff: now all the passwords are inside an element
<authentication>, (though for now they're also accepted in the old location),
and added admin username and password. Move some of the admin activities over
to using the admin passwords (admin action that affect a mountpoint use the
source password)

Fill in some (but not yet all, maybe i'll do that later) of the infrastructure
for per-mountpoint passwords.

Fix lots of headers/code so that it works properly/portably  on non-win32
systems.

svn path=/trunk/icecast/; revision=4325
2003-02-06 13:10:48 +00:00
oddsock
e07080a0d8 added references to geturl.h
svn path=/trunk/icecast/; revision=4314
2003-02-02 14:33:47 +00:00
Michael Smith
6f1f4072af Fix segfault if current source didn't exist on fallback mount request.
svn path=/trunk/icecast/; revision=4292
2003-01-23 11:12:54 +00:00
Michael Smith
1fb972cf89 And some more message fixes (this and the previous from alet@librelogiciel.com (Jerome Alet)
svn path=/trunk/icecast/; revision=4262
2003-01-18 07:39:29 +00:00
Michael Smith
6d4ef5e519 Fix a message that was talking about the wrong path
svn path=/trunk/icecast/; revision=4261
2003-01-18 07:38:18 +00:00