diff options
author | thegeorg <[email protected]> | 2025-05-12 15:51:24 +0300 |
---|---|---|
committer | thegeorg <[email protected]> | 2025-05-12 16:06:27 +0300 |
commit | d629bb70c8773d2c0c43f5088ddbb5a86d8c37ea (patch) | |
tree | 4f678e0d65ad08c800db21c657d3b0f71fafed06 /contrib/restricted/aws/aws-c-http/source/request_response.c | |
parent | 92c4b696d7a1c03d54e13aff7a7c20a078d90dd7 (diff) |
Update contrib/restricted/aws libraries to nixpkgs 24.05
commit_hash:f8083acb039e6005e820cdee77b84e0a6b6c6d6d
Diffstat (limited to 'contrib/restricted/aws/aws-c-http/source/request_response.c')
-rw-r--r-- | contrib/restricted/aws/aws-c-http/source/request_response.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/contrib/restricted/aws/aws-c-http/source/request_response.c b/contrib/restricted/aws/aws-c-http/source/request_response.c index c382a3a4d0e..dbd5214e762 100644 --- a/contrib/restricted/aws/aws-c-http/source/request_response.c +++ b/contrib/restricted/aws/aws-c-http/source/request_response.c @@ -867,6 +867,11 @@ int aws_http_message_get_header( return aws_http_headers_get_index(message->headers, index, out_header); } +AWS_FUTURE_T_POINTER_WITH_RELEASE_IMPLEMENTATION( + aws_future_http_message, + struct aws_http_message, + aws_http_message_release) + struct aws_http_stream *aws_http_connection_make_request( struct aws_http_connection *client_connection, const struct aws_http_make_request_options *options) { @@ -952,8 +957,8 @@ struct aws_http_message *aws_http2_message_new_from_http1( scheme_cursor.ptr); /** - * An intermediary that forwards a request over HTTP/2 MUST construct an ":authority" pseudo-header field using - * the authority information from the control data of the original request. (RFC=9113 8.3.1) + * An intermediary that forwards a request over HTTP/2 MUST construct an ":authority" pseudo-header field + * using the authority information from the control data of the original request. (RFC=9113 8.3.1) */ struct aws_byte_cursor host_value; AWS_ZERO_STRUCT(host_value); @@ -970,7 +975,8 @@ struct aws_http_message *aws_http2_message_new_from_http1( (int)host_value.len, host_value.ptr); } - /* TODO: If the host headers is missing, the target URI could be the other source of the authority information + /* TODO: If the host headers is missing, the target URI could be the other source of the authority + * information */ struct aws_byte_cursor path_cursor; @@ -1107,6 +1113,15 @@ int aws_http_stream_send_response(struct aws_http_stream *stream, struct aws_htt return stream->owning_connection->vtable->stream_send_response(stream, response); } +struct aws_http_stream *aws_http_stream_acquire(struct aws_http_stream *stream) { + AWS_PRECONDITION(stream); + + size_t prev_refcount = aws_atomic_fetch_add(&stream->refcount, 1); + AWS_LOGF_TRACE( + AWS_LS_HTTP_STREAM, "id=%p: Stream refcount acquired, %zu remaining.", (void *)stream, prev_refcount + 1); + return stream; +} + void aws_http_stream_release(struct aws_http_stream *stream) { if (!stream) { return; @@ -1186,6 +1201,10 @@ uint32_t aws_http_stream_get_id(const struct aws_http_stream *stream) { return stream->id; } +void aws_http_stream_cancel(struct aws_http_stream *stream, int error_code) { + stream->vtable->cancel(stream, error_code); +} + int aws_http2_stream_reset(struct aws_http_stream *http2_stream, uint32_t http2_error) { AWS_PRECONDITION(http2_stream); AWS_PRECONDITION(http2_stream->vtable); |