From 40b02097e832e0617ce27861f5a0cb83044be5e8 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Tue, 12 Dec 2023 15:00:55 -0800 Subject: [PATCH] To support VSOCK, stop limiting `port` to 16 bits. --- crt/aws-c-auth | 2 +- crt/aws-c-common | 2 +- crt/aws-c-event-stream | 2 +- crt/aws-c-http | 2 +- crt/aws-c-io | 2 +- crt/aws-c-mqtt | 2 +- crt/aws-c-s3 | 2 +- source/event_stream_rpc_client_connection.c | 4 ++-- source/http_connection.c | 4 ++-- source/http_proxy.c | 2 +- source/mqtt5_client.c | 6 +++--- source/mqtt_client_connection.c | 4 ++-- source/websocket.c | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/crt/aws-c-auth b/crt/aws-c-auth index baeffa791..6ba7a0f86 160000 --- a/crt/aws-c-auth +++ b/crt/aws-c-auth @@ -1 +1 @@ -Subproject commit baeffa791d9d1cf61460662a6d9ac2186aaf05df +Subproject commit 6ba7a0f8688c713dfe137716dbd5be324c2315b0 diff --git a/crt/aws-c-common b/crt/aws-c-common index b7e04cae9..8eaa0986a 160000 --- a/crt/aws-c-common +++ b/crt/aws-c-common @@ -1 +1 @@ -Subproject commit b7e04cae96df482c89be38eceb55f5eea6f13aea +Subproject commit 8eaa0986ad3cfd46c87432a2e4c8ab81a786085f diff --git a/crt/aws-c-event-stream b/crt/aws-c-event-stream index 08f24e384..63d1e1021 160000 --- a/crt/aws-c-event-stream +++ b/crt/aws-c-event-stream @@ -1 +1 @@ -Subproject commit 08f24e384e5be20bcffa42b49213d24dad7881ae +Subproject commit 63d1e1021b04ce3c3b1fc1895078ac85e0430b24 diff --git a/crt/aws-c-http b/crt/aws-c-http index 18352c8e0..6a1c157c2 160000 --- a/crt/aws-c-http +++ b/crt/aws-c-http @@ -1 +1 @@ -Subproject commit 18352c8e065c29e3451fb6161ebc246364e12cf6 +Subproject commit 6a1c157c20640a607102738909e89561a41e91e9 diff --git a/crt/aws-c-io b/crt/aws-c-io index df64f57fe..749c87e55 160000 --- a/crt/aws-c-io +++ b/crt/aws-c-io @@ -1 +1 @@ -Subproject commit df64f57feb63ab1a489ded86a87b756a48c46f35 +Subproject commit 749c87e551465ff1a3c2e8a77b1181bccff2f4b6 diff --git a/crt/aws-c-mqtt b/crt/aws-c-mqtt index eac4be396..17ee24a21 160000 --- a/crt/aws-c-mqtt +++ b/crt/aws-c-mqtt @@ -1 +1 @@ -Subproject commit eac4be396ec7499bd520724dcd91c4d5df3b729f +Subproject commit 17ee24a2177fc64cf9773d430a24e6fa06a89dd0 diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index 7dd72a99a..1dd55be83 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 7dd72a99adc6594a48186f0eeb2f18d92b93e149 +Subproject commit 1dd55be83b19a55cd9c155e2da977cdc76112a91 diff --git a/source/event_stream_rpc_client_connection.c b/source/event_stream_rpc_client_connection.c index b860f520f..47bf0948c 100644 --- a/source/event_stream_rpc_client_connection.c +++ b/source/event_stream_rpc_client_connection.c @@ -46,13 +46,13 @@ PyObject *aws_py_event_stream_rpc_client_connection_connect(PyObject *self, PyOb struct aws_allocator *alloc = aws_py_get_allocator(); const char *host_name; - uint16_t port; + uint32_t port; PyObject *bootstrap_py; PyObject *socket_options_py; PyObject *tls_options_py; PyObject *connection_py; if (!PyArg_ParseTuple( - args, "sHOOOO", &host_name, &port, &bootstrap_py, &socket_options_py, &tls_options_py, &connection_py)) { + args, "sIOOOO", &host_name, &port, &bootstrap_py, &socket_options_py, &tls_options_py, &connection_py)) { return NULL; } diff --git a/source/http_connection.c b/source/http_connection.c index f77245347..73ebac254 100644 --- a/source/http_connection.c +++ b/source/http_connection.c @@ -163,14 +163,14 @@ PyObject *aws_py_http_client_connection_new(PyObject *self, PyObject *args) { PyObject *on_shutdown_py; const char *host_name; Py_ssize_t host_name_len; - uint16_t port_number; + uint32_t port_number; PyObject *socket_options_py; PyObject *tls_options_py; PyObject *proxy_options_py; if (!PyArg_ParseTuple( args, - "OOOs#HOOO", + "OOOs#IOOO", &bootstrap_py, &on_connection_setup_py, &on_shutdown_py, diff --git a/source/http_proxy.c b/source/http_proxy.c index 5c8ed161d..c2c7c7264 100644 --- a/source/http_proxy.c +++ b/source/http_proxy.c @@ -27,7 +27,7 @@ bool aws_py_http_proxy_options_init(struct aws_http_proxy_options *proxy_options goto done; } - proxy_options->port = PyObject_GetAttrAsUint16(py_proxy_options, "HttpProxyOptions", "port"); + proxy_options->port = PyObject_GetAttrAsUint32(py_proxy_options, "HttpProxyOptions", "port"); if (PyErr_Occurred()) { goto done; } diff --git a/source/mqtt5_client.c b/source/mqtt5_client.c index 1d2862a0b..92e2b1ea1 100644 --- a/source/mqtt5_client.c +++ b/source/mqtt5_client.c @@ -811,7 +811,7 @@ PyObject *aws_py_mqtt5_client_new(PyObject *self, PyObject *args) { PyObject *socket_options_py; PyObject *tls_ctx_py; PyObject *proxy_options_py; - uint16_t port; + uint32_t port; /* Connect Options */ struct aws_byte_cursor client_id; /* optional */ @@ -856,11 +856,11 @@ PyObject *aws_py_mqtt5_client_new(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple( args, - "Os#HOOOOz#Oz#z#OOOOOOOOOz*Oz#OOOz#z*z#OOOOOOOOOOOOO", + "Os#IOOOOz#Oz#z#OOOOOOOOOz*Oz#OOOz#z*z#OOOOOOOOOOOOO", /* O */ &self_py, /* s */ &host_name.ptr, /* # */ &host_name.len, - /* H */ &port, + /* I */ &port, /* O */ &bootstrap_py, /* O */ &socket_options_py, /* O */ &tls_ctx_py, diff --git a/source/mqtt_client_connection.c b/source/mqtt_client_connection.c index 936b6791f..70da32835 100644 --- a/source/mqtt_client_connection.c +++ b/source/mqtt_client_connection.c @@ -645,7 +645,7 @@ PyObject *aws_py_mqtt_client_connection_connect(PyObject *self, PyObject *args) Py_ssize_t client_id_len; const char *server_name; Py_ssize_t server_name_len; - uint16_t port_number; + uint32_t port_number; PyObject *socket_options_py; PyObject *tls_ctx_py; uint64_t reconnect_min_timeout_secs; @@ -663,7 +663,7 @@ PyObject *aws_py_mqtt_client_connection_connect(PyObject *self, PyObject *args) PyObject *proxy_options_py; if (!PyArg_ParseTuple( args, - "Os#s#HOOKKHIIOz#z#OOO", + "Os#s#IOOKKHIIOz#z#OOO", &impl_capsule, &client_id, &client_id_len, diff --git a/source/websocket.c b/source/websocket.c index 95f9d8e6c..f66e3f23b 100644 --- a/source/websocket.c +++ b/source/websocket.c @@ -52,7 +52,7 @@ PyObject *aws_py_websocket_client_connect(PyObject *self, PyObject *args) { (void)self; struct aws_byte_cursor host; /* s# */ - uint16_t port; /* H */ + uint32_t port; /* I */ PyObject *handshake_request_py; /* O */ PyObject *bootstrap_py; /* O */ PyObject *socket_options_py; /* O */ @@ -64,7 +64,7 @@ PyObject *aws_py_websocket_client_connect(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple( args, - "s#HOOOOOpnO", + "s#IOOOOOpnO", &host.ptr, &host.len, &port,