Skip to content

Commit 3d86cf6

Browse files
authored
input-stream destroy (#145)
1 parent 8c3e1a9 commit 3d86cf6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/test_h1_client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,16 +1067,16 @@ int s_slow_stream_get_length(struct aws_input_stream *stream, int64_t *out_lengt
10671067
*out_length = sender->cursor.len;
10681068
return AWS_OP_SUCCESS;
10691069
}
1070-
void s_slow_stream_clean_up(struct aws_input_stream *stream) {
1071-
(void)stream;
1070+
void s_slow_stream_destroy(struct aws_input_stream *stream) {
1071+
aws_mem_release(stream->allocator, stream);
10721072
}
10731073

10741074
static struct aws_input_stream_vtable s_slow_stream_vtable = {
10751075
.seek = NULL,
10761076
.read = s_slow_stream_read,
10771077
.get_status = s_slow_stream_get_status,
10781078
.get_length = s_slow_stream_get_length,
1079-
.clean_up = s_slow_stream_clean_up,
1079+
.destroy = s_slow_stream_destroy,
10801080
};
10811081

10821082
/* It should be fine to receive a response before the request has finished sending */
@@ -1475,16 +1475,16 @@ static int s_error_from_outgoing_body_get_status(struct aws_input_stream *body,
14751475
return AWS_OP_SUCCESS;
14761476
}
14771477

1478-
static void s_error_from_outgoing_body_clean_up(struct aws_input_stream *stream) {
1479-
(void)stream;
1478+
static void s_error_from_outgoing_body_destroy(struct aws_input_stream *stream) {
1479+
aws_mem_release(stream->allocator, stream);
14801480
}
14811481

14821482
static struct aws_input_stream_vtable s_error_from_outgoing_body_vtable = {
14831483
.seek = NULL,
14841484
.read = s_error_from_outgoing_body_read,
14851485
.get_status = s_error_from_outgoing_body_get_status,
14861486
.get_length = NULL,
1487-
.clean_up = s_error_from_outgoing_body_clean_up,
1487+
.destroy = s_error_from_outgoing_body_destroy,
14881488
};
14891489

14901490
static int s_error_from_incoming_headers(

tests/test_h1_server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,16 +1186,16 @@ static int s_error_from_outgoing_body_get_status(struct aws_input_stream *body,
11861186
return AWS_OP_SUCCESS;
11871187
}
11881188

1189-
static void s_error_from_outgoing_body_clean_up(struct aws_input_stream *stream) {
1190-
(void)stream;
1189+
static void s_error_from_outgoing_body_destroy(struct aws_input_stream *stream) {
1190+
aws_mem_release(stream->allocator, stream);
11911191
}
11921192

11931193
static struct aws_input_stream_vtable s_error_from_outgoing_body_vtable = {
11941194
.seek = NULL,
11951195
.read = s_error_from_outgoing_body_read,
11961196
.get_status = s_error_from_outgoing_body_get_status,
11971197
.get_length = NULL,
1198-
.clean_up = s_error_from_outgoing_body_clean_up,
1198+
.destroy = s_error_from_outgoing_body_destroy,
11991199
};
12001200

12011201
static int s_error_from_incoming_headers(

0 commit comments

Comments
 (0)