| 1 |
#ifndef AWS_HTTP_STREAM_TEST_HELPER_H |
| 2 |
#define AWS_HTTP_STREAM_TEST_HELPER_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <aws/http/request_response.h> |
| 9 |
|
| 10 |
struct aws_http_connection; |
| 11 |
struct aws_http_headers; |
| 12 |
struct aws_http_message; |
| 13 |
struct aws_http_stream; |
| 14 |
|
| 15 |
struct client_stream_tester { |
| 16 |
struct aws_allocator *alloc; |
| 17 |
struct aws_http_stream *stream; |
| 18 |
|
| 19 |
int response_status; |
| 20 |
|
| 21 |
enum aws_http_header_block current_header_block; |
| 22 |
|
| 23 |
|
| 24 |
struct aws_http_message *info_responses[4]; |
| 25 |
size_t num_info_responses; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
struct aws_http_headers *current_info_headers; |
| 30 |
|
| 31 |
|
| 32 |
struct aws_http_headers *response_headers; |
| 33 |
bool response_headers_done; |
| 34 |
|
| 35 |
|
| 36 |
struct aws_http_headers *response_trailer; |
| 37 |
bool response_trailer_done; |
| 38 |
|
| 39 |
struct aws_byte_buf response_body; |
| 40 |
|
| 41 |
bool complete; |
| 42 |
int on_complete_error_code; |
| 43 |
|
| 44 |
|
| 45 |
bool on_complete_connection_is_open; |
| 46 |
struct aws_http_stream_metrics metrics; |
| 47 |
|
| 48 |
bool destroyed; |
| 49 |
|
| 50 |
|
| 51 |
bool on_h2_remote_end_stream_invoked; |
| 52 |
}; |
| 53 |
|
| 54 |
struct client_stream_tester_options { |
| 55 |
struct aws_http_message *request; |
| 56 |
struct aws_http_connection *connection; |
| 57 |
bool http2_manual_write; |
| 58 |
bool use_manual_data_writes; |
| 59 |
|
| 60 |
bool *on_h2_remote_end_stream; |
| 61 |
}; |
| 62 |
|
| 63 |
int client_stream_tester_init( |
| 64 |
struct client_stream_tester *tester, |
| 65 |
struct aws_allocator *alloc, |
| 66 |
const struct client_stream_tester_options *options); |
| 67 |
|
| 68 |
void client_stream_tester_clean_up(struct client_stream_tester *tester); |
| 69 |
|
| 70 |
#endif |