Commit Graph

134 Commits

Author SHA1 Message Date
Max Kellermann cbb9b6957f storage/curl: use StringStartsWith() 2017-09-01 11:31:10 +02:00
Max Kellermann f6b56c9317 storage/curl: move code to IsXmlContentType() 2017-09-01 11:30:30 +02:00
Max Kellermann 2e471daef1 storage/nfs: migrate from TimeoutMonitor to TimerEvent 2017-08-29 16:30:50 +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 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 62b03cfddf storage, db, mixer, command: remove more bogus "pure" attributes
This commit is similar to 788e3b31e1,
and removes more "pure" attributes which were placed on functions that
could throw exceptions, which is illegal according to clang's
understanding of the attribute (but not according to GCC's).  GitHub
issue #58 was most likely about StorageDirectoryReader::GetInfo() and
Storage::GetInfo(), which still had "pure" attributes.

Closes #58
2017-06-03 21:54:24 +02:00
Max Kellermann 59e4f1ee0f *: remove lots of GCC 4.8 fallback code
We can remove those C++11 and C++14 kludges because we require GCC 4.9
now.
2017-05-16 11:29:15 +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 f6e428ac22 Merge branch 'v0.20.x' 2017-04-24 11:44:27 +02:00
Max Kellermann 504f5f7bdd storage/FileInfo, db/simple/Directory: use 64 bit for device/inode
An ino_t is usually a 64 bit integer, and some file systems (such as
Linux's kernel NFS client) really uses the upper 32 bit.  This can
lead to false positives in the directory loop detection in
FindAncestorLoop().  Increasing these two attributes (in
StorageFileInfo and Directory) to 64 bit adds little overhead, but
makes the check a lot safer.
2017-04-06 09:58:25 +02:00
Max Kellermann 6636c69a11 storage/FileInfo: convert mtime to std::chrono::system_clock::time_point 2017-02-11 23:45:15 +01:00
Max Kellermann 0ccaf4a1ff storage/FileInfo: add initializing constructor 2017-02-11 23:45:14 +01:00
Max Kellermann 4146475c73 util/ChronoUtil: new utility library for std::chrono 2017-02-11 22:23:33 +01:00
Max Kellermann 329c3ab21b fs/FileInfo: use std::chrono::system_clock 2017-02-10 23:48:21 +01:00
Max Kellermann 73f58c57e8 storage/curl: use CURLOPT_POSTFIELDS instead of CURLOPT_READFUNCTION 2017-02-06 23:25:03 +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 58fb36bdb9 storage/http: new storage plugin 2017-01-08 14:40:20 +01:00
Max Kellermann 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 31d77ec580 input/curl, ...: use strncmp() instead of memcmp() to avoid crash 2017-01-03 13:17: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 b042095ac2 event/Loop: use std::chrono 2016-12-28 01:15:08 +01:00
Max Kellermann d765182bbb config/Global: _get_path() throws exception on error 2016-11-02 10:07:57 +01:00
Max Kellermann c598686bd9 storage: migrate from class Error to C++ exceptions 2016-10-27 21:35:19 +02:00
Max Kellermann cab87e9398 storage/FileInfo: make methods "constexpr" 2016-10-27 21:35:19 +02:00
Max Kellermann 680037927d Merge branch 'v0.19.x' 2016-10-27 21:27:19 +02:00
Max Kellermann ee026386e5 storage/Composite: avoid setting the error twice
If an error has already been set by f.directory->storage->GetInfo(),
don't set it again.
2016-10-27 21:26:55 +02:00
Max Kellermann debc855806 Merge branch 'v0.19.x' 2016-10-27 21:01:27 +02:00
Max Kellermann f9a64d24bf storage/Composite: eliminate the second FindStorage() overload
It was used in a wrong way, which did not deal with errors
consistently.  And if that's wrong, there is no need for FindStorage()
at all - let's remove it and the confusion around it.
2016-10-27 19:55:20 +02:00
Max Kellermann e1a8dcfcc8 storage/Composite: add FindStorage() API documentation 2016-10-27 19:55:08 +02:00
Max Kellermann 1ee0e29974 storage/Composite: fix documentation typo 2016-10-27 17:12:24 +02:00
Max Kellermann 539c0ed171 {input,storage}/nfs: use C++ exceptions instead of class Error 2016-09-16 17:43:32 +02:00
Max Kellermann 135662d6b0 lib/smbclient/Init: throw std::runtime_error on error 2016-09-05 11:32:20 +02:00
Max Kellermann ba69ade024 Compiler.h: add macro CLANG_OR_GCC_VERSION() 2016-08-23 09:48:58 +02:00
Max Kellermann 9b85446808 util/StringPointer: rename typedef pointer to pointer_type 2016-04-12 22:53:06 +02:00
Max Kellermann 1aee89f5ea *: include cleanup (using iwyu) 2016-03-01 22:08:13 +01:00
Max Kellermann 1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann f3503e0026 fs/DirectoryReader: use C++ exceptions instead of class Error 2015-12-29 12:56:26 +01:00
Max Kellermann c880099deb util/StringCompare: add StringIsEmpty() 2015-11-06 09:37:07 +01:00
Max Kellermann 58996b841a config/Global: allow calling config_get_string() with one argument
default_value defaults to nullptr.
2015-06-26 08:06:40 +02:00
Max Kellermann 90e7ace980 Merge tag 'v0.19.10' 2015-06-21 16:06:02 +02:00
Thomas Guillem 3436a646b5 storage/nfs: fix deadlock when connecting
The Connect method can be called between Schedule and lock. In that case, when
locked, the state is already set to CONNECTING of READY and the condition won't
be signaled anymore.
2015-05-29 22:39:14 +02:00
Max Kellermann f16054639b storage/local: use PathTraitsFS typedefs 2015-03-03 13:12:54 +01:00
Max Kellermann 90a61b6bab fs/FileInfo: new library providing GetFileInfo()
Replaces StatFile(), with a portable data object.
2015-02-28 23:00:26 +01:00
Max Kellermann 2d06a8e880 storage/FileInfo: rename to StorageFileInfo 2015-02-28 23:00:26 +01:00
Max Kellermann 1c3f5517fa config/Option: convert to strictly-typed enum 2015-01-21 23:30:00 +01:00
Max Kellermann 712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann 412bedb697 Merge branch 'v0.19.x' 2014-12-26 14:40:32 +01:00