@@ -24,7 +24,7 @@ uint64_t exports_pack_name_api_get() {
24
24
}
25
25
26
26
27
- void set_string (c_example_http_string_t * ret , const char * str ) {
27
+ void set_string (component_name_string_t * ret , const char * str ) {
28
28
ret -> ptr = (uint8_t * )str ;
29
29
ret -> len = strlen (str );
30
30
}
@@ -36,13 +36,13 @@ void set_string_field(wasi_http_types_field_value_t* ret, const char* str) {
36
36
37
37
#define log (...) { fprintf (stderr, __VA_ARGS__); fflush(stderr); }
38
38
39
- void exports_pack_name_api_send (c_example_http_string_t * ret ) {
39
+ void exports_pack_name_api_send (component_name_string_t * ret ) {
40
40
log ("Setting up the outgoing request\n" );
41
41
// Setting up the outgoing request
42
42
wasi_http_types_own_fields_t headers ;
43
43
wasi_http_types_header_error_t headers_err ;
44
- c_example_http_list_tuple2_field_key_field_value_t entries ;
45
- entries .ptr = malloc (2 * sizeof (c_example_http_tuple2_field_key_field_value_t ));
44
+ component_name_list_tuple2_field_key_field_value_t entries ;
45
+ entries .ptr = malloc (2 * sizeof (component_name_tuple2_field_key_field_value_t ));
46
46
entries .len = 2 ;
47
47
set_string (& entries .ptr [0 ].f0 , "Content-Type" );
48
48
set_string_field (& entries .ptr [0 ].f1 , "application/json" );
@@ -71,7 +71,7 @@ void exports_pack_name_api_send(c_example_http_string_t *ret) {
71
71
return ;
72
72
}
73
73
74
- c_example_http_string_t path ;
74
+ component_name_string_t path ;
75
75
set_string (& path , "/post" );
76
76
if (!wasi_http_types_method_outgoing_request_set_path_with_query (
77
77
wasi_http_types_borrow_outgoing_request (request ),
@@ -93,7 +93,7 @@ void exports_pack_name_api_send(c_example_http_string_t *ret) {
93
93
return ;
94
94
}
95
95
96
- c_example_http_string_t authority ;
96
+ component_name_string_t authority ;
97
97
set_string (& authority , "httpbin.org" );
98
98
if (!wasi_http_types_method_outgoing_request_set_authority (
99
99
wasi_http_types_borrow_outgoing_request (request ),
@@ -122,7 +122,7 @@ void exports_pack_name_api_send(c_example_http_string_t *ret) {
122
122
log ("Writing the outgoing request stream\n" );
123
123
124
124
wasi_io_streams_stream_error_t stream_err ;
125
- c_example_http_list_u8_t body_data ;
125
+ component_name_list_u8_t body_data ;
126
126
body_data .ptr = malloc (256 );
127
127
sprintf ((char * )body_data .ptr , "{ \"count\": %llu }" , total );
128
128
body_data .len = strlen ((char * )body_data .ptr );
@@ -231,7 +231,7 @@ void exports_pack_name_api_send(c_example_http_string_t *ret) {
231
231
pollable_list .ptr = malloc (sizeof (wasi_io_poll_borrow_pollable_t ));
232
232
pollable_list .ptr [0 ] = wasi_io_poll_borrow_pollable (pollable );
233
233
234
- c_example_http_list_u32_t poll_result ;
234
+ component_name_list_u32_t poll_result ;
235
235
wasi_io_poll_poll (& pollable_list , & poll_result );
236
236
wasi_io_poll_pollable_drop_own (pollable );
237
237
}
@@ -265,7 +265,7 @@ void exports_pack_name_api_send(c_example_http_string_t *ret) {
265
265
uint64_t len = 0 ;
266
266
267
267
while (!eof ) {
268
- c_example_http_list_u8_t chunk ;
268
+ component_name_list_u8_t chunk ;
269
269
wasi_io_streams_stream_error_t stream_err ;
270
270
if (wasi_io_streams_method_input_stream_blocking_read (wasi_io_streams_borrow_input_stream (incoming_body_stream ), 1024 , & chunk , & stream_err )) {
271
271
len += chunk .len ;
0 commit comments