30 const char *endHtml =
nullptr,
31 int maxHistoryLength = 0) {
33 this->
start = startHtml;
37 if (maxHistoryLength > 0) {
46 virtual bool isValid(WiFiClient &client) {
47 bool valid = client.connected();
52 virtual void open(WiFiClient &client) {
54 if (client.connected()) {
57 if (
start !=
nullptr) {
58 int len = strlen(
start);
75 WiFiClient client = (*i);
86 WiFiClient client = *i;
102 virtual size_t write(uint8_t *content,
int len) {
105 WiFiClient client = *i;
115 virtual size_t print(
const char *str) {
117 int len = strlen(str);
119 WiFiClient client = *i;
132 int len = strlen(str);
134 WiFiClient client = *i;
153 const char *
end =
nullptr;
159 for (
int pos =
clients.
size() - 1; pos >= 0; pos--) {
160 WiFiClient client =
clients[pos];
170 if (
end !=
nullptr) {
172 int len = strlen(
end);
194 if (len <= available) {
Writes the data chunked to the actual client.
Definition: HttpChunkWriter.h:12
int writeChunk(Client &client, const char *str, int len, const char *str1=nullptr, int len1=0)
Definition: HttpChunkWriter.h:14
void writeEnd(Client &client)
Definition: HttpChunkWriter.h:31
Generic HttpStreamedMultiOutput Class which handles multicast streaming. We can optionally define som...
Definition: HttpStreamedMultiOutput.h:27
void addHistory(const char *line, bool delimiter, int len)
adds the line to the history - removest oldest lines
Definition: HttpStreamedMultiOutput.h:180
const char * start
Definition: HttpStreamedMultiOutput.h:152
virtual void doLoop()
Definition: HttpStreamedMultiOutput.h:145
virtual const char * mime()
Definition: HttpStreamedMultiOutput.h:43
virtual bool isOpen()
Definition: HttpStreamedMultiOutput.h:72
const char * mime_type
Definition: HttpStreamedMultiOutput.h:154
List< WiFiClient > clients
Definition: HttpStreamedMultiOutput.h:149
virtual bool isValid(WiFiClient &client)
Definition: HttpStreamedMultiOutput.h:46
const char * end
Definition: HttpStreamedMultiOutput.h:153
virtual int availableForWrite()
Do not accept any writes if we are not connected.
Definition: HttpStreamedMultiOutput.h:99
int max_history_length
Definition: HttpStreamedMultiOutput.h:151
Str * history
Definition: HttpStreamedMultiOutput.h:150
virtual void open(WiFiClient &client)
Definition: HttpStreamedMultiOutput.h:52
virtual size_t write(uint8_t *content, int len)
Definition: HttpStreamedMultiOutput.h:102
void cleanup()
Definition: HttpStreamedMultiOutput.h:158
virtual void close()
Definition: HttpStreamedMultiOutput.h:84
virtual size_t println(const char *str)
Definition: HttpStreamedMultiOutput.h:130
int id_value
Definition: HttpStreamedMultiOutput.h:155
HttpChunkWriter writer
Definition: HttpStreamedMultiOutput.h:148
HttpStreamedMultiOutput(const char *mime, const char *startHtml=nullptr, const char *endHtml=nullptr, int maxHistoryLength=0)
Definition: HttpStreamedMultiOutput.h:29
void onClose(WiFiClient &client)
content that is written when the request is opened
Definition: HttpStreamedMultiOutput.h:169
virtual size_t print(const char *str)
Definition: HttpStreamedMultiOutput.h:115
Abstract class for handling streamed output.
Definition: HttpStreamedOutput.h:12
Iterator end()
Definition: List.h:257
size_t size()
Definition: List.h:272
bool push_back(T data)
Definition: List.h:128
bool erase(Iterator it)
Definition: List.h:233
Iterator begin()
Definition: List.h:252
void log(DlnaLogLevel current_level, const char *fmt...)
Print log message.
Definition: Logger.h:40
virtual int indexOf(const char c, int start=0)
Definition: StrView.h:267
virtual int length()
Definition: StrView.h:370
String implementation which keeps the data on the heap. We grow the allocated memory only if the copy...
Definition: Str.h:22
void clear() override
clears the string by setting the terminating 0 at the beginning
Definition: Str.h:164
const char * c_str()
provides the string value as const char*
Definition: Str.h:188
Definition: Allocator.h:6
@ DlnaDebug
Definition: Logger.h:16
@ DlnaInfo
Definition: Logger.h:16
@ DlnaWarning
Definition: Logger.h:16
LoggerClass DlnaLogger
Definition: Logger.cpp:5