aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/HttpdClient.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-04 17:04:21 +0100
committerMax Kellermann <max@duempel.org>2014-01-04 17:06:05 +0100
commit968c5eb7675a5cf4f3a07820356ac5a0ae55d12f (patch)
tree457a024a04c74695113be7e8f03dcdf9ddcb67b7 /src/output/HttpdClient.hxx
parent19424e95dba6ae2b25733a48994f3781624c9c2e (diff)
downloadmpd-968c5eb7675a5cf4f3a07820356ac5a0ae55d12f.tar.gz
mpd-968c5eb7675a5cf4f3a07820356ac5a0ae55d12f.tar.xz
mpd-968c5eb7675a5cf4f3a07820356ac5a0ae55d12f.zip
output/httpd: keep track of queue size
Don't iterate the std::list each time.
Diffstat (limited to 'src/output/HttpdClient.hxx')
-rw-r--r--src/output/HttpdClient.hxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/output/HttpdClient.hxx b/src/output/HttpdClient.hxx
index 0b3da8fa9..12b7af13f 100644
--- a/src/output/HttpdClient.hxx
+++ b/src/output/HttpdClient.hxx
@@ -56,6 +56,11 @@ class HttpdClient final : BufferedSocket {
std::list<Page *> pages;
/**
+ * The sum of all page sizes in #pages.
+ */
+ size_t queue_size;
+
+ /**
* The #page which is currently being sent to the client.
*/
Page *current_page;
@@ -140,7 +145,9 @@ public:
* Returns the total size of this client's page queue.
*/
gcc_pure
- size_t GetQueueSize() const;
+ size_t GetQueueSize() const {
+ return queue_size;
+ }
/**
* Clears the page queue.