-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhttp_apis.h
More file actions
36 lines (28 loc) · 1.92 KB
/
http_apis.h
File metadata and controls
36 lines (28 loc) · 1.92 KB
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
31
32
33
34
35
36
#pragma once
using http_response_write = std::function<std::tuple<tpio_context*, bool>()>;
// callback prototype
using http_receive_request_end = std::function<void( http_request, uint32_t result, uintptr_t xfered )>;
using http_receive_request_entity_body_end = std::function<void( uint8_t* buf, uint32_t err, uintptr_t x)>;
using http_send_response_end = std::function<void( uint32_t result, uintptr_t xfered )>;
using http_send_response_entity_body_end = std::function<void( uint8_t* buf, uint32_t result, uintptr_t xfered )>;
using http_cancel_http_request_end = std::function<void( http_id, uint32_t result )>;
auto http_receive_http_request( tpio_handle tpio,
handle_t q,
http_receive_request_end callback ) -> void;
// http_response_write will compose a tpio_context instance
auto http_send_http_response( tpio_handle tpio,
handle_t q,
http_id rid,
tpio_context* ctx, bool hasmore,
http_send_response_end callback ) -> void;
auto http_receive_request_entity_body( tpio_handle tpio,
handle_t q,
http_id rid,
http_receive_request_entity_body_end callback ) ->void;
// http_response_write will compose tpio_context
auto http_send_response_entity_body( tpio_handle tpio,
handle_t q,
http_id rid,
tpio_context* ctx, bool hasmore,
http_send_response_entity_body_end callback ) -> void;
auto http_cancel_http_request( tpio_handle tpio, handle_t q, http_id rid, http_cancel_http_request_end callback ) ->void;