Commit Graph

1851 Commits

Author SHA1 Message Date
Max Kellermann 4f83c60296 copyright year 2014 2014-01-13 22:31:55 +01:00
Max Kellermann 27ca0db7a6 util/Alloc: new library replacing GLib's g_malloc() 2014-01-07 23:35:18 +01:00
Max Kellermann 793962c5b8 event/SocketMonitor: don't close the socket automatically
Users now have to call Close() explicitly.  This simplifies using the
class, as most users have automatic socket management already, and
Steal() had to be used often.
2014-01-06 18:26:55 +01:00
Max Kellermann 0d20130d07 util/Cast: new utility library 2014-01-06 18:21:45 +01:00
Max Kellermann 4ddfc6e9a2 output/httpd: move the clients.clear() call to the IOThread
This call is not thread-safe.
2014-01-05 02:13:35 +01:00
Max Kellermann dcbc05a9cd output/httpd: import GetEventLoop() 2014-01-05 02:13:21 +01:00
Max Kellermann bfe7533546 output/httpd: move Bind()/Unbind() to the IOThread
Fixes more thread-safety bugs.
2014-01-04 19:29:51 +01:00
Max Kellermann c9da3363a0 output/httpd: move all broadcast operations to the IOThread
Add a Page queue to class HttpdOutput, and use DeferredMonitor to
flush this queue inside the IOThread.  This fixes a thread-safety
issue: much of EventLoop is not thread-safe, and the httpd plugin
ignored that problem.
2014-01-04 18:22:55 +01:00
Max Kellermann 9bd4ed3e60 output/httpd: use the IOThread
Do all I/O in the IOThread and not in the main thread.  This solves an
upcoming deadlock problem.
2014-01-04 18:21:40 +01:00
Max Kellermann 68fcc19565 output/httpd: move queue size check to HttpdClient::PushPage()
Don't let the server care for client problems.
2014-01-04 17:42:03 +01:00
Max Kellermann 8e4efd071e output/httpd: wrap the std::list in std::queue 2014-01-04 17:12:59 +01:00
Max Kellermann f2ad9f6fad output/httpd: merge duplicate code to ClearQueue() 2014-01-04 17:11:22 +01:00
Max Kellermann 968c5eb767 output/httpd: keep track of queue size
Don't iterate the std::list each time.
2014-01-04 17:06:05 +01:00
Max Kellermann d477a9222e output/httpd: change "struct" to "class" 2013-12-31 17:04:40 +01:00
Max Kellermann 69a9d29190 output/httpd: move code to methods Delay(), Play(), Cancel() 2013-12-31 17:01:08 +01:00
Max Kellermann e2425592b6 output/httpd: move Cast() into the class 2013-12-31 16:59:24 +01:00
Max Kellermann 964b2661d8 output/httpd: add methods Init(), Finish() 2013-12-31 16:55:26 +01:00
Max Kellermann 8b65b524d5 output/httpd: use reference instead of pointer 2013-12-31 16:32:33 +01:00
Max Kellermann f1ac2cd336 output/httpd: make the HttpdClient base class "private" 2013-12-31 16:24:51 +01:00
Max Kellermann 45ad7696fe output/osx: fix typo 2013-12-19 12:46:21 +01:00
Max Kellermann 0e84d71559 output/osx: use DynamicFifoBuffer instead of struct fifo_buffer 2013-12-19 12:16:29 +01:00
Max Kellermann 65b8e52d80 output/alsa: use new[] instead of g_malloc() 2013-12-14 22:17:19 +01:00
Max Kellermann c7b1038a9d Merge branch 'v0.18.x' 2013-12-14 12:37:16 +01:00
Lukas Stabe 695ca29274 output/osx: fix build failure 2013-12-10 19:19:31 +01:00
Max Kellermann e1901e97c2 system/Resolver: sockaddr_to_string() returns std::string()
No GLib memory allocation.
2013-12-04 08:43:55 +01:00
Lukas Stabe 0ea5f4ac3a output/openal: check __APPLE__ instead of HAVE_OSX
On OSX, the configure-flag --enable-osx is used to enable the
unsupported osx output. It sets the HAVE_OSX preprocessor define.

src/output/OpenALOutputPlugin.cxx uses this define to determine wether
it is building on OSX, and imports different headers (which have
nothing to do with the osx output) depending on wether or not it is
set.
2013-12-02 13:08:52 +01:00
Max Kellermann f90abe9530 include cleanup using iwyu 2013-11-28 11:50:54 +01:00
Denis Krjuchkov 22fb49fa90 HttpdOutputPlugin.cxx: fix null pointer dereference 2013-11-26 18:13:23 +06:00
Max Kellermann 188673b746 output/httpd: don't use incomplete template argument with libc++ 2013-11-11 08:31:50 +01:00
Max Kellermann 62baec1841 output/alsa: avoid endless loop in Raspberry Pi workaround
See code comment.
2013-11-04 23:40:34 +01:00
Max Kellermann ecf12a60e8 Log: add level "DEFAULT"
Map LogLevel::INFO to G_LOG_LEVEL_INFO, and LogLevel::DEFAULT to
G_LOG_LEVEL_MESSAGE.  Now client connect/disconnect message are only
logged on log_level "secure".
2013-11-04 22:27:49 +01:00
Max Kellermann 8555b65c50 *: update copyright year to 2013 2013-10-30 23:37:06 +01:00
Max Kellermann 20597b3632 *: use nullptr instead of NULL 2013-10-28 23:58:17 +01:00
Oddegamra 5f13c1cd9c output/httpd: accept icy-metadata with and without space
Some, or most, Win32 audio players will pass "icy-metadata:1" to
streaming servers. MPD expects a space between ":" and "1" at this
point, and thus does not send any stream metadata. This applies to
foobar2k and Winamp, for example.

According to forums.radiotoolbox.com/viewtopic.php?t=74 not having
a space there is expected behavior, so maybe MPD could accept
both forms to determine if metadata should be sent or not.
2013-10-26 16:32:00 +02:00
Max Kellermann e17da71a70 output/httpd: support HEAD requests 2013-10-25 00:32:48 +02:00
Max Kellermann 610bef9ff5 output/httpd: remove bogus assertion 2013-10-25 00:26:02 +02:00
Max Kellermann 222dc8a239 Util/ASCII: add StringEqualsCaseASCII() overload with length
Replaces GLib's g_ascii_strncasecmp().
2013-10-21 08:42:55 +02:00
Max Kellermann a78b2d84ed TagType: rename enum tag_type to TagType 2013-10-20 13:32:59 +02:00
Max Kellermann 5dc4cbdf82 util/FormatString: new library to replace g_strdup_printf() 2013-10-19 17:24:21 +02:00
Max Kellermann abfbd55305 fs/Path: rename to AllocatedPath
The new class Path only holds a string pointer without being
responsible for allocation/deallocation.  The FileSystem.hxx library
accepts Path arguments instead of AllocatedPath, to avoid forcing
callers to allocate another string object.
2013-10-17 23:43:46 +02:00
Max Kellermann 5e26e2ab1d system/ByteOrder: new library for byte ordering / endianess
Replacing GLib macros.
2013-10-16 22:09:44 +02:00
Max Kellermann 328131b7aa output/roar: use const_cast instead of g_strdup() 2013-10-15 23:14:34 +02:00
Max Kellermann 85003429af output/roar: use std::string 2013-10-15 23:11:32 +02:00
Max Kellermann 6db77dcf75 output/roar: move code into the RoarOutput class 2013-10-15 22:58:38 +02:00
Max Kellermann 1cde86823d output/pipe: use std::string 2013-10-15 22:52:04 +02:00
Max Kellermann 12ab556477 event/BufferedSocket: pass writable pointer to OnSocketInput()
Remove the const_cast from HttpdClient.cxx, and avoid one allocation
in ClientRead.cxx.
2013-10-15 22:47:46 +02:00
Max Kellermann 509f8dab89 Util/Macros: replacement for GLib's G_N_ELEMENTS() 2013-10-15 22:47:39 +02:00
Max Kellermann 77429b6dd3 output/winmm: use delete instead of g_free() 2013-10-15 22:47:25 +02:00
Max Kellermann be2951b45f gcc.h: rename to Compiler.h 2013-10-15 09:21:59 +02:00
Max Kellermann 6fd481df97 Mapper, ...: use memcmp() instead of strncmp() where appropriate
Micro-optimization.
2013-10-14 22:00:21 +02:00