forked from hzane/libhttpsvr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_chunks.h
More file actions
30 lines (25 loc) · 876 Bytes
/
http_chunks.h
File metadata and controls
30 lines (25 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <vector>
#pragma warning(push)
#pragma warning(disable:4200)
struct http_response_body_t {
uint16_t count;
http_data_chunk chunks[0];
};
using http_response_body = http_response_body_t*;
#pragma warning(pop)
struct http_chunks_t : protected std::vector<http_data_chunk> {
using base_t = std::vector<http_data_chunk>;
using base_t::push_back;
using base_t::size;
using base_t::data;
using base_t::cbegin;
using base_t::cend;
http_chunks_t() = default;
~http_chunks_t(); // do release all chunk buffer
};
using http_chunks = std::shared_ptr<http_chunks_t>;
auto http_chunk_memory_new( uintptr_t size )->http_data_chunk;
auto http_chunk_memory_copy( http_data_chunk chunk )->http_data_chunk;
auto http_chunk_memory_copy( const uint8_t* data, uintptr_t size )->http_data_chunk;
auto http_chunk_free( http_data_chunk )->void;