Andre Noll [Mon, 10 Sep 2007 19:52:00 +0000 (21:52 +0200)]
afs: Replace DATABASE_DIR by a runtime config option.
Also, split afs_init() into two parts: The new open_afs_tables() that
does what its name suggests and the remaining part that initializes
the scheduler.
Andre Noll [Mon, 10 Sep 2007 00:05:15 +0000 (02:05 +0200)]
afs com_add(): Recognize also audio formats different from mp3.
This required adding two more callbacks: path_brother_callback() and
hash_sister_callback(). These are called from add_one_audio_file()
which runs from handler context and can thus not access the database
directly.
Andre Noll [Sat, 8 Sep 2007 23:17:50 +0000 (01:17 +0200)]
Make afs commands work.
This required a rewrite of send_callback_request().
The patch also includes the rename of get_socket() to get_stream_socket()
which takes the new domain parameter, so that it may be used for both
AF_INET and AF_UNIX sockets.
Andre Noll [Sat, 8 Sep 2007 19:50:57 +0000 (21:50 +0200)]
Introduce template commands for command_util.sh.
And use them to produce afs_command_list.[ch] which also contains all
blob commands without duplicating all the common information in the
new afs.cmd file.
Change para_server's help command to display the new commands. These
are not yet working because the callback code is not yet functional.
Andre Noll [Tue, 4 Sep 2007 20:16:06 +0000 (22:16 +0200)]
audiod: Fix a memory leak.
If the config file doesn't exist, configfile_exists() returnes NULL.
The old code leaked a pointer to the config file in this case.
This function is only called once at startup, so the leak is benign.
Morover, kill the static variable and the check if (!config_file) which
is always true.
Andre Noll [Sun, 12 Aug 2007 21:26:27 +0000 (23:26 +0200)]
dccp_send.c: Implement chunk queuing for dccp.
As Gerrit mentioned, it might be a good idea to use chunk
queueing also for dccp. This patch uses the new cq_xxx()
abstractions in the same way as the http sender.
Andre Noll [Sun, 12 Aug 2007 16:36:53 +0000 (18:36 +0200)]
Abstract out chunk_queue code.
This moves the chunk handling code to separate functions cq_foo(). They
take pointers to a chunk queue, which makes them orthogonal to the rest of
http_send.c.
Andre Noll [Wed, 8 Aug 2007 22:00:45 +0000 (00:00 +0200)]
Rewrite chunk queueing.
Since paraslash-0.2.16 the audio file is mmapped, so it is no longer neccessary
to make a copy of the chunk data in case a chunk can not be sent immediately
because the write would block. Just remember the chunk number and the number of
bytes of that chunk which were sent (non-zero in case of short writes).
The chunk data can then be retrieved by the new vss_get_chunk() function.
Andre Noll [Mon, 6 Aug 2007 14:09:28 +0000 (16:09 +0200)]
dccp sender: Keep polling until an entry becomes free (Gerrit Renker).
If write() on the dccp fd fails with EAGAIN, the current code retries
100 times and then gives up, returning -E_DCCP_WRITE which causes a
shutdown of the dccp connection.
CCID3 has a sending wait queue which fills up and is emptied
asynchronously. The EAGAIN case means that there is currently no space
in the wait queue, but this can change at any moment and is thus not
an error condition. So keep polling until an entry becomes free.
Andre Noll [Sat, 7 Jul 2007 17:11:45 +0000 (19:11 +0200)]
mysql_selector.c: introduce the myslq lock
This fixes a race condition in para_server:
parent child
real_query
real_query
mysql_store_result
This could cause para_server to hang in case the child process issued
a query which does not yield a result. It's hard to hit though. Fix is
to take the lock before the call to real_query, and release it after
mysql_store_result().
The patch also fixes a format string bug which was introduced by the patch
that switched to my_ulonglong for suitable variables in mysql_selector.c.
These need "%lli".
Andre Noll [Sun, 10 Jun 2007 23:45:51 +0000 (01:45 +0200)]
clean up error.h
It contained quite some unused error codes. This patch gets rid of
them and thus saves some space in the resulting binaries.
More importantly, there were two instances where a source file used
an error value of another source file (which is ok), but the object
file of that other source file would not get linked into the resulting
binary (which is not ok):
- aac_afh.c used E_AACDEC_INIT, which is not contained in
para_server
- http_recv.c used E_OVERRUN which is defined only if ortp
support was compiled in.
The patch also fixes another bug in the ogg vorbis audio format handler
where (the positive value) E_STREAM_PAGEIN was returned instead of
-E_STREAM_PAGEIN in case ogg_stream_pagein() failed.
Andre Noll [Mon, 21 May 2007 20:53:23 +0000 (22:53 +0200)]
error.h: move E_BAD_USER from audiod_command to command error list
Dooh. This caused a segfault in the server's child if an unkown user
connected. Fortunately, this happened right before the process exited
anyway, so it's not a security issue.
Andre Noll [Fri, 30 Mar 2007 15:14:04 +0000 (17:14 +0200)]
fix compress filter for big endian machines
This was broken since day one as it depended on little-endianness. Fix
it by checking the byte sex in configure and let the decoders
produce host endian 16 bit audio output by using the new
write_int16_host_endian() inline function in filter.h
This allows to omit the ugly byte-swapping in osx_write we've had
before.