From c84d1d2ab37a837ad84f1274e99086a875cf0210 Mon Sep 17 00:00:00 2001 From: quinnj <2896623+quinnj@users.noreply.github.com> Date: Mon, 2 Feb 2026 06:02:13 +0000 Subject: [PATCH] Update aws_c_http_jq_jll to version 0.10.10 --- Project.toml | 4 +- lib/aarch64-apple-darwin20.jl | 149 ++++++++++++++++++++++++----- lib/aarch64-linux-gnu.jl | 153 +++++++++++++++++++++--------- lib/aarch64-linux-musl.jl | 149 ++++++++++++++++++++++++----- lib/armv7l-linux-gnueabihf.jl | 153 +++++++++++++++++++++--------- lib/armv7l-linux-musleabihf.jl | 149 ++++++++++++++++++++++++----- lib/i686-linux-gnu.jl | 149 ++++++++++++++++++++++++----- lib/i686-linux-musl.jl | 149 ++++++++++++++++++++++++----- lib/powerpc64le-linux-gnu.jl | 149 ++++++++++++++++++++++++----- lib/x86_64-apple-darwin14.jl | 149 ++++++++++++++++++++++++----- lib/x86_64-linux-gnu.jl | 149 ++++++++++++++++++++++++----- lib/x86_64-linux-musl.jl | 149 ++++++++++++++++++++++++----- lib/x86_64-unknown-freebsd13.2.jl | 149 ++++++++++++++++++++++++----- lib/x86_64-w64-mingw32.jl | 149 ++++++++++++++++++++++++----- 14 files changed, 1597 insertions(+), 352 deletions(-) diff --git a/Project.toml b/Project.toml index 11ee50f..bec6827 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "LibAwsHTTPFork" uuid = "d3f1d20b-921e-4930-8491-471e0be3121a" -version = "1.0.6" +version = "1.0.7" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" @@ -17,7 +17,7 @@ LibAwsCal = "1.1" LibAwsCommon = "1.2" LibAwsCompression = "1.1" LibAwsIO = "1.2" -aws_c_http_jq_jll = "=0.10.6" +aws_c_http_jq_jll = "=0.10.10" julia = "1.6" Test = "1.11" diff --git a/lib/aarch64-apple-darwin20.jl b/lib/aarch64-apple-darwin20.jl index 36c8357..7688303 100644 --- a/lib/aarch64-apple-darwin20.jl +++ b/lib/aarch64-apple-darwin20.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5) + __JL_Ctag_38 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_38 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_38}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_38, f::Symbol) + r = Ref{__JL_Ctag_38}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_38}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_38}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_38, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/7462356ce6118e7f75f705b89b1ae23564fddadc/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_38}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/aarch64-linux-gnu.jl b/lib/aarch64-linux-gnu.jl index 193893d..3e2fb59 100644 --- a/lib/aarch64-linux-gnu.jl +++ b/lib/aarch64-linux-gnu.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1203,32 +1216,6 @@ struct aws_http_proxy_negotiator_tunnelling_vtable get_retry_directive::Ptr{aws_http_proxy_negotiator_get_retry_directive_fn} end -""" - union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5) - -Documentation not found. -""" -struct var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)" - data::NTuple{8, UInt8} -end - -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)"}, f::Symbol) - f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) - f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) - return getfield(x, f) -end - -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)"}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - """ aws_http_proxy_negotiator @@ -1241,7 +1228,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/72321f4919c0bf1edfd7e8e62c651e45e8a1400a/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_182}(x + 32) return getfield(x, f) end @@ -1256,6 +1243,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2437,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2458,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2472,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2486,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2500,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2514,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2528,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2542,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2556,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2570,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2584,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2598,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2612,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2626,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3465,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3679,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/aarch64-linux-musl.jl b/lib/aarch64-linux-musl.jl index 58c5e0a..bc0ee05 100644 --- a/lib/aarch64-linux-musl.jl +++ b/lib/aarch64-linux-musl.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/8cbcd9fea1a17e8ea72a64a5faa3f9b0ecbe52e0/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/armv7l-linux-gnueabihf.jl b/lib/armv7l-linux-gnueabihf.jl index 8e205e4..5c2e36c 100644 --- a/lib/armv7l-linux-gnueabihf.jl +++ b/lib/armv7l-linux-gnueabihf.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1203,32 +1216,6 @@ struct aws_http_proxy_negotiator_tunnelling_vtable get_retry_directive::Ptr{aws_http_proxy_negotiator_get_retry_directive_fn} end -""" - union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5) - -Documentation not found. -""" -struct var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)" - data::NTuple{4, UInt8} -end - -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)"}, f::Symbol) - f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) - f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) - return getfield(x, f) -end - -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)"}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - """ aws_http_proxy_negotiator @@ -1241,7 +1228,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 12) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a9848e880812b56aa3e4d8c66a728db0c3982faa/include/aws/http/proxy.h:310:5)"}(x + 16) + f === :strategy_vtable && return Ptr{__JL_Ctag_182}(x + 16) return getfield(x, f) end @@ -1256,6 +1243,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2437,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2458,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2472,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2486,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2500,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2514,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2528,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2542,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2556,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2570,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2584,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2598,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2612,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2626,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3465,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3679,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/armv7l-linux-musleabihf.jl b/lib/armv7l-linux-musleabihf.jl index d333bc1..dea0d4f 100644 --- a/lib/armv7l-linux-musleabihf.jl +++ b/lib/armv7l-linux-musleabihf.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{4, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 12) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/31839854613f4013fbc05c340b7ba53adf547133/include/aws/http/proxy.h:310:5)"}(x + 16) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 16) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/i686-linux-gnu.jl b/lib/i686-linux-gnu.jl index d181239..58bae1d 100644 --- a/lib/i686-linux-gnu.jl +++ b/lib/i686-linux-gnu.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5) + __JL_Ctag_173 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_173 data::NTuple{4, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_173}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_173, f::Symbol) + r = Ref{__JL_Ctag_173}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_173}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_173}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_173, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 12) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/bd2b9facd76374134196421e5b59cd9ea2a63411/include/aws/http/proxy.h:310:5)"}(x + 16) + f === :strategy_vtable && return Ptr{__JL_Ctag_173}(x + 16) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/i686-linux-musl.jl b/lib/i686-linux-musl.jl index b1dbbdc..dea0d4f 100644 --- a/lib/i686-linux-musl.jl +++ b/lib/i686-linux-musl.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{4, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 12) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/1d5e3a62de4e41310f1f1d538492bda10b2a3035/include/aws/http/proxy.h:310:5)"}(x + 16) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 16) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/powerpc64le-linux-gnu.jl b/lib/powerpc64le-linux-gnu.jl index 482e5ed..c32d626 100644 --- a/lib/powerpc64le-linux-gnu.jl +++ b/lib/powerpc64le-linux-gnu.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5) + __JL_Ctag_173 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_173 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_173}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_173, f::Symbol) + r = Ref{__JL_Ctag_173}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_173}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_173}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_173, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/c71abb465052c59db9db52b1af0e2cc235f6b274/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_173}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/x86_64-apple-darwin14.jl b/lib/x86_64-apple-darwin14.jl index bf9a0b3..7688303 100644 --- a/lib/x86_64-apple-darwin14.jl +++ b/lib/x86_64-apple-darwin14.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5) + __JL_Ctag_38 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_38 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_38}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_38, f::Symbol) + r = Ref{__JL_Ctag_38}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_38}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_38}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_38, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3d11ec9c8043d0ecb7448b222ece57fdcc531ed4/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_38}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/x86_64-linux-gnu.jl b/lib/x86_64-linux-gnu.jl index 3f55b3a..f6ccc5a 100644 --- a/lib/x86_64-linux-gnu.jl +++ b/lib/x86_64-linux-gnu.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5) + __JL_Ctag_164 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_164 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_164}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_164, f::Symbol) + r = Ref{__JL_Ctag_164}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_164}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_164}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_164, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/b31b227f1fc78622c2fc9a73430ce121c15043b6/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_164}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/x86_64-linux-musl.jl b/lib/x86_64-linux-musl.jl index 6a436c4..bc0ee05 100644 --- a/lib/x86_64-linux-musl.jl +++ b/lib/x86_64-linux-musl.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a5883dfcc7d780ab48d734e9f43d548a4a937006/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/x86_64-unknown-freebsd13.2.jl b/lib/x86_64-unknown-freebsd13.2.jl index 6b70228..bc0ee05 100644 --- a/lib/x86_64-unknown-freebsd13.2.jl +++ b/lib/x86_64-unknown-freebsd13.2.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/a8be25ce6e830ee34ddae452f606137d606305a9/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """ diff --git a/lib/x86_64-w64-mingw32.jl b/lib/x86_64-w64-mingw32.jl index 44b3a5c..bc0ee05 100644 --- a/lib/x86_64-w64-mingw32.jl +++ b/lib/x86_64-w64-mingw32.jl @@ -1,4 +1,4 @@ -using CEnum +using CEnum: CEnum, @cenum # typedef void ( aws_http_on_client_connection_setup_fn ) ( struct aws_http_connection * connection , int error_code , void * user_data ) """ @@ -868,6 +868,19 @@ function aws_http_library_clean_up() ccall((:aws_http_library_clean_up, libaws_c_http_jq), Cvoid, ()) end +""" + aws_http_error_code_is_retryable(error_code) + +Documentation not found. +### Prototype +```c +bool aws_http_error_code_is_retryable(int error_code); +``` +""" +function aws_http_error_code_is_retryable(error_code) + ccall((:aws_http_error_code_is_retryable, libaws_c_http_jq), Bool, (Cint,), error_code) +end + """ aws_http_status_text(status_code) @@ -1204,31 +1217,39 @@ struct aws_http_proxy_negotiator_tunnelling_vtable end """ - union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5) + __JL_Ctag_29 Documentation not found. """ -struct var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)" +struct __JL_Ctag_29 data::NTuple{8, UInt8} end -function Base.getproperty(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)"}, f::Symbol) +function Base.getproperty(x::Ptr{__JL_Ctag_29}, f::Symbol) f === :forwarding_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_forwarding_vtable}}(x + 0) f === :tunnelling_vtable && return Ptr{Ptr{aws_http_proxy_negotiator_tunnelling_vtable}}(x + 0) return getfield(x, f) end -function Base.getproperty(x::var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)", f::Symbol) - r = Ref{var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)"}(x) - ptr = Base.unsafe_convert(Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)"}, r) +function Base.getproperty(x::__JL_Ctag_29, f::Symbol) + r = Ref{__JL_Ctag_29}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_29}, r) fptr = getproperty(ptr, f) GC.@preserve r unsafe_load(fptr) end -function Base.setproperty!(x::Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)"}, f::Symbol, v) +function Base.setproperty!(x::Ptr{__JL_Ctag_29}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::__JL_Ctag_29, private::Bool = false) + (:forwarding_vtable, :tunnelling_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_negotiator @@ -1241,7 +1262,7 @@ end function Base.getproperty(x::Ptr{aws_http_proxy_negotiator}, f::Symbol) f === :ref_count && return Ptr{aws_ref_count}(x + 0) f === :impl && return Ptr{Ptr{Cvoid}}(x + 24) - f === :strategy_vtable && return Ptr{var"union (unnamed at /home/runner/.julia/artifacts/3b7300c7e9fe43ca5e48368e5a507dba1875d87a/include/aws/http/proxy.h:310:5)"}(x + 32) + f === :strategy_vtable && return Ptr{__JL_Ctag_29}(x + 32) return getfield(x, f) end @@ -1256,6 +1277,14 @@ function Base.setproperty!(x::Ptr{aws_http_proxy_negotiator}, f::Symbol, v) unsafe_store!(getproperty(x, f), v) end +function Base.propertynames(x::aws_http_proxy_negotiator, private::Bool = false) + (:ref_count, :impl, :strategy_vtable, if private + fieldnames(typeof(x)) + else + () + end...) +end + """ aws_http_proxy_strategy_basic_auth_options @@ -2442,14 +2471,15 @@ function aws_http_message_set_body_stream(message, body_stream) end """ -Documentation not found. +aws\\_future """ mutable struct aws_future_http_message end """ aws_future_http_message_new(alloc) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2462,7 +2492,8 @@ end """ aws_future_http_message_set_result_by_move(future, pointer_address) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2475,7 +2506,8 @@ end """ aws_future_http_message_get_result_by_move(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2488,7 +2520,8 @@ end """ aws_future_http_message_peek_result(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2501,7 +2534,8 @@ end """ aws_future_http_message_acquire(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2514,7 +2548,8 @@ end """ aws_future_http_message_release(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2527,7 +2562,8 @@ end """ aws_future_http_message_set_error(future, error_code) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2540,7 +2576,8 @@ end """ aws_future_http_message_is_done(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2553,7 +2590,8 @@ end """ aws_future_http_message_get_error(future) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2566,7 +2604,8 @@ end """ aws_future_http_message_register_callback(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2579,7 +2618,8 @@ end """ aws_future_http_message_register_callback_if_not_done(future, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2592,7 +2632,8 @@ end """ aws_future_http_message_register_event_loop_callback(future, event_loop, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2605,7 +2646,8 @@ end """ aws_future_http_message_register_channel_callback(future, channel, on_done, user_data) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -2618,7 +2660,8 @@ end """ aws_future_http_message_wait(future, timeout_ns) -Documentation not found. +aws\\_future + ### Prototype ```c AWS_FUTURE_T_POINTER_WITH_RELEASE_DECLARATION(aws_future_http_message, struct aws_http_message, AWS_HTTP_API); @@ -3456,6 +3499,20 @@ struct aws_websocket_client_connection_options host_resolution_config::Ptr{aws_host_resolution_config} end +""" + aws_websocket_server_upgrade_options + +Documentation not found. +""" +struct aws_websocket_server_upgrade_options + initial_window_size::Csize_t + user_data::Ptr{Cvoid} + on_incoming_frame_begin::Ptr{aws_websocket_on_incoming_frame_begin_fn} + on_incoming_frame_payload::Ptr{aws_websocket_on_incoming_frame_payload_fn} + on_incoming_frame_complete::Ptr{aws_websocket_on_incoming_frame_complete_fn} + manual_window_management::Bool +end + # typedef bool ( aws_websocket_stream_outgoing_payload_fn ) ( struct aws_websocket * websocket , struct aws_byte_buf * out_buf , void * user_data ) """ Called repeatedly as the websocket's payload is streamed out. The user should write payload data to out\\_buf, up to available capacity. The websocket will mask this data for you, if necessary. Invoked repeatedly on the websocket's event-loop thread. @@ -3656,6 +3713,50 @@ function aws_http_message_new_websocket_handshake_request(allocator, path, host) ccall((:aws_http_message_new_websocket_handshake_request, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor, aws_byte_cursor), allocator, path, host) end +""" + aws_websocket_is_websocket_request(request) + +Return true if the request is a valid websocket upgrade request. + +### Prototype +```c +bool aws_websocket_is_websocket_request(const struct aws_http_message *request); +``` +""" +function aws_websocket_is_websocket_request(request) + ccall((:aws_websocket_is_websocket_request, libaws_c_http_jq), Bool, (Ptr{aws_http_message},), request) +end + +""" + aws_http_message_new_websocket_handshake_response(allocator, accept_key) + +Create response with all required fields for a websocket upgrade response. The following headers are added: + +Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: + +### Prototype +```c +struct aws_http_message *aws_http_message_new_websocket_handshake_response( struct aws_allocator *allocator, struct aws_byte_cursor accept_key); +``` +""" +function aws_http_message_new_websocket_handshake_response(allocator, accept_key) + ccall((:aws_http_message_new_websocket_handshake_response, libaws_c_http_jq), Ptr{aws_http_message}, (Ptr{aws_allocator}, aws_byte_cursor), allocator, accept_key) +end + +""" + aws_websocket_upgrade(allocator, stream, options) + +Upgrade an incoming HTTP connection to a websocket connection. This function should be called from the on\\_request\\_done callback of a request handler. It expects a fully constructed request and will handle sending the handshake response and install the websocket handler into the channel. + +### Prototype +```c +struct aws_websocket *aws_websocket_upgrade( struct aws_allocator *allocator, struct aws_http_stream *stream, const struct aws_websocket_server_upgrade_options *options); +``` +""" +function aws_websocket_upgrade(allocator, stream, options) + ccall((:aws_websocket_upgrade, libaws_c_http_jq), Ptr{aws_websocket}, (Ptr{aws_allocator}, Ptr{aws_http_stream}, Ptr{aws_websocket_server_upgrade_options}), allocator, stream, options) +end + """ Documentation not found. """