aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/plugins/httpd/HttpdInternal.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/plugins/httpd/HttpdInternal.hxx')
-rw-r--r--src/output/plugins/httpd/HttpdInternal.hxx33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/output/plugins/httpd/HttpdInternal.hxx b/src/output/plugins/httpd/HttpdInternal.hxx
index 20ff15e42..01498dfcd 100644
--- a/src/output/plugins/httpd/HttpdInternal.hxx
+++ b/src/output/plugins/httpd/HttpdInternal.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -25,6 +25,7 @@
#ifndef MPD_OUTPUT_HTTPD_INTERNAL_H
#define MPD_OUTPUT_HTTPD_INTERNAL_H
+#include "HttpdClient.hxx"
#include "output/Internal.hxx"
#include "output/Timer.hxx"
#include "thread/Mutex.hxx"
@@ -33,16 +34,10 @@
#include "util/Cast.hxx"
#include "Compiler.h"
-#ifdef _LIBCPP_VERSION
-/* can't use incomplete template arguments with libc++ */
-#include "HttpdClient.hxx"
-#endif
-
-#include <forward_list>
#include <queue>
#include <list>
-struct config_param;
+struct ConfigBlock;
class Error;
class EventLoop;
class ServerSocket;
@@ -135,7 +130,8 @@ private:
* A linked list containing all clients which are currently
* connected.
*/
- std::forward_list<HttpdClient> clients;
+ boost::intrusive::list<HttpdClient,
+ boost::intrusive::constant_time_size<true>> clients;
/**
* A temporary buffer for the httpd_output_read_page()
@@ -147,13 +143,13 @@ private:
* The maximum and current number of clients connected
* at the same time.
*/
- unsigned clients_max, clients_cnt;
+ unsigned clients_max;
public:
HttpdOutput(EventLoop &_loop);
~HttpdOutput();
-#if defined(__clang__) || GCC_CHECK_VERSION(4,7)
+#if CLANG_OR_GCC_VERSION(4,7)
constexpr
#endif
static HttpdOutput *Cast(AudioOutput *ao) {
@@ -162,16 +158,16 @@ public:
using DeferredMonitor::GetEventLoop;
- bool Init(const config_param &param, Error &error);
+ bool Init(const ConfigBlock &block, Error &error);
- bool Configure(const config_param &param, Error &error);
+ bool Configure(const ConfigBlock &block, Error &error);
- AudioOutput *InitAndConfigure(const config_param &param,
+ AudioOutput *InitAndConfigure(const ConfigBlock &block,
Error &error) {
- if (!Init(param, error))
+ if (!Init(block, error))
return nullptr;
- if (!Configure(param, error))
+ if (!Configure(block, error))
return nullptr;
return &base;
@@ -250,7 +246,7 @@ public:
bool EncodeAndPlay(const void *chunk, size_t size, Error &error);
- void SendTag(const Tag *tag);
+ void SendTag(const Tag &tag);
size_t Play(const void *chunk, size_t size, Error &error);
@@ -259,8 +255,7 @@ public:
private:
virtual void RunDeferred() override;
- virtual void OnAccept(int fd, const sockaddr &address,
- size_t address_length, int uid) override;
+ void OnAccept(int fd, SocketAddress address, int uid) override;
};
extern const class Domain httpd_output_domain;