25 #include <cppmyth_config.h> 26 #include "wscontent.h" 27 #include "wsrequest.h" 46 bool IsSuccessful()
const {
return m_successful; }
47 bool IsChunkedTransfer()
const {
return m_contentChunked; }
48 size_t GetContentLength()
const {
return m_contentLength; }
49 size_t ReadContent(
char *buf,
size_t buflen);
50 size_t GetConsumed()
const {
return m_consumed; }
51 int GetStatusCode()
const {
return m_statusCode; }
52 const std::string& Redirection()
const {
return m_location; }
54 bool GetHeaderValue(
const std::string& header, std::string& value);
56 static bool ReadHeaderLine(
NetSocket *socket,
const char *eol, std::string& line,
size_t *len);
62 std::string m_serverInfo;
64 std::string m_location;
66 CE_t m_contentEncoding;
67 bool m_contentChunked;
68 size_t m_contentLength;
76 typedef std::list<std::pair<std::string, std::string> > HeaderList;
83 bool SendRequest(
const WSRequest& request);
85 size_t ReadChunk(
void *buf,
size_t buflen);
86 static int SocketStreamReader(
void *hdl,
void *buf,
int sz);
87 static int ChunkStreamReader(
void *hdl,
void *buf,
int sz);
char * m_chunkPtr
The next position to read data from the chunk.
char * m_chunkBuffer
The chunk data buffer.
char * m_chunkEOR
The end of received data in the chunk.
char * m_chunkEnd
The end of the chunk buffer.