paraslash.git
13 years agoNEWS update.
Andre Noll [Wed, 23 Jun 2010 18:56:07 +0000 (20:56 +0200)]
NEWS update.

13 years agoMerge branch 't/dccp_fec'
Andre Noll [Wed, 23 Jun 2010 18:55:08 +0000 (20:55 +0200)]
Merge branch 't/dccp_fec'

13 years agoweb: Mention the new What's cooking page.
Andre Noll [Wed, 23 Jun 2010 16:05:53 +0000 (18:05 +0200)]
web: Mention the new What's cooking page.

13 years agoNEWS: Remove header.
Andre Noll [Wed, 23 Jun 2010 14:36:12 +0000 (16:36 +0200)]
NEWS: Remove header.

The "NEWS" header is now automatically generated by the scripts that
run grutatxt on the NEWS file and insert the "What's cooking" link.

13 years agoMakefile: Remove oggdec_filter from $all_ggos.
Andre Noll [Wed, 23 Jun 2010 14:34:05 +0000 (16:34 +0200)]
Makefile: Remove oggdec_filter from $all_ggos.

This should have been removed already in the previous patch. With
oggdec_filter still present in $all_ggos, the "tarball" target
can not be made.

13 years agofec: make max_slice_size optional
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
fec: make max_slice_size optional

The default max_slice_size for FEC is the MTU. This patch changes the parser
to make the specification of the max_slice_size optional (for cases using a
slice size less than the MTU).

Other changes:
 * added udp sender help documentation;
 * simplified parse_fec_url() (no additional strlen() needed).

13 years agosender: miscellaneous cleanups
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
sender: miscellaneous cleanups

This collects various minor syntactical changes into a single patch:
 * replace indirection 'ut->sc->xxx' by 'sc->xxx' where possible;
 * more elegant way of duplicating sc->name string;
 * udp_delete_target() now takes sender_client as argument;
 * added IPv4-address:port example for udp_help();
 * revised the definition of E_ADDRESS_LOOKUP (it means what it says)
   and replaced two inappropriate uses by assert(): in each case this
   error value was used to point to an unsupported adress family. But
   since the only supported network protocol is IP, if the case happens,
   it means a bug and should be marked as such.
--
 error.h       |    2 -
 para_audioc   |binary
 error.h       |    2 -
 send_common.c |    2 -
 udp_recv.c    |    4 ---
 udp_send.c    |   64 +++++++++++++++++++++++++++++-----------------------------
 4 files changed, 35 insertions(+), 37 deletions(-)

13 years agoudp: refuse to add the same target twice
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: refuse to add the same target twice

Based on the preceding patches, this turns the UDP targets list into a set.

13 years agoudp: transition to use sender_client 'name' field
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: transition to use sender_client 'name' field

This replaces all occurrences of ut->host/ut->port in the UDP sender with a
'canonical' socket name contained in the embedded sender_client struct.

This field is filled in as soon as the target is added and persists across
shutting down / restarting it.

The host/port fields are now obsolete, thus removed.

13 years agoudp: integrate resolve hook
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: integrate resolve hook

This integrates the new resolve hook into the UDP sender; exploiting the
invariant that the 'port' of sender_command_data structure is now always set.

It further reuses the new resolve_target() function for the pre-configured
sender targets. This is necessary to unify the syntax (otherwise the
server.conf would have to be limited to IP-addresses only), and allows to
use hostnames in the server configuration file.

The worst case that can here be anticipated is that unresolvable targets are
specified in server.conf. In this case the server hangs for circa 20 seconds
per unresolvable target, and then concludes with error messages such as:

 (8355) init_vss_task: initializing udp sender
 ...
 (8355) udp_add_target: adding to target list (10.0.0.2:8000)
 (8355) makesock: can not resolve UDP address funzt.net#8000: Name or service not known.
 (8355) udp_init_target_list: not adding requested target 'funzt.net'
 (8355) makesock: can not resolve UDP address funzt.also.net#8000: Name or service not known.
 (8355) udp_init_target_list: not adding requested target 'funzt.also.net'
 (8355) udp_send_init: udp sender init complete

13 years agosender: add a hook to resolve target names
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
sender: add a hook to resolve target names

This adds a function pointer to interpret and resolve a given URL string in
a target-specific manner, filling in the target's defaults if omitted.

The hook is used for the add/delete commands, currently implemented for UDP.

13 years agonet: host/port string convention
Gerrit Renker [Sun, 13 Jun 2010 09:30:46 +0000 (11:30 +0200)]
net: host/port string convention

This updates the implementation of host_and_port() in such a way that its
output can again be used as input of parse_url():

 * the separator for host and port is now ':' instead of '#';
 * port numbers (services) are now always represented as numbers
   (reverting an earlier change);
 * IPv6 addresses are enclosed in square brackets.

This convention makes it easier to copy&paste output from paraslash commands
(including scripting), and to store target information in a format that is
easy to resolve/reuse at a later stage.

13 years agoRemove oggdec_filter.ggo.
Andre Noll [Tue, 22 Jun 2010 20:25:44 +0000 (22:25 +0200)]
Remove oggdec_filter.ggo.

The two options are no longer used.

13 years agoMake new dccp FEC parameters optional.
Andre Noll [Sat, 19 Jun 2010 18:58:32 +0000 (20:58 +0200)]
Make new dccp FEC parameters optional.

Defaults should do for most scenarios.

13 years agoReduce decoder latency.
Andre Noll [Fri, 18 Jun 2010 20:46:22 +0000 (22:46 +0200)]
Reduce decoder latency.

If large/many FEC slices are used, the decoder gets large amounts of
data in one chunk. Currently it decodes as much as it can which may
take several 100 milliseconds on slow machines -- enough to cause
buffer underruns for the alsa writer.

This patch teaches the decoders to convert only a small amount of data
in one go in order to give the other buffer tree nodes a chance to run.

13 years agodccp_send: Add command line options for FEC parameters.
Andre Noll [Fri, 18 Jun 2010 08:40:06 +0000 (10:40 +0200)]
dccp_send: Add command line options for FEC parameters.

ATM, these are hardcoded as MPS/3/4. This patch allows to impose
an upper bound on the slice size and to change the number of (data)
slices of a FEC group.

13 years agosched: Add debug mode.
Andre Noll [Wed, 16 Jun 2010 20:39:57 +0000 (22:39 +0200)]
sched: Add debug mode.

This adds the compile-time switch SCHED_DEBUG to activate debug
mode for the scheduler. If activated, it measures the time spent in
each post_select() function and prints warning messages if this time
interval is too large.

This patch has no effect if SCHED_DEBUG is not set.

13 years agoPrint a log message if the sender command fails.
Andre Noll [Mon, 14 Jun 2010 15:09:04 +0000 (17:09 +0200)]
Print a log message if the sender command fails.

Currently there is no infrastructure for passing down a value from vss,
which runs in parent context, to the child process. In particular,
we can not pass the return value of the sender subcommand handlers
to com_sender() to propagate it to the client.

However, we may easily write a log message that explains the cause
of the error, which is not optimal, but better than nothing.

Thanks to Gerrit Renker who pointed out this flaw.

13 years agoudp_send: add a time window for errors
Gerrit Renker [Sun, 30 May 2010 16:10:42 +0000 (18:10 +0200)]
udp_send: add a time window for errors

This implements a grace period during which ICMP Destination Unreachable /
Port Unreachable are ignored from the peer, with the purpose of catching
 * synchronisation problems (e.g., receiver started after sender);
 * unforeseen events (e.g. delays, reboot, reconfiguration).

To avoid receiving persistent errors from unicast UDP clients, two time
windows are used:
 (a) The 'error-allowed' period t_A
     This time window starts when the first ECONNREFUSED error is seen
     and ends after t_A seconds. The value of t_A is a guess which should
     cover the expected time needed to sort any receiver problems out.
 (b) The 'error-free' period t_B
     During the t_B seconds following the interval t_A, no further
     connection errors are accepted; if an ECONNREFUSED is seen it
     will cause the target to be evicted from the list.

This windowing process restarts itself, i.e. the first error seen after
t_A+t_B will reset the counters.

The following examples illustrate the algorithm, where 'x' indicates
receipt of an ICMP error message.

 1) Some errors received during initial receiver setup

    |-x-x-x-x-x-x-x--|------------|------....
    |
    t_0              t_0 + t_A    t_0+t_A+t_B

    Since no errors are received after t_0 + t_A, no action will be taken.

 2) Persistent errors

    |-x-x-x-x-x-x-x-x|-x-x-x-x-x-x|
    |
    t_0              t_0 + t_A    t_0+t_A+t_B

    The first error received after t_0+t_A evicts the target.

 3) Recurring short errors

    |-x-x-x-x-x-x-x--|-//--|--------//---|-x-x-x-x-x-x-x--|------------|---...
    |
    t_0                    t_0+t_A+t_B   t_1              t_1+t_A      t_1+t_A+t_B

    Here the counter is reset at the first error after t_1. Since no more errors
    were seen after t_1+t_A, streaming continues.

For simplicity, the implementation uses t_A = t_B = 30 seconds.

The behaviour with an unavailable receiver is now:
May 24 18:08:16 (0) (2702) vss_send: sending 123:0 (548 bytes)
May 24 18:08:18 (0) (2702) vss_send: sending 132:2 (548 bytes)
May 24 18:08:18 (2) (2702) udp_check_socket_state: Evicting 10.0.0.2#8000 after 31 seconds of connection errors.

May 24 19:34:55 (0) (2702) vss_send: sending 5:14 (1232 bytes)
May 24 19:35:10 (0) (2702) vss_send: sending 11:3 (1232 bytes)
May 24 19:35:10 (2) (2702) udp_check_socket_state: Evicting 3ffe::2#8000 after 31 seconds of connection errors.

13 years agoudp: initialize common structure only once
Gerrit Renker [Sun, 30 May 2010 16:06:33 +0000 (18:06 +0200)]
udp: initialize common structure only once

When temporarily closing the UDP stream (e.g. due to 'next' or 'ff'
command), the UDP file descriptor need not be closed.  Hence this
patch moves its initialization into the add_target() function.

The patch also factors global variables out of mcast_sender_setup() function.

13 years agoudp_send: Do not send the current chunk if queue is not empty.
Andre Noll [Sun, 23 May 2010 16:58:22 +0000 (18:58 +0200)]
udp_send: Do not send the current chunk if queue is not empty.

In this case we have enqueued other data _and_ the current chunk already.

13 years agoMove send_chunk() from send_common.c to http_send.c.
Andre Noll [Sun, 23 May 2010 06:42:04 +0000 (08:42 +0200)]
Move send_chunk() from send_common.c to http_send.c.

Due to the previous changes, this function is no longer a generic function
as it is only used by the http sender. So move it to http_send.c and make it static,
along with the queue_chunk_or_shutdown() helper which is only called from
send_chunk().

13 years agocleanup: remove redundant 'max length' argument
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
cleanup: remove redundant 'max length' argument

This removes the redundant 'max_size_bytes' argument of
 * write_nonblocking(),
 * send_queued_chunks(), and
 * send_chunk(),
since it was set to 0 in all cases.

13 years agoudp_send: send data in MMS-sized chunks
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
udp_send: send data in MMS-sized chunks

This determines the Maximum Message Size for the UDPv4/v6 layer; using
the earlier functions. The outcome is used to set the FEC slice size,
initialisation of the UDP client has also been moved to the init_fec()
function.

13 years agodccp_send: send data in MPS-sized chunks
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
dccp_send: send data in MPS-sized chunks

As mandated by RFC 4340, 14., DCCP maintains an internal variable called
'Maximum Packet Size', which can be queried via the DCCP_SOCKOPT_GET_CUR_MPS
socket option. This option has been available since 2007-10-04 (v2.6.23)
and is documented in Documentation/networking/dccp.txt.

The Maximum Packet Size takes into account the path MTU, size of headers and
the estimated overhead for DCCP options. The following table shows various
values that were determined experimentally between two hosts:

     +----------+------------+--------------+--------------------+
     | Medium   | IP version | MTU in bytes | Resulting DCCP MPS |
     +----------+------------+--------------+--------------------+
     | Ethernet |    IPv4    |     1500     |     1424 bytes     |
     | Ethernet |    IPv6    |     1500     |     1404 bytes     |
     +----------+------------+--------------+--------------------+
     | WiFi     |    IPv4    |      576     |      500 bytes     |
     | WiFi     |    IPv4    |     1280     |     1204 bytes     |
     | WiFi     |    IPv4    |     1500     |     1424 bytes     |
     | WiFi (a) |    IPv4    |     2048     |     1972 bytes     |
     +----------+------------+--------------+--------------------+
     | WiFi     |    IPv6    |      576     |      see (b)       |
     | WiFi     |    IPv6    |     1280     |     1184 bytes     |
     | WiFi     |    IPv6    |     1500     |     1404 bytes     |
     | WiFi (a) |    IPv6    |     2048     |     1952 bytes     |
     +----------+------------+--------------+--------------------+

Notes:
 (a) WiFi normally uses Ethernet MTU of 1500 bytes, but the medium
     supports a much larger MTU (Fragmentation threshold) of up to
     about 2300 bytes (system used 802.11g).
 (b) 576 byte MTU not tested for IPv6 since IPv6 mandates a minimum
     MTU of 1280 bytes, as per RFC 2460 section 5 (also RFC 5405, 3.2).

The patch implements the dccp init_fec() function based on the DCCP MPS.

13 years agonet: generic code to query the maximum message size
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
net: generic code to query the maximum message size

This adds a fallback routine to determine the address-family specific maximum
message size (MMS). This value is an over-estimation of the maximum payload
size that the network layer can take, i.e. it returns the maximum size for
transport-layer header and transport-layer payload.

13 years agosender: clean up old FEC API
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
sender: clean up old FEC API

After the preceding two patches integrated the new function pointers, this
patch removes the now obsolete open() and send_fec() pointers which are no
longer referenced anywhere. It also reorders send.h to get rid of forward
declarations.

13 years agoudp: integrate new fec interaction
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
udp: integrate new fec interaction

This patch implements the new UDP-FEC interface in two steps:
 (1) updating the UDP sender analogously to the previous (DCCP sender) patch;
 (2) unifying the struct udp_target by factoring out the fields it has in
     common with 'struct sender_client'.

The open() function is deferred to a subsequent patch. The user can override
the MPS value by supplying a max_slice_bytes value not larger than the MPS.

13 years agodccp: integrate new fec interaction
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
dccp: integrate new fec interaction

This updates the DCCP sender code to access and initialize the new fec_client
structs.

Particulars:
 * the open() method has been removed, to be supplied in a later patch;
 * the sender_client field became redundant, it is now available as fc->sc.

13 years agovss: add state variable for fec client
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
vss: add state variable for fec client

This merges the two boolean/integer members 'error' and 'ready' into a
single state variable with the same effect:
 * the specific value of 'error' was not evaluated within vss.c,
   where error < 0 used to disable the fec_client;
 * the ready/and error states are mutually exclusive;
 * the assertion that compute_next_fec_slice() is not called when
   the fec_client is disabled has been removed, since this function is only
   called from vss_send(), which ensures that this condition holds;
 * likewise, vss_playing() holds in compute_slice_timeout() since
   this condition is tested earlier in the caller vss_compute_timeout().

13 years agovss: unify calls to the FEC layer
Gerrit Renker [Sun, 23 May 2010 05:43:03 +0000 (07:43 +0200)]
vss: unify calls to the FEC layer

This reorganizes the internal vss data structures a bit to unify calls to the
FEC layer across different senders:
 * each sender supplies its sender_client data via the 'sc' pointer;
 * the init_fec()/send_fec() function pointers are now parameters
   (so that a global variable is not needed);
 * both these functions then operate on the supplied sender_client data;
 * the transport layer can then interpret the sender_client data in
   specific ways, e.g. by accessing sc->private_data;
 * a new 'ready' flag has been added to track transport-layer state;
 * max_slice_size as paramter has been restored (for overriding MPS value).

Note: this is one patch out of several. It comments out now-incompatible
      changes in the API for the sake of being able to compile. However,
      the new global API requires the whole set of patches to be applied.

13 years agoBasic infrastructure changes for FEC/DCCP support.
Andre Noll [Tue, 27 Apr 2010 19:43:19 +0000 (21:43 +0200)]
Basic infrastructure changes for FEC/DCCP support.

This patch allows to add a FEC client without specifying the FEC
parameters. Instead, these parameters are set at stream start time
via the new ->open() method of the senders.

It is desirable to defer ssetting the FEC parameters to allow dynamic
determination of the slice size. We need an established connection
to find out the best value for the slice size, but the UDP sender
currently has to fix the slice size at target add time, which is
too early.

The slice size for the UDP and the DCCP sender are currently hardcoded
values; this will be fixed by subsequent patches.

13 years agoMerge remote branch 'meins/master'
Andre Noll [Mon, 7 Jun 2010 08:16:41 +0000 (10:16 +0200)]
Merge remote branch 'meins/master'

13 years agoFix paraslash.ico.
Andre Noll [Fri, 21 May 2010 17:16:22 +0000 (19:16 +0200)]
Fix paraslash.ico.

Somehow this broke quite some time ago. The command

convert -colors 16 paraslash.png paraslash.ico

converts the png to an .ico File that is displayed nicely at least
with firefox. Of course, this should be generated on the fly, but
for now it's simpler to just check it in.

13 years agoMerge branch 'maint'
Andre Noll [Sun, 6 Jun 2010 16:35:47 +0000 (18:35 +0200)]
Merge branch 'maint'

Conflicts:
gui.c

13 years agogui: Avoid busy loop if audiod is down.
Andre Noll [Sun, 6 Jun 2010 16:32:11 +0000 (18:32 +0200)]
gui: Avoid busy loop if audiod is down.

The old approach to sleep one second is not sufficient and might still lead
to a busy loop as the call to sleep() might be interrupted by SIGCHILD.

So check the return value of sleep() and sleep again if it is not zero.

13 years agoMerge commit 'meins/master'
Andre Noll [Tue, 25 May 2010 07:23:44 +0000 (09:23 +0200)]
Merge commit 'meins/master'

13 years agofecdec_filter: Detect and ingore duplicate slices.
Andre Noll [Sun, 23 May 2010 17:21:02 +0000 (19:21 +0200)]
fecdec_filter: Detect and ingore duplicate slices.

This introduces a bit array to keep track of the slices of a FEC group
that have been received so far. This allows to quickly look up whether
the current slice is already present in the FEC group, in which case we
simply ignore it.

This avoids errors of the kind

unregister_task: unregistering fecdec (slot 0) (invalid index vector)

which have been observed with the UDP transport.

The patch also cleans up add_slice() a bit: It replaces the calls to para_malloc()
and memset() by a simple call to para_calloc() and initializes slice_num earlier
so that it can be used throughout the function.

13 years agofecdec_filter: Simplify clear_group().
Andre Noll [Sun, 23 May 2010 17:02:06 +0000 (19:02 +0200)]
fecdec_filter: Simplify clear_group().

There is no point in invalidating the index and data pointers if we are about
to free them anyway.  So just set the whole thing to zero. This is easier and
does not require modifications if struct fecdec_group changes.

13 years agoMerge branch 'maint'
Andre Noll [Sun, 23 May 2010 06:34:56 +0000 (08:34 +0200)]
Merge branch 'maint'

13 years agostring: constant value
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
string: constant value

This replaces the LLONG_MAX constant with the value stolen
from limits.h (that value is only accessible when using
-std=c99). The value of 2^63-1 assumes 64-bit and can also
be computed as (1ULL << (sizeof(long long) * 8 - 1)) - 1).

13 years agoFix paraslash.ico.
Andre Noll [Fri, 21 May 2010 17:16:22 +0000 (19:16 +0200)]
Fix paraslash.ico.

Somehow this broke quite some time ago. The command

convert -colors 16 paraslash.png paraslash.ico

converts the png to an .ico File that is displayed nicely at least
with firefox. Of course, this should be generated on the fly, but
for now it's simpler to just check it in.

13 years agobash_completion: Fix sender completion.
Andre Noll [Wed, 19 May 2010 05:14:35 +0000 (07:14 +0200)]
bash_completion: Fix sender completion.

Commit 6d1b1feadb2e7221874b7be205c51e0fe56d0519 changed the output of
the si command but missed to update the completion script accordingly.

13 years agoMerge remote branch 'fml/master'
Andre Noll [Thu, 13 May 2010 18:13:02 +0000 (20:13 +0200)]
Merge remote branch 'fml/master'

13 years agoNEWS update.
Andre Noll [Thu, 13 May 2010 11:11:59 +0000 (13:11 +0200)]
NEWS update.

13 years agoMerge branch 't/nonblock_api'
Andre Noll [Thu, 13 May 2010 11:08:59 +0000 (13:08 +0200)]
Merge branch 't/nonblock_api'

13 years agoNEWS update.
Andre Noll [Thu, 13 May 2010 11:03:30 +0000 (13:03 +0200)]
NEWS update.

13 years agoMerge branch 't/doc'
Andre Noll [Thu, 13 May 2010 11:02:15 +0000 (13:02 +0200)]
Merge branch 't/doc'

13 years agoMerge branch 'maint'
Andre Noll [Wed, 12 May 2010 22:37:37 +0000 (00:37 +0200)]
Merge branch 'maint'

13 years agooss: Fix double free bug on open failure.
Andre Noll [Wed, 12 May 2010 21:22:37 +0000 (23:22 +0200)]
oss: Fix double free bug on open failure.

If setting the oss parameters (sample format, sample rate, channel
count) fails, we end up freeing the private_oss_data struct twice.

13 years agoRC4: Allocate 8 extra bytes for send buffer.
Andre Noll [Tue, 11 May 2010 07:00:29 +0000 (09:00 +0200)]
RC4: Allocate 8 extra bytes for send buffer.

valgrind on Mac OS complains. Apparently openssl writes some bytes
more than the length of the output buffer.

13 years agoAdd doxygen comments for rfds parameters.
Andre Noll [Sun, 9 May 2010 15:12:30 +0000 (17:12 +0200)]
Add doxygen comments for rfds parameters.

13 years agomanual.m4: Fix a typo.
Andre Noll [Thu, 6 May 2010 07:03:19 +0000 (09:03 +0200)]
manual.m4: Fix a typo.

13 years agoNEWS update.
Andre Noll [Thu, 6 May 2010 05:49:11 +0000 (07:49 +0200)]
NEWS update.

13 years agovss: Don't treat EAGAIN as an error when reading from the afs pipe.
Andre Noll [Thu, 6 May 2010 05:48:44 +0000 (07:48 +0200)]
vss: Don't treat EAGAIN as an error when reading from the afs pipe.

13 years agogui: Combine open_stat_pipe() and para_open_stat_pipe().
Andre Noll [Thu, 6 May 2010 05:06:42 +0000 (07:06 +0200)]
gui: Combine open_stat_pipe() and para_open_stat_pipe().

It is kind of pointless to have two functions for this. It was justified in the long ago
when para_sdl_gui executed the same command.

13 years agogui: Rename audiod_pipe to stat_pipe.
Andre Noll [Thu, 6 May 2010 04:57:46 +0000 (06:57 +0200)]
gui: Rename audiod_pipe to stat_pipe.

It is not always an audiod command that is executed.

13 years agogui: Use nonblock API for command and audiod pipe.
Andre Noll [Thu, 6 May 2010 04:48:45 +0000 (06:48 +0200)]
gui: Use nonblock API for command and audiod pipe.

This gets rid of another two calls to the unreliable FD_ISSET().

13 years agoThe new comprehensive paraslash user manual.
Andre Noll [Mon, 3 May 2010 13:07:09 +0000 (15:07 +0200)]
The new comprehensive paraslash user manual.

13 years agoAvoid the word "filter chain".
Andre Noll [Mon, 3 May 2010 00:05:11 +0000 (02:05 +0200)]
Avoid the word "filter chain".

"Filter configuration" is more to the point.

13 years agomood: make reload_current_mood() static.
Andre Noll [Mon, 3 May 2010 00:03:43 +0000 (02:03 +0200)]
mood: make reload_current_mood() static.

13 years agofilter: Clarify help text of --no-default-filters.
Andre Noll [Mon, 3 May 2010 00:03:00 +0000 (02:03 +0200)]
filter: Clarify help text of --no-default-filters.

13 years agobtr: Remove unused btr_exec().
Andre Noll [Mon, 3 May 2010 00:01:08 +0000 (02:01 +0200)]
btr: Remove unused btr_exec().

13 years agoRemove man page of para_fsck from web pages.
Andre Noll [Sun, 2 May 2010 20:18:30 +0000 (22:18 +0200)]
Remove man page of para_fsck from web pages.

para_fsck has long been replaced by oslfsck.

13 years agohttp_recv: Switch to nonblock API.
Andre Noll [Sun, 25 Apr 2010 18:21:40 +0000 (20:21 +0200)]
http_recv: Switch to nonblock API.

This gets rid of another call to FD_ISSET().

13 years agopara_client: Fix unreliable uses of FD_ISSET().
Andre Noll [Thu, 8 Apr 2010 01:07:50 +0000 (03:07 +0200)]
para_client: Fix unreliable uses of FD_ISSET().

The client_recv_buffer() function of client_common.c did not
check for EAGAIN. Use the new nonblock API if possible that
gets things just right and add a check for EAGAIN for RC4
encrypted connections.

13 years agostdin: Use non-blocking API.
Andre Noll [Tue, 20 Apr 2010 19:29:00 +0000 (21:29 +0200)]
stdin: Use non-blocking API.

13 years agoaudioc: Switch to blocking file descriptors.
Andre Noll [Mon, 12 Apr 2010 17:07:51 +0000 (19:07 +0200)]
audioc: Switch to blocking file descriptors.

There is no point in playing games with select() and non-blocking
file descriptors if all we need is a simple loop that dumps the fd
to stdout.

This patch also adds an error message for the case the setup of the
remote socket fails.

13 years agoafs: Use nonblocking API also for afs commands.
Andre Noll [Mon, 19 Apr 2010 22:53:59 +0000 (00:53 +0200)]
afs: Use nonblocking API also for afs commands.

Another FD_ISSET() bytes the dust..

13 years agoafs: Use nonblocking API for server commands.
Andre Noll [Sun, 18 Apr 2010 20:32:15 +0000 (22:32 +0200)]
afs: Use nonblocking API for server commands.

This simplifies execute_server_command() and kills another call
to FD_ISSET().

13 years agoUse non-blocking API for signal handling.
Andre Noll [Sun, 18 Apr 2010 12:55:04 +0000 (14:55 +0200)]
Use non-blocking API for signal handling.

This gets rid of a couple of calls to FD_ISSET() and simplifies
para_next_signal() a bit.

13 years agoRemove ->signum from struct signal_task.
Andre Noll [Thu, 8 Apr 2010 20:02:30 +0000 (22:02 +0200)]
Remove ->signum from struct signal_task.

It is only needed in the signal handlers where a local variable
can be used instead.

13 years agoRework para_accept().
Andre Noll [Sun, 25 Apr 2010 18:01:06 +0000 (20:01 +0200)]
Rework para_accept().

Make it take an fd_set pointer and check the fd for readability
within para_accept() rather than in each caller. Also, don't return
an error on EAGAIN.

Fix all callers accordingly. Most of them become a bit simpler due
to this change.

13 years agoMake recv_pattern() use the nonblock API.
Andre Noll [Sun, 25 Apr 2010 17:54:06 +0000 (19:54 +0200)]
Make recv_pattern() use the nonblock API.

Move it to fd.c and rename it to read_pattern(). Both users, http_recv.c and http_send.c,
are adjusted accordingly.

13 years agodccp_recv/udp_recv: Use the new nonblock API.
Andre Noll [Sun, 25 Apr 2010 17:34:35 +0000 (19:34 +0200)]
dccp_recv/udp_recv: Use the new nonblock API.

This simplifies the code quite a bit. In particular it allows to
kill the extra check for EAGAIN that was necessary to deal with
unreliable return value of FD_ISSET().

13 years agoIntroduce the new nonblock API.
Andre Noll [Sun, 25 Apr 2010 17:27:45 +0000 (19:27 +0200)]
Introduce the new nonblock API.

This patch is an attempt to create a better API for reads from
non-blocking file descriptors. It adds readv_nonblock() and implements
read_nonblock() as a simple wrapper for readv_nonblock(). Both new
functions check the given file descriptor for readability and read
as much as possible until an error occurs or the buffer is full.

Two additional parameters are introduced: An fd_set and a result
pointer for the number of bytes that have been read successfully. The
optional fd_set pointer is used to have the fixup code for unreliable
returns of FD_ISSET() at one place only.

Having an extra parameter for storing the number of bytes read allows
to treat EOF as an error condition but EAGAIN as a normal condition.
This will simplify callers (dccp_recv and upd_recv) a bit.

13 years agooggdec: Fix end-of-file detection.
Andre Noll [Sun, 25 Apr 2010 12:36:15 +0000 (14:36 +0200)]
oggdec: Fix end-of-file detection.

This bug causes the end of the decoded output not being written to the child nodes
of the buffer tree under certain circumstances. Even if the buffer tree detects EOF
we must not just bail out because there might still be data available for ov_read().

So remember the node status and return negative only if the node status is negative
_and_ ov_read() returns zero.

13 years agonew codename, reset version to git
Andre Noll [Fri, 23 Apr 2010 11:09:44 +0000 (13:09 +0200)]
new codename, reset version to git

13 years agothe paraslash-0.4.2 release tarball
Andre Noll [Fri, 23 Apr 2010 10:44:42 +0000 (12:44 +0200)]
the paraslash-0.4.2 release tarball

13 years agoparaslash 0.4.2 v0.4.2
Andre Noll [Fri, 23 Apr 2010 09:36:02 +0000 (11:36 +0200)]
paraslash 0.4.2

14 years agoaudiod: Avoid busy loop if switched off.
Andre Noll [Thu, 22 Apr 2010 21:12:46 +0000 (23:12 +0200)]
audiod: Avoid busy loop if switched off.

Also, request a minimal delay if the status task has to be shut down.

14 years agoaudiod: Make the time display more smooth.
Andre Noll [Thu, 22 Apr 2010 21:11:17 +0000 (23:11 +0200)]
audiod: Make the time display more smooth.

If playing, request a timeout that expires at the next second.

14 years agoaudiod: Dump audiod status after command execution.
Andre Noll [Thu, 22 Apr 2010 21:07:49 +0000 (23:07 +0200)]
audiod: Dump audiod status after command execution.

Commands like on/off/cycle change the audiod status. Without this change,
the status is only updated after the next select timeout.

14 years agoaudiod: Avoid busy loop in standby/off mode.
Andre Noll [Thu, 22 Apr 2010 21:05:26 +0000 (23:05 +0200)]
audiod: Avoid busy loop in standby/off mode.

Without this patch, must_start_decoder() incorrectly returned true if para_server
is announcing a stream but the audiod status is not on. This results in
status_pre_select() requesting a minimal delay.

14 years agoFix a gcc warning on ubuntu lucid lynx.
Andre Noll [Thu, 22 Apr 2010 16:03:36 +0000 (18:03 +0200)]
Fix a gcc warning on ubuntu lucid lynx.

Apparently the Ubuntu guys know better than the programmer which
system calls require argument checking. Sad, sad, sad.

14 years agoosx_write fixes.
Andre Noll [Thu, 22 Apr 2010 16:01:34 +0000 (18:01 +0200)]
osx_write fixes.

Boy, that was broken since the switch to the buffer tree API
and hasn't obviously seen any testing since then.

That code is rather strange and full of braindead crap. It
should be rewritten eventually. For now, this patch beats it
a little bit into the direction of sanitity.

14 years agogui: Avoid bogus "key is not bound" message.
Andre Noll [Thu, 22 Apr 2010 07:27:24 +0000 (09:27 +0200)]
gui: Avoid bogus "key is not bound" message.

Commit 0e4306dd5162a2850e623bf3082b3f7291aaad45 introduced a
bug causing para_gui to print a "key not found" message after
each command. Fix it by inserting a missing return statement.

14 years agoNEWS update.
Andre Noll [Wed, 21 Apr 2010 12:26:30 +0000 (14:26 +0200)]
NEWS update.

14 years agoFEC: Change the default slice size from 1490 to 1472.
Andre Noll [Tue, 20 Apr 2010 09:51:31 +0000 (11:51 +0200)]
FEC: Change the default slice size from 1490 to 1472.

1472 is the maximal possible size that does not result in fragmentation
on networks with 1500 MTU size (1500 = 1472 payload + 8 UDP header +
20 IP header).

This can be verified using

tcpdump -nv -i eth0 udp

The output must contain a zero offset value, and the "Don't Fragment"
IP flag (DF) should be set.

Thanks to Gerrit Renker for pointing this out.

14 years agoaudiod: Fix status item parsing for long status items.
Andre Noll [Mon, 19 Apr 2010 21:50:51 +0000 (23:50 +0200)]
audiod: Fix status item parsing for long status items.

This was broken since audiod started to use the buffer tree API. Actually there are
two bugs which are both fixed by this patch:

- for_each_stat_item() copies the remaining part of the buffer containing
the incomplete part of the last status item to the beginning of the buffer.
This is necessary if the buffer tree API is not used but messes up the buffer
contents if it _is_ used. Move this memmove()  call from for_each_status_item(),
which is called from audiod.c and gui.c,  to gui.c, as only gui.c needs it.

- Secondly, audiod.c called btr_node_status() with an minimum input queue
size of zero, which is does not work if a status item crosses a buffer
boundary. In this case for_each_status_item() will only ever see the first buffer
containing the incomplete status item, hence it can never make progress.
Fix this by introducing  the min_iqs field of struct status_task. Set  this field
to non-zero if the full buffer size was returned by for_each_status_item(),
indicating that the next status item is spread out over two or more buffers.

14 years agoMerge branch 't/udp_robustness'
Andre Noll [Mon, 12 Apr 2010 16:21:23 +0000 (18:21 +0200)]
Merge branch 't/udp_robustness'

14 years agoMerge branch 'maint'
Andre Noll [Mon, 12 Apr 2010 16:12:31 +0000 (18:12 +0200)]
Merge branch 'maint'

14 years agochunk queue: Fix chunk dequeuing.
Andre Noll [Mon, 12 Apr 2010 16:04:31 +0000 (18:04 +0200)]
chunk queue: Fix chunk dequeuing.

We missed to update the number of pending bytes when removing
a chunk from the queue.

This patch also clarifies the description of the cq parameter of
cq_dequeue().

Thanks to Gerrit Renker who pointed out this bug.

14 years agoMerge branch 'maint'
Andre Noll [Thu, 8 Apr 2010 18:23:27 +0000 (20:23 +0200)]
Merge branch 'maint'

14 years agoudp_send: Fix com_off.
Andre Noll [Thu, 8 Apr 2010 18:23:15 +0000 (20:23 +0200)]
udp_send: Fix com_off.

When the off command is executed, the udp sender sends an eof packet
to all configured targets. However, it then continues to send data.

Fix this by returning early in udp_send_fec() if the sender has been
switched off.

14 years agoudp_send: Force chunk queuing.
Andre Noll [Tue, 6 Apr 2010 17:51:17 +0000 (19:51 +0200)]
udp_send: Force chunk queuing.

This adds the public cq_force_enqueue() function to chunk_queue.c.
Unlike cq_enqueue() the new function does not return an error if the
queue is full, but drops old chunks from the queue in order to make
space for the new chunk.

The upd sender uses the new function to avoid kicking targets.

14 years agoudp_send_fec(): Treat ECONNREFUSED like EAGAIN.
Andre Noll [Tue, 6 Apr 2010 17:32:32 +0000 (19:32 +0200)]
udp_send_fec(): Treat ECONNREFUSED like EAGAIN.

Writes to udp sockets may return ECONNREFUSED. As this is often only
a temporary condition, there is no need to kick the target.

This patch makes the udp sender ignore such errors rather than kicking
the client from the udp target list on the first error.

Thanks to Gerrit Renker for suggesting this change.

14 years agoChange year in COPYRIGHT to 2010.
Andre Noll [Mon, 5 Apr 2010 01:48:04 +0000 (03:48 +0200)]
Change year in COPYRIGHT to 2010.

Hey, this is earlier than last year :)

14 years agoMerge remote branch 'albrecht/master'
Andre Noll [Sun, 4 Apr 2010 23:27:23 +0000 (01:27 +0200)]
Merge remote branch 'albrecht/master'

14 years agopara_client: Fix --user.
Andre Noll [Sun, 4 Apr 2010 22:57:47 +0000 (00:57 +0200)]
para_client: Fix --user.

In case the user was given in the config file but not at the
command line, the logname was used. --key_file had a similar
problem.

Fix this by moving the initialization of these two variables
down, after the config file has been read.