Commit Graph

6986 Commits

Author SHA1 Message Date
Max Kellermann
b0bbb8b693 Client: use TimeoutMonitor to track connection timeout
Don't use a global loop over the whole client list.
2013-01-16 21:51:08 +01:00
Max Kellermann
cab84af72e Client: move "idle" functions into the class 2013-01-16 21:46:13 +01:00
Max Kellermann
74500eacca Merge branch 'v0.17.x' 2013-01-16 20:05:26 +01:00
Brice Jaglin
1105e61f29 decoder/ffmpeg: support float planar audio 2013-01-16 19:54:54 +01:00
Max Kellermann
b7cf279d6d zeroconf-avahi: eliminate "goto" 2013-01-16 00:23:00 +01:00
Max Kellermann
c614e550d9 valgrind.suppressions: more GLib suppressions 2013-01-15 23:44:21 +01:00
Max Kellermann
452a30d7af input/Curl: break loop when remaining length becomes 0
Fixes assertion failure (regression).
2013-01-15 23:39:32 +01:00
Max Kellermann
49e79620fd PlayerControl: initialise attribute "border_pause" 2013-01-15 23:21:14 +01:00
Max Kellermann
ae5a721df9 Playlist: initialise attribute "playing" 2013-01-15 23:09:18 +01:00
Max Kellermann
0dd5f2915a ServerSocket: use the SocketMonitor class 2013-01-15 22:56:06 +01:00
Max Kellermann
a0ebd444ad event/SocketMonitor: add method Open()
Allow creating a closed SocketMonitor instance.
2013-01-15 22:56:06 +01:00
Max Kellermann
0c6072c4e4 ServerSocket: move more code to methods 2013-01-15 22:53:14 +01:00
Max Kellermann
8917264110 ServerSocket, SocketUtil: use the SocketError library
Use WinSock errors on Windows.
2013-01-15 22:42:15 +01:00
Max Kellermann
e90d606f0a socket_util: convert to C++ 2013-01-15 22:41:56 +01:00
Max Kellermann
5bb2d64ddb SocketError: merge duplicate FormatMessage() calls
Make a class that contains the formatting code and the buffer.
2013-01-15 22:41:56 +01:00
Max Kellermann
bc66dc45e6 server_socket: convert to C++ 2013-01-15 21:42:55 +01:00
Max Kellermann
7087935656 output/httpd: convert to C++ 2013-01-15 20:20:51 +01:00
Max Kellermann
5822daa63d output_internal, ...: add extern "C" 2013-01-15 20:20:51 +01:00
Max Kellermann
4808c7ef39 encoder/{Vorbis,Opus}: use new/delete 2013-01-15 20:20:51 +01:00
Max Kellermann
7071126770 InotifySource: use the SocketMonitor class 2013-01-15 18:18:34 +01:00
Max Kellermann
2101daef5a mixer/Alsa: use MultiSocketMonitor 2013-01-15 18:18:00 +01:00
Max Kellermann
083065f433 input/Curl: move code to class MultiSocketMonitor 2013-01-15 18:16:55 +01:00
Max Kellermann
4cfc4a5a94 input/Curl: simpler GPollFD initialisation
Using initializer list.
2013-01-15 18:16:38 +01:00
Max Kellermann
1c7ee737e6 input/Curl: don't remove/add modified GPollFD
Not necessary, GLib will pick up the updated GPollFD automatically.
2013-01-15 18:16:15 +01:00
Max Kellermann
39439b80f5 Client: rebase on the new BufferedSocket class 2013-01-15 12:15:33 +01:00
Max Kellermann
396480cf94 event/SocketMonitor: wrapper class for GSource + GPollFD 2013-01-15 11:00:48 +01:00
Max Kellermann
3e03527930 Client: move output buffer code to new class PeakBuffer 2013-01-15 10:59:28 +01:00
Max Kellermann
4fa724461e util/fifo_buffer: add method _init() 2013-01-15 10:59:28 +01:00
Max Kellermann
1e2018ce83 Client: move connection functions into the class 2013-01-15 10:59:28 +01:00
Max Kellermann
3fcf17cb79 SignalHandlers: emit GlobalEvents::SHUTDOWN
.. instead of calling g_main_loop_quit(), which may dead-lock.
2013-01-15 10:59:28 +01:00
Max Kellermann
f9fc3a42cc fifo_buffer: move to util/ 2013-01-15 01:02:13 +01:00
Max Kellermann
76bc28ab1e fifo_buffer: add extern "C" 2013-01-15 01:01:25 +01:00
Max Kellermann
f47f86ef02 socket_error: new library for errno / WSAGetLastError() 2013-01-15 00:53:12 +01:00
Max Kellermann
31268ffa24 io_error: add function new_error_errno() 2013-01-15 00:53:12 +01:00
Max Kellermann
0634be9724 Client*: include check.h / config.h 2013-01-14 23:50:01 +01:00
Dark Raven
f56c6a18c1 ClientList: allow deleting clients in client_list_foreach() callback 2013-01-14 11:24:54 +01:00
Max Kellermann
aa4c506fcd Revert "ClientList.cxx: copy client list before iterating"
This reverts commit f53dadcc6d, to
prepare for a better solution.
2013-01-14 11:24:29 +01:00
Max Kellermann
d3a479b7fa event/TimeoutMonitor: wrapper for g_timeout_source_new() 2013-01-14 11:12:28 +01:00
Max Kellermann
92fb0e829a StateFile: convert to a class 2013-01-14 11:00:22 +01:00
Max Kellermann
43a9928537 gcc.h: add C++11 "final" fallback macro 2013-01-14 10:56:42 +01:00
Max Kellermann
c8b408beae InotifyQueue: convert to a class 2013-01-14 10:13:28 +01:00
Max Kellermann
8e3982dd42 InotifySource: convert to a class 2013-01-14 10:08:26 +01:00
Max Kellermann
e83f805b8f Main, IOThread: move GMainLoop setup code to class EventLoop 2013-01-14 09:15:49 +01:00
Max Kellermann
be98afe34d IOThread: use gcc.h 2013-01-14 09:15:49 +01:00
Denis Krjuchkov
f53dadcc6d ClientList.cxx: copy client list before iterating
It seems that it is not safe to remove the item from std::list
while it's being iterated somewhere else.

This is a very simple quick fix to make things work
until some better solution is implemented.
2013-01-13 15:36:25 +06:00
Denis Krjuchkov
90ab65f8c7 WakeFD.cxx: use two sockets instead of pipe on Win32
Pipes aren't really pollable on Windows.
GLib emulates polling on pipes using separate reader/writer threads.
This adds significant overhead and keeps a strong dependency on GLib.

socketpair() function is absent on Windows as well.
We implement it here in a loose way.
2013-01-13 15:30:53 +06:00
Denis Krjuchkov
abb0fcb203 Win32Main.cxx: more clean shutdown
This change fixes two issues:

1) console_handler is called from a separate thread.
   Thread-safe primitive is required for correct operation.

2) If console_handler returns TRUE our process is immediately terminated.
   We use Sleep() to give main thread an opportunity to shutdown correctly.
2013-01-13 15:20:32 +06:00
Denis Krjuchkov
eef4f33a29 configure.ac: use correct variable for checking libmpdclient presence 2013-01-11 16:47:56 +06:00
Max Kellermann
0226440a2d thread/{Mutex,Cond}: new backend for WIN32
Use CRITICAL_SECTION and CONDITION_VARIABLE.  This requires Windows
Vista or newer.  It fixes problems with GLib threading objects that
were implicitly created by static constructors before g_thread_init().
2013-01-11 11:11:07 +01:00
Max Kellermann
9d770d6084 GlobalEvents: #undef DELETE on Windows
Work around a build failure due to windows.h macro.
2013-01-11 11:10:46 +01:00