Skip to content

Commit

Permalink
Fix a bunch of places we forget to aws_raise_error() (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm authored Feb 13, 2024
1 parent 0bb96ce commit 425e5da
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'main'

env:
BUILDER_VERSION: v0.9.46
BUILDER_VERSION: v0.9.55
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-c-http
Expand Down
12 changes: 8 additions & 4 deletions include/aws/http/request_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ typedef void(aws_http_message_transform_fn)(
* This is always invoked on the HTTP connection's event-loop thread.
*
* Return AWS_OP_SUCCESS to continue processing the stream.
* Return AWS_OP_ERR to indicate failure and cancel the stream.
* Return aws_raise_error(E) to indicate failure and cancel the stream.
* The error you raise will be reflected in the error_code passed to the on_complete callback.
*/
typedef int(aws_http_on_incoming_headers_fn)(
struct aws_http_stream *stream,
Expand All @@ -153,7 +154,8 @@ typedef int(aws_http_on_incoming_headers_fn)(
* This is always invoked on the HTTP connection's event-loop thread.
*
* Return AWS_OP_SUCCESS to continue processing the stream.
* Return AWS_OP_ERR to indicate failure and cancel the stream.
* Return aws_raise_error(E) to indicate failure and cancel the stream.
* The error you raise will be reflected in the error_code passed to the on_complete callback.
*/
typedef int(aws_http_on_incoming_header_block_done_fn)(
struct aws_http_stream *stream,
Expand All @@ -171,7 +173,8 @@ typedef int(aws_http_on_incoming_header_block_done_fn)(
* aws_http_stream_update_window().
*
* Return AWS_OP_SUCCESS to continue processing the stream.
* Return AWS_OP_ERR to indicate failure and cancel the stream.
* Return aws_raise_error(E) to indicate failure and cancel the stream.
* The error you raise will be reflected in the error_code passed to the on_complete callback.
*/
typedef int(
aws_http_on_incoming_body_fn)(struct aws_http_stream *stream, const struct aws_byte_cursor *data, void *user_data);
Expand All @@ -181,7 +184,8 @@ typedef int(
* This is always invoked on the HTTP connection's event-loop thread.
*
* Return AWS_OP_SUCCESS to continue processing the stream.
* Return AWS_OP_ERR to indicate failure and cancel the stream.
* Return aws_raise_error(E) to indicate failure and cancel the stream.
* The error you raise will be reflected in the error_code passed to the on_complete callback.
*/
typedef int(aws_http_on_incoming_request_done_fn)(struct aws_http_stream *stream, void *user_data);

Expand Down
2 changes: 1 addition & 1 deletion source/h1_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static int s_linestate_chunk_size(struct aws_h1_decoder *decoder, struct aws_byt
decoder->logging_id,
AWS_BYTE_CURSOR_PRI(input));

return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_HTTP_PROTOCOL_ERROR);
}

int err = aws_byte_cursor_utf8_parse_u64_hex(size, &decoder->chunk_size);
Expand Down
5 changes: 1 addition & 4 deletions source/h1_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,7 @@ int aws_h1_encoder_message_init_from_response(
goto error;
}

err = aws_byte_buf_init(&message->outgoing_head_buf, allocator, head_total_len);
if (err) {
return AWS_OP_ERR;
}
aws_byte_buf_init(&message->outgoing_head_buf, allocator, head_total_len);

bool wrote_all = true;

Expand Down
2 changes: 1 addition & 1 deletion source/proxy_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ static int s_setup_proxy_tls_env_variable(
AWS_LS_HTTP_CONNECTION,
"Failed making default TLS context because of BYO_CRYPTO, set up the tls_options for proxy_env_settings to "
"make it work.");
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_UNIMPLEMENTED);
#else
struct aws_tls_ctx *tls_ctx = NULL;
struct aws_tls_ctx_options tls_ctx_options;
Expand Down

0 comments on commit 425e5da

Please sign in to comment.