29#include <sptk5/Buffer.h>
30#include <sptk5/CaseInsensitiveCompare.h>
31#include <sptk5/RegularExpression.h>
32#include <sptk5/net/TCPSocket.h>
41using HttpHeaders = std::map<String, String, CaseInsensitiveCompare>;
128 int readAll(std::chrono::milliseconds timeout);
142 String getRequestType()
const;
143 String getRequestURL()
const;
150 State m_readerState {State::READY};
151 mutable std::mutex m_mutex;
153 int m_statusCode {0};
154 size_t m_contentLength {0};
155 size_t m_contentReceivedLength {0};
156 bool m_contentIsChunked {
false};
157 HttpHeaders m_httpHeaders;
158 RegularExpression m_matchProtocolAndResponseCode {
"^(HTTP\\S+)\\s+(\\d+)\\s+(.*)?\r?"};
160 Buffer m_read_buffer;
161 String m_requestType;
180 void readDataChunk(
bool& done);
Definition: HttpReader.h:49
ReadMode
Definition: HttpReader.h:67
State getReaderState() const
State
Definition: HttpReader.h:55
int readAll(std::chrono::milliseconds timeout)
const String & getStatusText() const
HttpReader(TCPSocket &socket, Buffer &output, ReadMode readMode)
HttpHeaders & getHttpHeaders()
String httpHeader(const String &headerName) const
int getStatusCode() const
Definition: TCPSocket.h:165