Commit Graph

471 Commits

Author SHA1 Message Date
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 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 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 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 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