Andre Noll [Mon, 4 Feb 2008 19:41:00 +0000 (20:41 +0100)]
http_send.c: Fix a bug in http_post_select().
If the accept() on the listen_fd fails, we don't have a valid
file descriptor but tried to close it anyway. Even worse, the
old code dereferenced and then freed the "sc" pointer which
isn't inititialized at that point.
Andre Noll [Sat, 2 Feb 2008 20:28:51 +0000 (21:28 +0100)]
Intoduce send_common.c and use it from the dccp sender.
This new file contains code that was identical for the
dccp and the http sender. A subsequent patch will convert
the http sender to also use the shared code in send_common.c
Andre Noll [Sat, 2 Feb 2008 11:20:22 +0000 (12:20 +0100)]
dccp_send.c: Fix a header sending bug.
If the dccp sender is asked to send out an empty chunk, it
returns immediately without doing anything. However, we
might want to send the audio file header or the queued chunks
in this case. So always loop over all connected clients to see
if we can send something.
Moreover, if we are not listending on the dccp port, there can
not be any dccp clients, so the loop over all clients will be
an empty loop. Thus we may skip the initial check for an early
return completely.
Andre Noll [Sat, 2 Feb 2008 10:50:42 +0000 (11:50 +0100)]
http_send.c: Get rid of HTTP_READY_TO_STREAM.
The only reason for this state was to know whether we
already sent the audio file header. Store this info in
the new header_sent member of struct http_client.
This simplifies the code a bit and makes it more similar
to the dccp sending code.
Andre Noll [Mon, 21 Jan 2008 08:24:16 +0000 (09:24 +0100)]
Be more careful on command exit.
If the callback returned zero, there's nothing to do.
If it returned positive, we have to send out the result
buffer and must free it afterwards. Sending the buffer may
well lead to an error condition, so always check the return
value of the corresponding call to send_buffer(). Finally,
it the command handler returned a negative value, we have
to send an error message to the client which might give rise
to another error (if sending the errror message failed). In this
case, ignore the send errror and return the previous error value.
Andre Noll [Sat, 19 Jan 2008 11:57:59 +0000 (12:57 +0100)]
Get rid of sender->status.
DRY: For the http and the dccp sender, the status is given by
the value of the listening fd. For the ortp sender, introduce
the new static int sender_status.
Andre Noll [Thu, 17 Jan 2008 20:50:20 +0000 (21:50 +0100)]
vcc.c: Fix a memory leak in recv_afs_result().
This function contained a code path that allocated
the buffer for the chunk table and then returned an error
(due to a failing fstat()) without freeing the chunk table
buffer.
Andre Noll [Thu, 17 Jan 2008 20:40:38 +0000 (21:40 +0100)]
net.c: Fix a memory leak in makesock().
"port" was allocated dynamically but never freed. Fix it by
using a static buffer instead. This buffer can not overflow as
"port_number" is an unsigned short, so its decimal representation
consists of at most 5 digits.
Andre Noll [Fri, 11 Jan 2008 13:15:41 +0000 (14:15 +0100)]
Remove man pages from tarball.
Since they are re-created at make install time anyway and help2man
is now considered a required tool for building paraslash, there is
no reason to ship the pre-generated man pages with the tarball. This
reduces the size of the tarball by about 2k.
Thanks to Johannes Wörner for pointing out this inconsistency.
Andre Noll [Fri, 11 Jan 2008 13:03:49 +0000 (14:03 +0100)]
REQUIREMENTS: Move help2man to the list of required software.
The man pages depend on the executables, i.e. make rebuilds a man page
whenever the corresponding executable changes. Therefore help2man is
required even when installing from tarballs.
Andre Noll [Mon, 7 Jan 2008 15:27:31 +0000 (16:27 +0100)]
Fix configure on Solaris.
Without this patch, configure fails on Solaris because it doesn't find
inet_ntoa() and socket(). These are in libnsl and libsocket
respectively, but AC_CHECK_FUNCS() doesn't know this.
Andre Noll [Sat, 29 Dec 2007 20:43:13 +0000 (21:43 +0100)]
Simplify para_basename().
No need to allocate additional memory. This saves a malloc/free
in the hot path of com_ls(), the only caller. Also take care for
the case basename == NULL.