Commit 58fb36bd authored by Max Kellermann's avatar Max Kellermann

storage/http: new storage plugin

parent 4297a7b0
......@@ -699,6 +699,8 @@ libstorage_a_CPPFLAGS = $(AM_CPPFLAGS) \
STORAGE_LIBS = \
libstorage.a \
$(CURL_LIBS) \
$(EXPAT_LIBS) \
$(NFS_LIBS) \
$(SMBCLIENT_LIBS)
......@@ -714,6 +716,12 @@ libstorage_a_SOURCES += \
src/storage/plugins/NfsStorage.cxx src/storage/plugins/NfsStorage.hxx
endif
if ENABLE_WEBDAV
libstorage_a_SOURCES += \
src/lib/expat/ExpatParser.cxx \
src/storage/plugins/CurlStorage.cxx src/storage/plugins/CurlStorage.hxx
endif
endif
# neighbor plugins
......@@ -1768,6 +1776,10 @@ test_run_storage_SOURCES = \
test/ScopeIOThread.hxx \
test/run_storage.cxx
if ENABLE_WEBDAV
test_run_storage_SOURCES += $(CURL_SOURCES)
endif
endif
test_run_input_LDADD = \
......
ver 0.20.1 (not yet released)
* input
- curl: fix crash bug
* storage
- curl: new storage plugin for WebDAV (work in progress)
* mixer
- alsa: normalize displayed volume according to human perception
* fix crash with volume_normalization enabled
......
......@@ -721,6 +721,19 @@ MPD_ENABLE_AUTO_PKG(mms, MMS, [libmms >= 0.4],
[libmms mms:// protocol support], [libmms not found])
dnl ---------------------------------------------------------------------------
dnl Storage Plugins
dnl ---------------------------------------------------------------------------
MPD_ENABLE_AUTO(webdav, WEBDAV, [WebDAV storage plugin],
[WebDAV requires libcurl and libexpat],
[auto],
[if test x$enable_curl = xyes && test x$enable_expat = xyes; then
found_webdav=yes
else
found_webdav=no
fi])
dnl ---------------------------------------------------------------------------
dnl Playlist Plugins
dnl ---------------------------------------------------------------------------
......
......@@ -1868,6 +1868,18 @@ run</programlisting>
</para>
</section>
<section id="curl_storage">
<title><varname>curl</varname></title>
<para>
A WebDAV client using <filename>libcurl</filename>. It used
used when <varname>music_directory</varname> contains a
<parameter>http://</parameter> or
<parameter>https://</parameter> URI, for example
"<parameter>https://the.server/dav/</parameter>".
</para>
</section>
<section id="smbclient_storage">
<title><varname>smbclient</varname></title>
......
......@@ -46,6 +46,8 @@ class CurlGlobal final : TimeoutMonitor, DeferredMonitor {
public:
explicit CurlGlobal(EventLoop &_loop);
using TimeoutMonitor::GetEventLoop;
void Add(CURL *easy, CurlRequest &request);
void Remove(CURL *easy);
......
......@@ -23,6 +23,7 @@
#include "plugins/LocalStorage.hxx"
#include "plugins/SmbclientStorage.hxx"
#include "plugins/NfsStorage.hxx"
#include "plugins/CurlStorage.hxx"
#include <assert.h>
#include <string.h>
......@@ -35,6 +36,9 @@ const StoragePlugin *const storage_plugins[] = {
#ifdef ENABLE_NFS
&nfs_storage_plugin,
#endif
#ifdef ENABLE_WEBDAV
&curl_storage_plugin,
#endif
nullptr
};
......
/*
* Copyright 2003-2016 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_STORAGE_CURL_HXX
#define MPD_STORAGE_CURL_HXX
#include "check.h"
struct StoragePlugin;
extern const StoragePlugin curl_storage_plugin;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment