20 #ifndef MPD_OUTPUT_HTTPD_CLIENT_HXX 21 #define MPD_OUTPUT_HTTPD_CLIENT_HXX 26 #include <boost/intrusive/link_mode.hpp> 27 #include <boost/intrusive/list_hook.hpp> 39 public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> {
62 std::queue<Page *, std::list<Page *>> pages;
78 size_t current_position;
88 bool dlna_streaming_requested;
96 bool metadata_supported;
101 bool metadata_requested;
121 size_t metadata_current_position;
127 unsigned metadata_fill;
135 bool _metadata_supported);
gcc_pure ssize_t GetBytesTillMetaData() const noexcept
void PushPage(Page *page)
Appends a page to the client's queue.
void OnSocketError(std::exception_ptr ep) override
HttpdClient(HttpdOutput &httpd, int _fd, EventLoop &_loop, bool _metadata_supported)
An event loop that polls for events on file/socket descriptors.
std::make_signed< size_t >::type ssize_t
void CancelQueue()
Clears the page queue.
void PushMetaData(Page *page)
Sends the passed metadata.
void BeginResponse()
Switch the client to the "RESPONSE" state.
~HttpdClient()
Note: this does not remove the client from the HttpdOutput object.
virtual InputResult OnSocketInput(void *data, size_t length) override
Data has been received on the socket.
bool SendResponse()
Sends the status line and response headers to the client.
virtual void OnSocketClosed() override
ssize_t TryWritePageN(const Page &page, size_t position, ssize_t n)
A SocketMonitor specialization that adds an input buffer.
virtual bool OnSocketReady(unsigned flags) override
ssize_t TryWritePage(const Page &page, size_t position)
bool HandleLine(const char *line)
Handle a line of the HTTP request.
void Close()
Frees the client and removes it from the server's client list.
A dynamically allocated buffer which keeps track of its reference count.