Skip to content

Commit 425e5da

Browse files
authored
Fix a bunch of places we forget to aws_raise_error() (#462)
1 parent 0bb96ce commit 425e5da

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'main'
77

88
env:
9-
BUILDER_VERSION: v0.9.46
9+
BUILDER_VERSION: v0.9.55
1010
BUILDER_SOURCE: releases
1111
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1212
PACKAGE_NAME: aws-c-http

include/aws/http/request_response.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ typedef void(aws_http_message_transform_fn)(
139139
* This is always invoked on the HTTP connection's event-loop thread.
140140
*
141141
* Return AWS_OP_SUCCESS to continue processing the stream.
142-
* Return AWS_OP_ERR to indicate failure and cancel the stream.
142+
* Return aws_raise_error(E) to indicate failure and cancel the stream.
143+
* The error you raise will be reflected in the error_code passed to the on_complete callback.
143144
*/
144145
typedef int(aws_http_on_incoming_headers_fn)(
145146
struct aws_http_stream *stream,
@@ -153,7 +154,8 @@ typedef int(aws_http_on_incoming_headers_fn)(
153154
* This is always invoked on the HTTP connection's event-loop thread.
154155
*
155156
* Return AWS_OP_SUCCESS to continue processing the stream.
156-
* Return AWS_OP_ERR to indicate failure and cancel the stream.
157+
* Return aws_raise_error(E) to indicate failure and cancel the stream.
158+
* The error you raise will be reflected in the error_code passed to the on_complete callback.
157159
*/
158160
typedef int(aws_http_on_incoming_header_block_done_fn)(
159161
struct aws_http_stream *stream,
@@ -171,7 +173,8 @@ typedef int(aws_http_on_incoming_header_block_done_fn)(
171173
* aws_http_stream_update_window().
172174
*
173175
* Return AWS_OP_SUCCESS to continue processing the stream.
174-
* Return AWS_OP_ERR to indicate failure and cancel the stream.
176+
* Return aws_raise_error(E) to indicate failure and cancel the stream.
177+
* The error you raise will be reflected in the error_code passed to the on_complete callback.
175178
*/
176179
typedef int(
177180
aws_http_on_incoming_body_fn)(struct aws_http_stream *stream, const struct aws_byte_cursor *data, void *user_data);
@@ -181,7 +184,8 @@ typedef int(
181184
* This is always invoked on the HTTP connection's event-loop thread.
182185
*
183186
* Return AWS_OP_SUCCESS to continue processing the stream.
184-
* Return AWS_OP_ERR to indicate failure and cancel the stream.
187+
* Return aws_raise_error(E) to indicate failure and cancel the stream.
188+
* The error you raise will be reflected in the error_code passed to the on_complete callback.
185189
*/
186190
typedef int(aws_http_on_incoming_request_done_fn)(struct aws_http_stream *stream, void *user_data);
187191

source/h1_decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int s_linestate_chunk_size(struct aws_h1_decoder *decoder, struct aws_byt
301301
decoder->logging_id,
302302
AWS_BYTE_CURSOR_PRI(input));
303303

304-
return AWS_OP_ERR;
304+
return aws_raise_error(AWS_ERROR_HTTP_PROTOCOL_ERROR);
305305
}
306306

307307
int err = aws_byte_cursor_utf8_parse_u64_hex(size, &decoder->chunk_size);

source/h1_encoder.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,7 @@ int aws_h1_encoder_message_init_from_response(
403403
goto error;
404404
}
405405

406-
err = aws_byte_buf_init(&message->outgoing_head_buf, allocator, head_total_len);
407-
if (err) {
408-
return AWS_OP_ERR;
409-
}
406+
aws_byte_buf_init(&message->outgoing_head_buf, allocator, head_total_len);
410407

411408
bool wrote_all = true;
412409

source/proxy_connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static int s_setup_proxy_tls_env_variable(
12271227
AWS_LS_HTTP_CONNECTION,
12281228
"Failed making default TLS context because of BYO_CRYPTO, set up the tls_options for proxy_env_settings to "
12291229
"make it work.");
1230-
return AWS_OP_ERR;
1230+
return aws_raise_error(AWS_ERROR_UNIMPLEMENTED);
12311231
#else
12321232
struct aws_tls_ctx *tls_ctx = NULL;
12331233
struct aws_tls_ctx_options tls_ctx_options;

0 commit comments

Comments
 (0)