Commit Graph

340 Commits

Author SHA1 Message Date
Max Kellermann
4b2b89eb5e lib/xiph: add "noexcept" 2017-11-12 18:35:49 +01:00
Max Kellermann
4b2bb88375 lib/upnp: add "noexcept" 2017-11-12 18:33:58 +01:00
Max Kellermann
fb01e41e8a lib/sqlite: add "noexcept" 2017-11-12 18:26:03 +01:00
Max Kellermann
ff9759c09d lib/pulse: add "noexcept" 2017-11-12 18:25:16 +01:00
Max Kellermann
a92e0e8540 lib/nfs: add "noexcept" 2017-11-12 18:09:07 +01:00
Max Kellermann
9d47b220a4 lib/curl: add "noexcept" 2017-11-12 17:49:58 +01:00
Max Kellermann
cf483107c9 event/IdleMonitor: add "noexcept" 2017-11-12 17:40:25 +01:00
Max Kellermann
44c60567dd output/alsa: add "allowed_formats" setting
Allows defining a list of supported audio formats, and allows
switching on and off DoP with certain formats.

This is a first rough draft.  The setting syntax and its semantics may
still be redesigned.
2017-11-10 23:05:50 +01:00
Max Kellermann
1ccd2a7b11 lib/nfs: migrate from DeferredMonitor to DeferEvent 2017-11-10 21:06:40 +01:00
Max Kellermann
4c1d29c86c lib/nfs/FileReader: use C++11 initializers 2017-11-10 21:03:41 +01:00
Max Kellermann
7e16ac305d event/SocketMonitor: rename Get() to GetSocket() 2017-11-10 20:34:45 +01:00
Max Kellermann
59a8836924 event/SocketMonitor: add "noexcept" 2017-11-10 20:20:07 +01:00
Max Kellermann
49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00
Max Kellermann
e2a74051dc lib/alsa/HwSetup: return effective parameters 2017-10-26 12:13:00 +02:00
Max Kellermann
b7e035b6f3 output/alsa: move AlsaSetupHw() to lib/alsa/HwSetup.cxx 2017-10-26 11:15:01 +02:00
Max Kellermann
890f1f5928 lib/alsa/Format: move HAVE_ALSA_DSD* definitions from the Alsa output plugin 2017-10-26 09:39:18 +02:00
Max Kellermann
b30c37eb79 output/alsa: move functions to lib/alsa/Format.hxx 2017-10-26 09:30:45 +02:00
Max Kellermann
b08cb148ae output/alsa: move class PeriodBuffer to lib/alsa/PeriodBuffer.hxx 2017-10-26 09:27:36 +02:00
Max Kellermann
2a6d5583d1 lib/alsa: add "noexcept" 2017-10-26 08:24:14 +02:00
Max Kellermann
6fa403edd9 lib/upnp/Discovery: migrate from DeferredMonitor to DeferEvent 2017-09-21 22:53:57 +02:00
Max Kellermann
431eb7bc8c lib/curl/{Global,Request}: migrate from DeferredMonitor to DeferEvent 2017-09-21 22:53:17 +02:00
Max Kellermann
f6691579de Merge branch 'v0.20.x' 2017-09-20 23:57:28 +02:00
Max Kellermann
828f5f8384 lib/icu/CaseFold: disable broken strxfrm() callback 2017-09-20 23:55:14 +02:00
Max Kellermann
1295a1272a lib/icu/Compare: add fallback using strcasecmp() and strcasestr()
Our IcuCaseFold() fallback using strxfrm() is not actually case
insensitive.  This commit fixes the problem by switching to
strcasecmp().  That function is not guaranteed to support UTF-8, but
it's the best we can do in this sparse situation.

Closes #111
2017-09-20 23:43:27 +02:00
Max Kellermann
d0497dba92 lib/icu/Compare: OO wrapper for IcuCaseFold() 2017-09-20 23:32:55 +02:00
Max Kellermann
42914e8227 lib/icu/CaseFold: add "noexcept" 2017-09-20 23:32:54 +02:00
Max Kellermann
5620f16330 lib/icu/Collate: move IcuCaseFold() to CaseFold.cxx 2017-09-20 23:11:58 +02:00
Max Kellermann
be024d4ad7 lib/icu/Collate: remove unnecessary assert() 2017-09-20 23:05:31 +02:00
Max Kellermann
9744f437d8 Util/CharUtil: add wchar_t overloads
Needed for WStringView.
2017-09-12 18:22:02 +02:00
Max Kellermann
91d4b5cfed lib/nfs/Connection: migrate from TimeoutMonitor to TimerEvent 2017-08-29 16:36:16 +02:00
Max Kellermann
c24b8460e0 lib/curl/Global: migrate from TimeoutMonitor to TimerEvent 2017-08-29 16:33:20 +02:00
Max Kellermann
8225064aab lib/upnp/Discovery: add missing include
Got lost in commit e5ee357903
2017-08-29 13:41:03 +02:00
Max Kellermann
e5ee357903 lib/upnp/Discovery: use DeferredMonitor instead of BlockingCall() 2017-08-25 11:01:30 +02:00
Max Kellermann
8aef518c05 lib/upnp/Discovery: add method GetEventLoop() 2017-08-25 10:59:49 +02:00
Max Kellermann
309ed77ef4 lib/upnp/Device: use std::string::find() instead of ...find_first_of() 2017-08-25 10:57:40 +02:00
Max Kellermann
9a6d2b791f lib/upnp/Discovery: avoid a std::string copy 2017-08-25 10:55:30 +02:00
Max Kellermann
2a5010a426 lib/upnp/Discovery: remove obsolete comment 2017-08-25 10:16:19 +02:00
Max Kellermann
be29da46f8 lib/upnp/Discovery: use std::list::remove_if() 2017-08-25 10:14:18 +02:00
Max Kellermann
d0734e27ba lib/upnp/Discovery: use range-based "for" 2017-08-25 10:11:35 +02:00
Max Kellermann
c8f7a859ea lib/upnp/Discovery: use CURL instead of UpnpDownloadUrlItem()
We can do CURL requests asynchronously, and we don't need a
synchronous WorkQueue thread for that.

This allows parallelizing lookups and allows immediate cancellation.
2017-08-25 09:52:44 +02:00
Max Kellermann
95637fd153 lib/upnp/Discovery: use strncmp() instead of memcmp()
memcmp() can overflow the buffer.
2017-08-18 18:48:22 +02:00
Max Kellermann
b7d0890bc0 lib/curl/Init: share a CurlGlobal instance between input and storage 2017-08-18 13:34:55 +02:00
Max Kellermann
492b20a89d event/SocketMonitor: use class SocketDescriptor 2017-08-10 19:19:58 +02:00
Max Kellermann
4e113a7086 lib/nfs/Connection: use class SocketDescriptor 2017-08-10 17:37:19 +02:00
Max Kellermann
501a4af914 util/StringUtil: move strip functions to StringStrip.cxx 2017-07-05 17:20:02 +02:00
Max Kellermann
979f1b6c39 release v0.20.9
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkz5jkQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEubuD/kBXMcV4XawqGNNtSHdrY8CxSL8wJMCMJQl
 aMgRkKLPRml8Hj9FNNG9pjXBuT+qUgPX7t9gBEiT7c+sV3fHH40gUf1js5GIsEPm
 BAVfvww5EhmQWWVhPTLk1iZ4jp6E96mDmIG1znwo7etSZHXU8RJfR7woBi3SPJ9f
 OPcrimskNuWpAWeaEIKi/1Iwzy8d9VK9Ttb73gA3M5zSm7ioXzt3YClpwLRM8JU6
 QeUJchy6VwXnygswjUNmbhPc3GsD2FyUZ4OtJ0hodnqqajfldBxhcHUnQk4zZULr
 1nLSyOuA9bwLuFohH1T6HiY9z8PFzgqdIHvsjOJgZ4gQa69PVNjal2tUEUav9zFv
 aK4LvTVPnIk+hqRbtLpV7/rPKuClrC9BO4oYdBGBDNY4hqVpvRA9obP1s00aOi+K
 UhYqLqg7yeIEeTlUxFOhXJCKAEL69BuXT5ihJtDlB/dCUzv37sEch/4WDgs7uc+O
 9kJYlElvozw57mbczsee/PCSnSWrLCq/qG/bNEUUQOTueWNuifh3PL62UXGgfbEH
 01hJDyLr6ETSmWn7rjTfLJiHThX/EQQvOhs+35fbCyry65z4tFwrilGDmFVUWGPq
 /6QEpY1D6q4fkoma/iWOZoTkfKewatAPGMGWoJaGhCnfQFz4VTFtS2bDtuUctQ16
 jnXnPFxqBw==
 =0SSp
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.9'

release v0.20.9
2017-06-04 12:57:05 +02:00
Max Kellermann
a057b4f6d8 *: add lost of "noexcept" specifications 2017-06-04 12:46:48 +02:00
Max Kellermann
c5996c0593 *: add "noexcept" to many, many function prototypes
See commit 71f0ed8b74
2017-05-15 23:05:45 +02:00
Max Kellermann
4faef28cc5 release v0.20.7
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlkaFL0QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEr4ID/9iAQC+7fFv06uLOm48Ufu+PgoD8uJkAwF5
 QuLQkc85g9urn+bu9N7Qs7Vypp7aLyGcJKY0jyA8wxkOj24pUC3GYk80daUt561V
 5s20FnoS/Uoman3CSJL94IfCUBxejizE6vgIIHTc5bb6U0qIsPub/8JTTE2Ih7uP
 nvFZ5uBQ+YTc7at+iIH9123eUMKkitkh8osNblovqQT9v42++Tm4ztAytRHBjwUA
 Itew5HhlvahbLKqFs/7vmICh/YX1FcOV7cV+erEWYfkH0KCI2bhSle4u2d0CBOvD
 VJlDnBCo9bM7WKcPYqJiFFFXA0CRk06wbkkkAtwF4zjp8xos7aQcq4FyQnYL8KXo
 5lijIhRwBURBd+nt8oA9kuEhBt/T75otcemJkzVaYappHTJCLjhxSGcPt8mw+nE9
 9WQzsp/MIVzg9l5g3D9S/43xM7uhvn98Tn1Qf2s8YRd2o8CZeOhW+X3RvbCvVPv2
 mOlx4sFAv8DOJ3KxMdqiJT+PmylPyJluQdqH+tMc8BdPg/kpSpYIPTuSjjRqK1yh
 ld5do0HtAAwiHtvXfk5YVFjJSpO0c8yVn6xci2Cl4k/5ZHj2UE1ln+N5vCea2BRF
 2J3HAjROwtcwY3lU1jFnEAogf24KWiFJqhhC0EqBGUdlrM8Dn37P5cEWWjROIMNK
 lPEdovokNw==
 =CdDy
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.7'

release v0.20.7
2017-05-15 23:01:49 +02:00
Max Kellermann
788e3b31e1 *: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a
recent clang version implements an optimization which pushes the
definition's boundary beyond what I believed it was.  clang now
assumes that functions declared "pure" cannot throw exceptions, even
if they lack the "noexcept" specification.

When compiled with this new clang version, MPD will crash randomly if
an exception happens to get thrown by such as "pure" function
(https://github.com/MusicPlayerDaemon/MPD/issues/41).

This commit removes all such misplaced "pure" and "const" attributes,
closing #41.
2017-05-08 17:25:06 +02:00
Max Kellermann
71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann
b4e4bdcda9 lib/alsa/Version: wrapper for snd_asoundlib_version() 2017-03-29 20:33:06 +02:00
Max Kellermann
e26d49efb7 release v0.20.6
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAljCzQcQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEnIXD/9ltsmg3VC81NHOmcUehFgUaLyNh8o2iEr9
 tQfdydQxfTXBIGztMoPsPz71da8BIqAgMTCTGAEpTUXIW6ViGkgsoDlR2fAOagG2
 ybHn2q3WsPERJvkGZ4xIo0ti0pLLy7wrFpmShgOKuwb6YqOgSV+rbu/CaQanxVJE
 S599vo6rV/OI4KFSYWJbfafifN/Mqmzfl/D/tB5xaMvhas60XZ6pZTp/xH8OlnML
 8qkgPmN3gJe7DPq6L3rdwKobJuS1X6NLHSp1DyGVRy68B0sd3tMmbOocMeyi1OlE
 1z/n/M+dcSUhdHAh/Pg0wrvH0UpUlJ11blSDiWB9gqr9oOvCZO+OcPCnk0QJrqq+
 qselDNWBLvVPESbxlPO4OUbV6jxPPhVgz18RYl6JaJeUFjXkuiytI/t6jsbVM3+f
 ZC1UgO+TznCuDjjMj35RP9QDkUQpuH6CK4+tyxbH7Fe4KQi02FQdtK8Q/CnESBLl
 alTLYQk7VlwL1oMgezoZfTLDbsihRrEO6Y0cp/pObUrEjQ65706UGUf61PRQGBM9
 DlEPqfuH8TMgksxDIrkt68pWjyCXhhUCA+RsyFJoMp7Xq6Gy2pZUn2yKCmTXLte/
 v5xW9FuiSvKUKlvYbfk/q3u/GTCJELf0eY3y0Eryqp6nOEZHmzz8HOF7Bs2PxM3B
 eU/fEKWxVQ==
 =21bM
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.6'

release v0.20.6
2017-03-10 17:02:32 +01:00
Max Kellermann
ac8dce6599 lib/curl/Request: "ICY 200 OK" is a response boundary header 2017-03-10 16:28:02 +01:00
Max Kellermann
190d525099 lib/curl/Request: move code to IsResponseBoundaryHeader() 2017-03-10 16:24:30 +01:00
Max Kellermann
9e503b21c1 {input,mixer}/alsa: move code to lib/alsa/NonBlock.cxx 2017-02-09 21:24:24 +01:00
Max Kellermann
03a97d87ea tag/Tag*: rename several source files 2017-02-08 08:49:42 +01:00
Max Kellermann
53c14d97a6 lib/nfs/FileReader: remove debug line 2017-02-08 08:43:56 +01:00
Max Kellermann
45cadef22f configure.ac: prepare for 0.20.5 2017-02-06 23:28:36 +01:00
Max Kellermann
df4af2b550 release v0.20.4
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAliSTDkQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEsIQD/4iNkylzLp8mID2aFT690MFzv4TRXi2XS7v
 r3Rlx3hpGyDdzeXZeFc5zxsc9Ei8OfLcdFC/Umj9LjQanXakOxwsdhagrW9cadNX
 YLxkyVcREXalmzUvoWeRnya1LjoTdYA8llvG2tAJosXVr0o/GHZi56aHcrYnW2a6
 XD8kEk5k9beuEcBLk1rdZCTGPbVLwCFvMcpZ7j5Hd4kDGQjjw2aoEaPWchJdhLQh
 p+GRSU+A8hyTo9zy+aNO3cKvq6zqVxDLlHnIqh8XPWQoLPyWuD7ETvwERKmdmiPZ
 bSo0MR7azTlhkWbNZxjPHgZuacJDlwKvXPg1ofjn8VVcaVe5ONeX+1WP0ozUYqyU
 fmhLxMHKuwZcKo6do/jNhAVp//VBWhSwJHPA8kjBTuZHHc0HvgyTxlAgvzlrSswe
 dxc8vnvzgJfUKz5k7mf3amVg6Cu1CmNi59CkyL0NL+8N0inyMfdeQuQEYgbPoI6X
 jIRwACfXpMX75VtiDaNpnFLBjL5emE6u2bDoU2c5ezgpthaWjb0PqSmoLBBF8TNm
 k0ecXlIwCjT3pDcqmFdqgG3AJiYLTgX0rETC8PInl6toLzr2oVMVlijU3YK5PjMl
 nTvgs8TwprTWImgcBnidqRMb39p3AKs12pHfZ4Y5Iu82Bm60acZQMkv6sQh43Wyc
 +W2+T3D2IA==
 =b2Fz
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.4'

release v0.20.4
2017-02-01 22:05:33 +01:00
Max Kellermann
591afa0647 lib/nfs/Connection: detect socket hangup and unregister from epoll
Fixes race condition when epoll_ctl() gets called after the socket has
been closed, which may affect a different socket created by another
thread meanwhile.
2017-02-01 21:44:20 +01:00
Max Kellermann
05eac20ffe lib/nfs/Connection: detect libnfs reconnect
When rpc_reconnect_requeue() gets called from inside nfs_service(),
the NfsInputStream can stall completely because the old socket has
been unregistered from epoll automatically, but the new one has never
been registered.  Therefore, nfs_service() will never be called again.

This kludge attempts to detect this condition by checking
nfs_which_events()==POLLOUT.

https://bugs.musicpd.org/view.php?id=4081
2017-02-01 21:36:58 +01:00
Max Kellermann
add953fb6e lib/curl/Global: decouple from the IOThread library 2017-01-26 09:29:49 +01:00
Max Kellermann
6d5904801e lib/nfs/FileReader: use nfs_get_event_loop()
Make sure we're using the same EventLoop as the NfsManager.
2017-01-26 09:23:49 +01:00
Max Kellermann
d4993c405e lib/nfs/Glue: add EventLoop& accessor 2017-01-26 09:23:25 +01:00
Max Kellermann
611ce6e756 lib/nfs/{FileReader,Glue}: pass EventLoop&
Eliminate dependency on io_thread_get().
2017-01-25 23:02:02 +01:00
Max Kellermann
44dd9af276 lib/upnp/Util: pass single delimiter character to stringToTokens() 2017-01-23 19:34:55 +01:00
Max Kellermann
d3013d4f8c lib/upnp/Util: remove parameter "skipinit", always true 2017-01-23 19:28:07 +01:00
Max Kellermann
678524ad21 lib/upnp/WorkQueue: fix race condition
With "ok==false", newly created threads may quit instantly.
2017-01-23 19:25:30 +01:00
Max Kellermann
32a64481f2 lib/upnp: fix bad std::chrono cast
libupnp provides seconds, not whatever time unit is used by
std::chrono::steady_clock.
2017-01-23 19:16:14 +01:00
Max Kellermann
ec8cba369c lib/upnp/WorkQueue: disallow copying 2017-01-23 18:35:58 +01:00
Max Kellermann
f4c248f406 lib/upnp/WorkQueue: make constructor explicit 2017-01-23 18:35:47 +01:00
Max Kellermann
f3b2a58646 lib/upnp/WorkQueue: use C++11 initializers 2017-01-23 18:35:22 +01:00
Max Kellermann
6eea56861b AUTHORS, ...: update my email address 2017-01-17 11:54:55 +01:00
Max Kellermann
6c293a3d7f lib/nfs: add more API documentation 2017-01-15 00:58:49 +01:00
Max Kellermann
58fb36bdb9 storage/http: new storage plugin 2017-01-08 14:40:20 +01:00
Max Kellermann
4297a7b0a4 lib/curl/Request: move exception handling out of the WRITEFUNCTION
libcurl's WRITEFUNCTION is pretty fragile; if we destroy the CURL*
instance or even unregister it using curl_multi_remove_handle(),
libcurl will crash instantly.  But still we need to be able to handle
exceptions from inside the WRITEFUNCTION, and call
CurlResponseHandler::OnError(), which may destroy the whole thing.  As
a workaround, I use DeferredMonitor to postpone the OnError() call
into a stack frame which is allowed to destroy the request.
2017-01-08 14:36:27 +01:00
Max Kellermann
1bab6d0dd7 lib/curl/Request: move catch clause out of FinishHeaders
Let the caller decide what to do with the exception.
2017-01-08 14:36:27 +01:00
Max Kellermann
13b85edbe2 lib/curl/Request: postpone the curl_easy_cleanup() call
When the request is done, only unregister the CURL* handle, but do not
delete it yet - it may still be needed for CURLINFO_RESPONSE_CODE.
2017-01-08 13:51:53 +01:00
Max Kellermann
dc53098e43 lib/curl/Request: allow Stop() to be called twice
Convert assertion to runtime check.  This is useful because this is a
public method, and the caller has no chance to check if the object is
still registered.
2017-01-08 13:51:53 +01:00
Max Kellermann
3c66feff5a lib/curl/Global: defer the ReadInfo() call
Fixes a crash that can occur due to recursion from InvalidateSockets()
to ReadInfo() to CurlRequest callbacks.
2017-01-08 12:46:35 +01:00
Max Kellermann
218c3bc0d5 lib/curl/Multi: fix typo 2017-01-08 12:46:35 +01:00
Max Kellermann
9f5eddcd13 lib/curl/Global: move code to UpdateTimeout() 2017-01-08 12:44:07 +01:00
Max Kellermann
3cba76552b lib/curl/Global: drop redundant ">=0" check 2017-01-08 12:44:04 +01:00
Max Kellermann
e98a8b624b lib/curl/Global: drop redundant "virtual" 2017-01-08 12:41:26 +01:00
Max Kellermann
981dc0626b lib/expat/ExpatParser: add constructor overload for XML_ParserCreateNS() 2017-01-07 16:17:53 +01:00
Max Kellermann
8986d14e98 lib/expat/ExpatParser: make constructors "explicit" 2017-01-07 16:15:11 +01:00
Max Kellermann
5163b1a624 lib/curl/Request: require the caller to explicitly register the request
This allows constructing an instance in any thread, and register it
inside the IOThread later.
2017-01-07 16:01:58 +01:00
Max Kellermann
860aa9d6d0 lib/expat/ExpatParser: move InputStream overload to separate source file
Eliminate one unnecessary dependency for debug programs which don't
need the InputStream API.
2017-01-07 15:46:36 +01:00
Max Kellermann
6cff3214f3 lib/curl/Slist: new wrapper for curl_slist 2017-01-06 19:37:31 +01:00
Max Kellermann
5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann
06116382ee input/curl: move code to class CurlRequest
The CurlRequest gives us a more low-level API to CURL without the
InputStream interface, integrated into our IOThread.
2017-01-03 12:24:05 +01:00
Max Kellermann
3e8cc2c670 input/curl: move class CurlGlobal to separate source file 2017-01-03 10:50:02 +01:00
Max Kellermann
2e182e84c3 thread/Mutex: remove ScopeLock, use std::lock_guard directly 2017-01-03 07:11:57 +01:00
Max Kellermann
7ec707927d lib/nfs/Blocking, neighbor/smbclient: pass std::chrono::duration to Cond::timed_wait() 2016-12-29 11:37:18 +01:00
Max Kellermann
a161d404ad lib/xiph/OggSerial: use std::chrono::steady_clock 2016-12-28 22:17:59 +01:00
Max Kellermann
cd607cb280 lib/upnp/Discovery: use std::chrono::steady_clock 2016-12-28 22:06:06 +01:00
Max Kellermann
4e60ab7f53 lib/upnp/Discovery: use C++11 initializers 2016-12-28 22:05:31 +01:00
Max Kellermann
b042095ac2 event/Loop: use std::chrono 2016-12-28 01:15:08 +01:00
Max Kellermann
fc83d38e67 input/curl: wrap CURLM* in new class CurlMulti 2016-12-19 16:41:12 +01:00