paraslash.git
12 years agoparaslash 0.4.7 v0.4.7
Andre Noll [Wed, 1 Jun 2011 14:27:26 +0000 (16:27 +0200)]
paraslash 0.4.7

12 years agoMakefile.in: Add ao_write.ggo to ggos.
Andre Noll [Wed, 1 Jun 2011 14:19:26 +0000 (16:19 +0200)]
Makefile.in: Add ao_write.ggo to ggos.

Without this, compiling the tarball fails with

make: *** No rule to make target `objects/ao_write.cmdline.o', needed by `para_write'.  Stop.

12 years agoogg_get_file_info(): Fix off-by-one.
Andre Noll [Sun, 29 May 2011 11:53:32 +0000 (13:53 +0200)]
ogg_get_file_info(): Fix off-by-one.

The timing information encoded in the chunk table was not always
sufficient to guarantee no buffer underruns since vorbis frames
are frequently spread over two (or more) ogg pages. This should
fix it.

12 years agoalsa: Simplify pre_select().
Andre Noll [Sat, 28 May 2011 11:32:42 +0000 (13:32 +0200)]
alsa: Simplify pre_select().

No need to open-code sched_request_timeout_ms().

12 years agoMerge branch 't/decl_after_statement'
Andre Noll [Sun, 22 May 2011 13:22:42 +0000 (15:22 +0200)]
Merge branch 't/decl_after_statement'

12 years agodoxify version.h and git-version.h.
Andre Noll [Sun, 22 May 2011 13:22:14 +0000 (15:22 +0200)]
doxify version.h and git-version.h.

12 years agoMove statements after declarations.
Andre Noll [Fri, 22 Apr 2011 14:41:39 +0000 (16:41 +0200)]
Move statements after declarations.

This gets rid of gcc warnings of the form

warning: ISO C90 forbids mixed declarations and code

when compiled with -Wdeclaration-after-statement.

12 years agodoxygen: Add some missing documentation.
Andre Noll [Fri, 22 Apr 2011 16:03:28 +0000 (18:03 +0200)]
doxygen: Add some missing documentation.

12 years agodoxygen: Exclude *.command_list.[ch].
Andre Noll [Fri, 22 Apr 2011 16:01:56 +0000 (18:01 +0200)]
doxygen: Exclude *.command_list.[ch].

These files are auto-generated and the documentation is not very
helpful, so do not generate doxygen pages for these.

12 years agoMerge branch 't/ssh_keys'
Andre Noll [Sun, 15 May 2011 07:39:51 +0000 (09:39 +0200)]
Merge branch 't/ssh_keys'

12 years agoMerge branch 't/const'
Andre Noll [Sun, 15 May 2011 07:38:04 +0000 (09:38 +0200)]
Merge branch 't/const'

12 years agolibao: Avoid segfault on com_cycle.
Andre Noll [Thu, 3 Feb 2011 16:15:27 +0000 (17:15 +0100)]
libao: Avoid segfault on com_cycle.

Executing the cycle command while the ao writer is active can lead to
a segmentation fault because kill_all_decoders() removes the buffer
tree node of the ao writer but leaves its child node alive.

This patch changes kill_all_decoders() to kill the receiver node only
while leaving all other nodes alone, removing the assumption that
the set of filter nodes and writer nodes are the only nodes in the
buffer tree. This assumption used to be true but became false with
the merge of the ao writer which has two buffer tree nodes.

It is enough to kill only the receiver node as all other nodes will
eventually notice that their parent node no longer exists and exit
shortly thereafter.

12 years agoMerge branch 't/libao'
Andre Noll [Thu, 5 May 2011 13:50:49 +0000 (15:50 +0200)]
Merge branch 't/libao'

12 years agomanual: Fix two typos.
Andre Noll [Tue, 26 Apr 2011 22:53:42 +0000 (00:53 +0200)]
manual: Fix two typos.

12 years agomanual: Change instructions for creating RSA keys.
Andre Noll [Thu, 3 Mar 2011 08:31:20 +0000 (09:31 +0100)]
manual: Change instructions for creating RSA keys.

Decribe how to create an rsa key with ssh-keygen instead of
"openssl genrsa".

12 years agoclient: Also try to load the private rsa-ssh key.
Andre Noll [Thu, 25 Nov 2010 07:56:34 +0000 (08:56 +0100)]
client: Also try to load the private rsa-ssh key.

If no key file was given and the default key file ~/.paraslash/key.<user> does
not exist, try ~/.ssh/id_rsa.

12 years agoAdd support for ssh-rsa keys.
Andre Noll [Thu, 25 Nov 2010 07:33:20 +0000 (08:33 +0100)]
Add support for ssh-rsa keys.

This allows to use standard ssh keys (that is, keys generated with
ssh-keygen) for the challenge/response authentication method of
paraslash. Only RSA keys without password protection are supported
at the moment.

Since we want that both openssl and ssh keys just work, we introduce
the helper function is_ssh_rsa_key(). It looks at the first few bytes
of the key to decide which type of public key we have. For openssl
keys, we just call openssl's EVP_PKEY_get1_RSA() and be done. Private
keys generated by ssh-keygen do not differ from keys generated by
"openssl rsa" and need no special treatment either.

However, public ssh rsa keys are stored differently, as an uuencoded
byte stream. So this patch adds functions that decode a given buffer
via base64 or uudecode. The two rsa public parameters (modulus and
exponent) are then read from the decoded buffer using BN_bin2bn().

12 years agofd: Allow passing NULL to para_munmap().
Andre Noll [Tue, 26 Apr 2011 14:33:44 +0000 (16:33 +0200)]
fd: Allow passing NULL to para_munmap().

This patch makes para_munmap succeed with return value 0 if the passed
"start" pointer is NULL. This allows to simplify the code in the
callers a bit, similar to free(NULL).

12 years agoMark a couple of functions as const.
Andre Noll [Tue, 29 Mar 2011 20:03:54 +0000 (22:03 +0200)]
Mark a couple of functions as const.

Probably does not matter much..

12 years agoMerge branch 't/crypt_cleanups'
Andre Noll [Sat, 23 Apr 2011 13:54:59 +0000 (15:54 +0200)]
Merge branch 't/crypt_cleanups'

Conflicts:
Makefile.in

13 years agoMake some variables static.
Andre Noll [Thu, 21 Apr 2011 22:05:43 +0000 (00:05 +0200)]
Make some variables static.

Found by sparse.

13 years agoMerge branch 't/autogen'
Andre Noll [Thu, 21 Apr 2011 20:56:56 +0000 (22:56 +0200)]
Merge branch 't/autogen'

13 years agoKILL E_AO_WRITE.
Andre Noll [Thu, 31 Mar 2011 09:27:49 +0000 (11:27 +0200)]
KILL E_AO_WRITE.

We have E_WRITE_COMMON_EOF, and use of this code is preferred because
para_write treats it as a non-fatal error and exits successfully if
the writer task removed its btr node due to E_WRITER_COMMON_EOF while
it exits non-zero in case of other errors.

13 years agoImplement support for libao via the new ao writer.
Andre Noll [Sat, 5 Mar 2011 11:36:34 +0000 (12:36 +0100)]
Implement support for libao via the new ao writer.

This adds support for another writer to paraslash. The new ao writer
allows to play an audio stream via one of libao's output plugins.

Two new configure options are provided and the documentation is
updated accordingly.

13 years agomanual: Mention that also DCCP streams are FEC-encoded.
Andre Noll [Tue, 19 Apr 2011 23:30:05 +0000 (01:30 +0200)]
manual: Mention that also DCCP streams are FEC-encoded.

13 years agoFix typo in audiod man page.
Andre Noll [Tue, 19 Apr 2011 23:29:11 +0000 (01:29 +0200)]
Fix typo in audiod man page.

13 years agoNEWS update.
Andre Noll [Sun, 10 Apr 2011 18:07:33 +0000 (20:07 +0200)]
NEWS update.

13 years agoMerge branch 't/gvf'
Andre Noll [Fri, 8 Apr 2011 09:12:46 +0000 (11:12 +0200)]
Merge branch 't/gvf'

13 years agoautogen.sh: Detect number of processors and run parallel make.
Andre Noll [Tue, 15 Feb 2011 07:28:43 +0000 (08:28 +0100)]
autogen.sh: Detect number of processors and run parallel make.

On multi-core machines a parallel make is often much faster than a
sequential make. This patch teaches autogen.sh to detect the number
of processing units available on the build system. It first tries to
execute the nproc utility (part of the coreutils package) and falls
back to /proc/cpuinfo if nproc was unavailable.

If both methods don't work, which is usually the case on non-Linux
systems where coreutils are not installed and /proc/cpuinfo does not
exist, we use the safe default of n=1.

13 years agoNEWS update.
Andre Noll [Sun, 3 Apr 2011 15:34:29 +0000 (17:34 +0200)]
NEWS update.

13 years agoMerge branch 't/configure_improvements'
Andre Noll [Sun, 3 Apr 2011 15:27:32 +0000 (17:27 +0200)]
Merge branch 't/configure_improvements'

13 years agonew codename, reset version to git
Andre Noll [Thu, 31 Mar 2011 11:32:01 +0000 (13:32 +0200)]
new codename, reset version to git

13 years agothe paraslash-0.4.6 release tarball
Andre Noll [Thu, 31 Mar 2011 11:28:48 +0000 (13:28 +0200)]
the paraslash-0.4.6 release tarball

13 years agoparaslash 0.4.6 v0.4.6
Andre Noll [Thu, 31 Mar 2011 11:25:31 +0000 (13:25 +0200)]
paraslash 0.4.6

13 years agoRemove two unused error codes.
Andre Noll [Thu, 31 Mar 2011 09:36:49 +0000 (11:36 +0200)]
Remove two unused error codes.

13 years agoMerge remote-tracking branch 'fml/master'
Andre Noll [Tue, 29 Mar 2011 22:27:57 +0000 (00:27 +0200)]
Merge remote-tracking branch 'fml/master'

13 years agoFix grab client resume.
Andre Noll [Tue, 29 Mar 2011 22:10:29 +0000 (00:10 +0200)]
Fix grab client resume.

An active grab client is moved to the inactive list if para_server
stops playing and the grab client is not operating in one-shot mode. In
this state, despite its buffer tree node pointer being NULL, the task
associated with the grab client remains active. This causes para_server
to abort due to the assertion btrn != NULL in btr_node_status().

Fix this bug by always unregistering the task, one-shot mode or not,
and re-registering it later, at the same time the new buffer tree
node for the grab client is allocated.

13 years agoautogen.sh: Get rid of a bashism.
Andre Noll [Tue, 29 Mar 2011 14:17:51 +0000 (16:17 +0200)]
autogen.sh: Get rid of a bashism.

This avoids some rather bizarre error messages if /bin/sh is dash.

13 years agoGet rid of some duplicate const qualifiers.
Andre Noll [Mon, 28 Mar 2011 22:04:54 +0000 (00:04 +0200)]
Get rid of some duplicate const qualifiers.

Fix fixes duplicate `const' warnings on gcc-3.3.3.

13 years agoDon't compile files generated by gengetopt with -Wall.
Andre Noll [Mon, 28 Mar 2011 22:00:23 +0000 (00:00 +0200)]
Don't compile files generated by gengetopt with -Wall.

gcc-4.6.0 spits out lots of warningns of the form

cmdline/recv.cmdline.c:439:9: warning: variable 'stop_char' set but not used [-Wunused-but-set-variable]

Silence these warnings by moving -Wall to the set of debug flags
which are not used for compiling *.cmdline.c files.

For some versions of gcc, including gcc-3.3.3 which is still supported,
the -Wformat-security and -Wmissing-format-attribute options depend on
-Wformat, which is turned on by -Wall, so we have to move these options
also to the DEBUG_CPPFLAGS.

13 years agoDocument RC4_ALIGN.
Andre Noll [Mon, 14 Mar 2011 16:25:14 +0000 (17:25 +0100)]
Document RC4_ALIGN.

It's not obvious what is going on there, so add explain why we are doing
this ugly dance.

13 years agoconfigure: Use AC_ARG_WITH also for openssl options.
Andre Noll [Tue, 1 Mar 2011 22:12:46 +0000 (23:12 +0100)]
configure: Use AC_ARG_WITH also for openssl options.

Currently the check for openssl is performed by CHECK_SSL() in
configure.ac. This function searches the given directory for the
openssl-header but does not check the existence and usability of
the openssl libraries. The argument of --enable-ssldir, if given,
is tried first, and each member of a hard-coded list of directories
is searched next.

This patch replaces CHECK_SSL() by checks similar to those for
other headers and libraries. In particular, we now also check
for the openssl libraries, and the configure options are now
called --with-openssl-headers and --with-openssl-libs rather than
--enable-ssldir.

13 years agoUse SSL_CPPFLAGS only for compiling crypt.c
Andre Noll [Mon, 28 Feb 2011 23:44:05 +0000 (00:44 +0100)]
Use SSL_CPPFLAGS only for compiling crypt.c

The previous cleanups moved everything which depends on openssl to
crypt.c. This is now the only file which includes openssl headers,
so there is no need to compile all objects with the ssl cpp flags.
In fact this could break things for setups on which the include dir
for openss contains other unwanted header files.

13 years agoRemove some unnecessary includes.
Andre Noll [Mon, 28 Feb 2011 23:40:37 +0000 (00:40 +0100)]
Remove some unnecessary includes.

This gets rid of quite some inclusions of <dirent.h> which are not needed
as most .c files do not deal with directories at all.

afs.c doe not mmap anything and needs nothing from sys/time.h so remove
these includes as well.

13 years agoMove sha1.[ch] to crypt.[ch] and make crypto API independent of sha1.
Andre Noll [Mon, 28 Feb 2011 23:28:27 +0000 (00:28 +0100)]
Move sha1.[ch] to crypt.[ch] and make crypto API independent of sha1.

This patch moves all public functions related to sha1 to crypt.c. This
allows to remove sha1.c, sha1.h and hash.h. It also removes the
HASH_TYPE define and avoids the word "sha1" in the public API and
its callers. The former sha1_hash() is now called hash_function().

13 years agoRemove rc4.h.
Andre Noll [Mon, 28 Feb 2011 22:53:43 +0000 (23:53 +0100)]
Remove rc4.h.

It's kind of silly to have an extra file which contains only a singe
preprocessor define. Move that define to crypt.h and kill rc4.h.

13 years agorename RC4_KEY_LEN to SESSION_KEY_LEN.
Andre Noll [Mon, 28 Feb 2011 22:49:06 +0000 (23:49 +0100)]
rename RC4_KEY_LEN to SESSION_KEY_LEN.

The users of the crypto API should not need to care about which stream
cipher is in use. This trivial patch only renames the name of the
constant value and updates the documentation.

13 years agoRename struct rc4_context and stream cipher send/receive functions.
Andre Noll [Mon, 28 Feb 2011 22:43:21 +0000 (23:43 +0100)]
Rename struct rc4_context and stream cipher send/receive functions.

This only changes the name structures and functions. Unfortunately,
the patch is rather large since it requires to fixup all callers
of the affected functions. However, each change is either a simple
rename or a trivial documentation adjustment.

13 years agoRemove autogenerated doxygen comments for commands.
Andre Noll [Sat, 12 Mar 2011 22:58:33 +0000 (23:58 +0100)]
Remove autogenerated doxygen comments for commands.

The generated comments become invalid once rc4.h is removed, which
happens in a subsequent patch.

13 years agoReplace direct use of RC4 by stream cipher abstraction.
Andre Noll [Mon, 28 Feb 2011 21:54:08 +0000 (22:54 +0100)]
Replace direct use of RC4 by stream cipher abstraction.

This introduces the new struct stream_cipher in crypt.h as well as
two functions stream_cipher_new() and stream_cipher_free() which
initialize a new stream cipher structure and deallocate such a
structure, respectively.

The users of RC4 are changed to call the new abstract functions,
so they become independent from openssl. Consequently the affected
files need no include openssl/rc4.h any more.

13 years agoReplace RSA by an abstract asymmetric key structure.
Andre Noll [Mon, 28 Feb 2011 21:07:44 +0000 (22:07 +0100)]
Replace RSA by an abstract asymmetric key structure.

This declares the new structure asymmetric_key in crypt.h but does not
define it. Instead, it is defined in crypt.c so that only the functions
in this file can access the members of the structure directly.

Functions which previously took an (openssl-specific) RSA pointer
are changed to receive a pointer to struct asymmetric_key instead,
removing the requirement to include an openssl header file before
crypt.h can be included.

13 years agonet.c: Remove unnecessary crypto includes.
Andre Noll [Mon, 28 Feb 2011 19:26:42 +0000 (20:26 +0100)]
net.c: Remove unnecessary crypto includes.

The functions in this file are ignorant of the crypto layer.

13 years agoNEWS update.
Andre Noll [Sat, 26 Mar 2011 12:54:32 +0000 (13:54 +0100)]
NEWS update.

13 years agoMerge branch 't/sched_improvements'
Andre Noll [Sat, 26 Mar 2011 12:50:34 +0000 (13:50 +0100)]
Merge branch 't/sched_improvements'

13 years agoMerge remote-tracking branch 'fml/master'
Andre Noll [Fri, 25 Mar 2011 08:52:41 +0000 (09:52 +0100)]
Merge remote-tracking branch 'fml/master'

13 years agoMerge remote branch 'boock/master'
Andre Noll [Thu, 24 Mar 2011 12:20:13 +0000 (13:20 +0100)]
Merge remote branch 'boock/master'

13 years agoudp_send: Silence gcc warning.
Andre Noll [Thu, 24 Mar 2011 12:05:49 +0000 (13:05 +0100)]
udp_send: Silence gcc warning.

Ubuntu Lucid's gcc-4.3.3 emits the following warning about not checking
the return value of write() even if the result is casted to void.

udp_send.c: In function ‘udp_close_target’:
udp_send.c:65: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result

The usual approach to store the return value in a dummy variable is
not optimal because the upcoming gcc-4.6 will warn that the variable
is set but otherwise unused.

Likely there are more places in the paraslash code which have the same
problem, so this patch introduce the do_nothing macro in para.h which,
creatively enough, does nothing. The new macro is employed like

if (write(...))
do_nothing;

This gets rid of the warning on Lucid and does not give new warning
on gcc-4.6.

13 years agoNEWS update.
Andre Noll [Sun, 20 Mar 2011 11:30:13 +0000 (12:30 +0100)]
NEWS update.

13 years agoMerge branch 't/testsuite'
Andre Noll [Sun, 20 Mar 2011 11:20:29 +0000 (12:20 +0100)]
Merge branch 't/testsuite'

13 years agostdin.h: Add missing doxygen comment for stdin_task->btrp.
Andre Noll [Fri, 18 Mar 2011 08:09:05 +0000 (09:09 +0100)]
stdin.h: Add missing doxygen comment for stdin_task->btrp.

13 years agoopen_and_update_audio_file(): Always print file name on errors.
Andre Noll [Fri, 18 Mar 2011 08:08:07 +0000 (09:08 +0100)]
open_and_update_audio_file(): Always print file name on errors.

Otherwise, if running with logleve warning or error, we only see
the error message but not which file could not be opened.

13 years agoSilence two Doxygen warnings.
Andre Noll [Wed, 16 Mar 2011 20:30:26 +0000 (21:30 +0100)]
Silence two Doxygen warnings.

Doxygen does not like comments in <brackets>. Use upper case instead.
This gets rid of annoying warnings of the form

/home/work/maan/scm/paraslash/audiod_command_list.h:13: warning: Unsupported xml/html tag <parent> found
/home/work/maan/scm/paraslash/audiod_command_list.h:13: warning: Unsupported xml/html tag <name> found

13 years agoMerge remote-tracking branch 'fml/master'
Andre Noll [Wed, 16 Mar 2011 19:28:29 +0000 (20:28 +0100)]
Merge remote-tracking branch 'fml/master'

13 years agoaudiod: Remove unused num_filters().
Andre Noll [Wed, 16 Mar 2011 19:26:27 +0000 (20:26 +0100)]
audiod: Remove unused num_filters().

This function has no callers. Also, get_audio_format_num() is
only called from functions in audiod.c, so make this function
static.

13 years agofade: Quiesce two gcc warnings.
Andre Noll [Wed, 16 Mar 2011 16:56:43 +0000 (17:56 +0100)]
fade: Quiesce two gcc warnings.

Ubuntu Lucid's gcc 4.4.3 does not like it if not each possible value
of an enumeration is handled in the body of a switch statement.

Since gengetopt for some reason always creates an additional xxx_NULL
value in options of type enum, this more or less means we have to
introduce default: cases to avoid warnings of the form

fade.c:113: warning: enumeration value ‘mixer_channel__NULL’ not handled in switch
fade.c:346: warning: enumeration value ‘mode__NULL’ not handled in switch

Fortunately, these are the only two warnings, so add default: cases
to make gcc happy.

13 years agosched: Only call post_select() if task is not in error state.
Andre Noll [Tue, 15 Mar 2011 21:05:24 +0000 (22:05 +0100)]
sched: Only call post_select() if task is not in error state.

Fixes a bug introduced in 86611501 which caused para_audiod to segfault
if the connection to para_server terminated unexpectedly.

para_audiod relies (in kill_btrn()) on a task's ->post_select method
never being called if t->error is negative.

13 years agoserver: Include git version in output of com_si().
Andre Noll [Tue, 15 Mar 2011 20:07:42 +0000 (21:07 +0100)]
server: Include git version in output of com_si().

It is often useful to be able to find out which version of para_server
is currently running.

13 years agopara_write: Return proper error code.
Andre Noll [Sun, 20 Feb 2011 18:41:09 +0000 (19:41 +0100)]
para_write: Return proper error code.

Currently the exit code of para_write is always the value returned
by schedule().  This is zero unless the call to select() fails,
usually does not happen, so errors resulting from the writers do not
cause para_write to exit with a non-zero exit code.

In particular, para_write exits successfully if the underlying
writer(s) nodes could not open their sound device or unregistered
their task due to other errors.

Fix this by investigating each writer node's t->error value after
schedule() has returned. If this value does not correspond to an end
of file condition, the strerror text of this error code is written
to stderr, and para_write exits non-zero.

13 years agoaudiod: Kill com_kill().
Andre Noll [Sun, 20 Feb 2011 18:06:34 +0000 (19:06 +0100)]
audiod: Kill com_kill().

This never worked well because a task which has been killed by
kill_task() has no chance to clean up. Also a stale buffer tree node
remains if the task had an associated buffer tree node.

13 years agoUse curses_cppflags only for building gui.o.
Andre Noll [Mon, 28 Feb 2011 10:00:58 +0000 (11:00 +0100)]
Use curses_cppflags only for building gui.o.

It's only required there, and having the -I options for the curses
headers everywhere could be problematic for building other objects.

13 years agogui: Replace NCURSES_SIZE_T by ordinary size_t.
Andre Noll [Fri, 25 Feb 2011 16:19:08 +0000 (17:19 +0100)]
gui: Replace NCURSES_SIZE_T by ordinary size_t.

With the old type, gui.c does not compile on curses implementations
other than ncurses.

13 years agoReplace ncurses by curses.
Andre Noll [Fri, 25 Feb 2011 16:13:08 +0000 (17:13 +0100)]
Replace ncurses by curses.

Ncurses is not available on all platforms, and para_gui should work
with any curses implementation.

So this patch replaces the --with-ncurses-headers and
--with-ncurses-libs configure options by --with-ncurses-headers and
--with-ncurses-libs, and makes configure check for libcurses instead
of libncurses. Moreover, the para_gui executable is now linked against
libcurses rather than libncurses.

On linux systems, this should be a no-op.

13 years agoAdd finer-grained configure options for ogg/vorbis/speex.
Andre Noll [Fri, 25 Feb 2011 15:15:52 +0000 (16:15 +0100)]
Add finer-grained configure options for ogg/vorbis/speex.

This replaces the --with-oggvorbis-headers and --with-oggvorbis-libs
configure options by three pairs of options, for ogg, vorbis and
speex. Since both vorbis and speex depend on libogg, we only check
for the vorbis/speex header and libraries if libogg was been found.

13 years agoKill TASK_UNREGISTERED error code.
Andre Noll [Sun, 20 Feb 2011 17:41:02 +0000 (18:41 +0100)]
Kill TASK_UNREGISTERED error code.

Currently the scheduler sets t->error to -E_TASK_UNREGISTERED when
it has unregistered a task. This deprives the applications from doing
post-mortem error checking.

The condition (task.error != -E_TASK_UNREGISTERED) is now equivalent
to task.error >= 0, so use this test everywhere.

13 years agoFix git-version file creation.
Andre Noll [Tue, 22 Feb 2011 12:02:17 +0000 (13:02 +0100)]
Fix git-version file creation.

ATM, this does not work well, since only the executables depend on
GIT-VERSION-FILE, but relinking these does not take into account the
new contents of GIT-VERSION-FILE. Hence a "make clean" is necessary
to produce executables that reports the correct version number.

This patch  changes GIT-VERSION-GEN so that it generates a preprocessor
define instead of setting a Makefile variable. This value is written
to stdout in any case and also to the file named "$1" if an argument
was given and the current git version differs from the contents of
this file (or if the file does not exist).

In order to not have to recompile everything on version changes,
the macros related to versioning are moved from para.h into the new
version.h file which is included only where necessary.

Makefile.in no longer uses phony targets to include the GIT_VERSION
variable. Instead we simply execute

$(shell ./GIT_VERSION_FILE version.h)

at the top of the Makefile.

13 years agoNEWS update.
Andre Noll [Sat, 5 Mar 2011 12:05:29 +0000 (13:05 +0100)]
NEWS update.

13 years agoMerge branch 't/array_size'
Andre Noll [Sat, 5 Mar 2011 11:54:28 +0000 (12:54 +0100)]
Merge branch 't/array_size'

13 years agoMerge branch 't/vorbis_dummy_header'
Andre Noll [Sat, 5 Mar 2011 11:53:02 +0000 (12:53 +0100)]
Merge branch 't/vorbis_dummy_header'

13 years agogui: Fix window redrawing on SIGWINCH.
Andre Noll [Sat, 5 Mar 2011 11:42:04 +0000 (12:42 +0100)]
gui: Fix window redrawing on SIGWINCH.

It is incorrect to check the condition (offset < 0 || len < offset).
This caused messed up contents of the bottom window after a resize.

13 years agoMerge remote-tracking branch 'refs/remotes/fml/master'
Andre Noll [Thu, 3 Mar 2011 18:43:25 +0000 (19:43 +0100)]
Merge remote-tracking branch 'refs/remotes/fml/master'

13 years agoInitialize all task->status fields.
Andre Noll [Thu, 3 Mar 2011 18:43:07 +0000 (19:43 +0100)]
Initialize all task->status fields.

Does not matter unless SCHED_DEBUG is enabled, but still..

13 years agohandle_connect(): Don't send anything to non-authorized clients.
Andre Noll [Thu, 3 Mar 2011 16:39:11 +0000 (17:39 +0100)]
handle_connect(): Don't send anything to non-authorized clients.

Currently, if we don't receive a valid authentication request, we send
back an RC4-encrypted error message to the client, which is kind of
pointless since the RC4 keys are not set up at this point.

Of course we could send an unencryted error message in this case,
but in since the peer could be anything, it seems safer to just close
the connection.

13 years agoscore: Fix use of uninitialized memory on 64 bit machines.
Andre Noll [Thu, 3 Mar 2011 14:51:41 +0000 (15:51 +0100)]
score: Fix use of uninitialized memory on 64 bit machines.

The score of an audio file in the score table is defined as a quantity
which is sizeof(long) bytes large, i.e. 4 bytes on 32bit systems and
8 bytes on 64 bit systems. This is not a problem per se because the
score column lives only in memory, so we do not have to worry about
incompatibilities of the on-disk layout.

However, at several places in score.c we cast the pointer to the osl
object to (int *) rather than (long *). When writing to the object on
a 64 bit machine, this will only set 4 out of the 8 allocated bytes,
the other four bytes stay uninitialized. The "ls" command uses the
correct cast to (long *) and reads the full 8 bytes. This causes
valgrind to complain:

==5433== Conditional jump or move depends on uninitialised value(s)
==5433==    at 0x4164F4: prepare_ls_row (aft.c:1334)
==5433==    by 0x4E2F421: osl_rbtree_loop (osl.c:1457)
==5433==    by 0x418935: admissible_file_loop (score.c:255)
==5433==    by 0x41601A: com_ls_callback (aft.c:1363)
==5433==    by 0x411FDE: command_post_select (afs.c:842)
==5433==    by 0x41B67A: schedule (sched.c:76)
==5433==    by 0x411ACF: afs_init (afs.c:986)
==5433==    by 0x408863: main (server.c:451)
==5433==
==5433== Conditional jump or move depends on uninitialised value(s)
==5433==    at 0x41650A: prepare_ls_row (aft.c:1334)
==5433==    by 0x4E2F421: osl_rbtree_loop (osl.c:1457)
==5433==    by 0x418935: admissible_file_loop (score.c:255)
==5433==    by 0x41601A: com_ls_callback (aft.c:1363)
==5433==    by 0x411FDE: command_post_select (afs.c:842)
==5433==    by 0x41B67A: schedule (sched.c:76)
==5433==    by 0x411ACF: afs_init (afs.c:986)
==5433==    by 0x408863: main (server.c:451)

Fix this bug by always casting to (long *).

13 years agoRC4: Fix invalid read.
Andre Noll [Thu, 3 Mar 2011 14:09:53 +0000 (15:09 +0100)]
RC4: Fix invalid read.

Commit 7cb8fa26 (May 2010) created a target buffer for the RC4-encoded
data which is slightly larger than the input buffer because openssl
apparently wrote beyond the size it was told to write.

As it turns out, this was not enough as RC4() may also read-overflow
the input buffer. Valgrind says on Linux/x86_64:

==2423== Invalid read of size 8
==2423==    at 0x5312020: RC4 (in /lib/libcrypto.so.0.9.8)
==2423==    by 0x40F01D: rc4_send_bin_buffer (crypt.c:224)
==2423==    by 0x40C724: com_stat (command.c:391)
==2423==    by 0x40BABF: handle_connect (command.c:838)
==2423==    by 0x408330: command_post_select (server.c:404)
==2423==    by 0x41B5DA: schedule (sched.c:76)
==2423==    by 0x4089C3: main (server.c:581)
==2423==  Address 0x6cefeb8 is 232 bytes inside a block of size 235 alloc'd
==2423==    at 0x4C275A2: realloc (vg_replace_malloc.c:525)
==2423==    by 0x40DE74: para_realloc (string.c:40)
==2423==    by 0x40E324: make_message (string.c:134)
==2423==    by 0x40C5D0: com_stat (command.c:328)
==2423==    by 0x40BABF: handle_connect (command.c:838)
==2423==    by 0x408330: command_post_select (server.c:404)
==2423==    by 0x41B5DA: schedule (sched.c:76)
==2423==    by 0x4089C3: main (server.c:581)

Fix this by treating the last len % 8 bytes of the input
separately. It's ugly but it does silence valgrind and should not be
noticeably slower since we are only doing one extra copy of at most
7 bytes.

We need to round the input size up and down to a multiple of 8,
so this patch introduces generic macros in para.h for this purpose.

13 years agoNEWS update.
Andre Noll [Wed, 2 Mar 2011 14:20:20 +0000 (15:20 +0100)]
NEWS update.

13 years agoMerge remote-tracking branch 'boock/master'
Andre Noll [Wed, 2 Mar 2011 10:38:43 +0000 (11:38 +0100)]
Merge remote-tracking branch 'boock/master'

13 years agoconfigure.ac: Avoid stray -L option in para_server link command.
Andre Noll [Tue, 1 Mar 2011 22:18:33 +0000 (23:18 +0100)]
configure.ac: Avoid stray -L option in para_server link command.

If --with-osl-libs  is not given, we end up passing "-L" without a corresponding
directory name to the linker.

13 years agoaudiod: Update --no_default_filters help text.
Andre Noll [Mon, 28 Feb 2011 13:05:31 +0000 (14:05 +0100)]
audiod: Update --no_default_filters help text.

This was quite outdated: We got the defaults right for udp and dccp
streams at least since commit 28f8405e (April 2010). Moreover, two new
audio formats (wma and spx) are supported now but are not mentioned
in the help text. Describe that the corresponding decoder is used as
the default filter rather than listing all supported audio formats.

13 years agoMakefile: Stop building on ggo errors.
Andre Noll [Mon, 28 Feb 2011 10:32:16 +0000 (11:32 +0100)]
Makefile: Stop building on ggo errors.

The dependency files *.d are implicitly made by -include command
during make's first pass. The "-" prefix instructs make to ignore any
non-existing files *and* all errors resulting from executing the rules
for the *.d targets . This prefix is necessary to avoid the warning
messages about non-existing dependency files, for example after a
"make clean2".

This implies that make proceeds even if a dependency file could not
be created due to a syntax error in a .ggo file. We'd like to stop
if this happens, but unfortunately gnu make does not have an option
for specifying this behaviour in an include command.

This patch works around this shortcoming by letting the "all"
target depend on the new phony target "dep" which depends on all .d
files. This way all *.d targets are considered twice: Once during the
first pass (where errors are ignored) and again due to the all->dep
dependency.

If no errors occur, "make dep" is a no-op, so this change should not
slow down the build noticeably. A slight drawback of this solution
is that, in case of an error in a ggo file, the error will be printed
twice. But this it is still better than silently ignoring the error.

13 years agoAdd t0003-writer-init-error-path.sh.
Andre Noll [Sun, 20 Feb 2011 17:15:51 +0000 (18:15 +0100)]
Add t0003-writer-init-error-path.sh.

This catches the bugs recently found in the alsa and oss writers.

We need to test that certain commands fail but must distinguish between
failure due to non-zero exit codes and other failures, for example if
a command segfaults. Therefore this patch adds test_expect_failure()
to test-lib.sh which can be called by the individual tests and DTRT.

13 years agoFirst draft of a test-suite.
Andre Noll [Thu, 10 Feb 2011 22:57:55 +0000 (23:57 +0100)]
First draft of a test-suite.

Idea and parts of the implementation taken from test-lib.sh of the
git project. At the moment there are only three basic tests with more
to follow.

13 years agoMerge branch 't/ogg_timining_fixes'
Andre Noll [Sun, 27 Feb 2011 22:19:51 +0000 (23:19 +0100)]
Merge branch 't/ogg_timining_fixes'

13 years agoFix depend.sh on NetBSD.
Andre Noll [Fri, 25 Feb 2011 14:33:58 +0000 (15:33 +0100)]
Fix depend.sh on NetBSD.

NetBSD's sed apparently does not understand the \+ syntax to match the preceeding
pattern one or more times. OTOH, {1,} seems to work, so use this syntax instead.

This caused the build to abort silently because make gives up on the targets that
depend on files in the "cmdline" directory.

13 years agoImprove ARRAY_SIZE macro.
Andre Noll [Fri, 4 Feb 2011 06:46:28 +0000 (07:46 +0100)]
Improve ARRAY_SIZE macro.

Compilation now fails if the given argument not an array but a pointer.

Idea taken from ccan. Thanks Rusty!

13 years agoweb: Link to the gitweb summary page rather than the shortlog.
Andre Noll [Fri, 25 Feb 2011 12:12:55 +0000 (13:12 +0100)]
web: Link to the gitweb summary page rather than the shortlog.

This page shows heads and tags which might be more useful to people
than the shortlog only.

13 years agogitweb: Make the W3C validation checker happy.
Andre Noll [Thu, 24 Feb 2011 16:34:40 +0000 (17:34 +0100)]
gitweb: Make the W3C validation checker happy.

It reported a couple of errors on the gitweb (Changes) page. Moreover,
the git-logo was missing. This should fix both issues.

13 years agovorbis: Write out _all_ pending ogg pages.
Andre Noll [Thu, 24 Feb 2011 13:11:18 +0000 (14:11 +0100)]
vorbis: Write out _all_ pending ogg pages.

ogg_stream_flush() does not necessarily write out all pending ogg
packets into a single ogg page. So we have to call this function
in a loop until it returns zero to make sure we have a complete
ogg/vorbis header.

This fixes a bug in the vorbis dummy header patch set which caused
corrupt replacement headers for ogg files whose header spanned more
than one ogg page.

13 years agoRevert "Create three ogg pages when skipping vorbis comments."
Andre Noll [Thu, 24 Feb 2011 10:16:16 +0000 (11:16 +0100)]
Revert "Create three ogg pages when skipping vorbis comments."

This reverts commit 3569c4ac0d5b35318e741b0123bc707473261ad9 since
it did not fix the problem at all.  A proper fix is provided in the
next commit.

13 years agoconfigure.ac: Update header and function checks.
Andre Noll [Mon, 21 Feb 2011 20:34:52 +0000 (21:34 +0100)]
configure.ac: Update header and function checks.

This makes autoscan a bit happier.

13 years agogui_theme: Make set_theme() static.
Andre Noll [Mon, 21 Feb 2011 20:32:14 +0000 (21:32 +0100)]
gui_theme: Make set_theme() static.