Skip to content

Commit

Permalink
To support VSOCK, stop limiting port to 16 bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Dec 30, 2023
1 parent f4a52c8 commit 40b0209
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crt/aws-c-common
2 changes: 1 addition & 1 deletion crt/aws-c-s3
4 changes: 2 additions & 2 deletions source/event_stream_rpc_client_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions source/http_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion source/http_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions source/mqtt5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions source/mqtt_client_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions source/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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,
Expand Down

0 comments on commit 40b0209

Please sign in to comment.