Skip to content

Commit

Permalink
clean up merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Nov 8, 2024
1 parent 72b51a0 commit 69c22b4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/aws/io/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ struct aws_socket {
struct aws_event_loop *event_loop;
struct aws_channel_handler *handler;
int state;
enum aws_event_loop_style event_loop_style;
aws_socket_on_readable_fn *readable_fn;
void *readable_user_data;
aws_socket_on_connection_result_fn *connection_result_fn;
Expand Down
10 changes: 4 additions & 6 deletions source/darwin/nw_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <aws/common/string.h>
#include <aws/common/uuid.h>
#include <aws/io/logging.h>
#include <aws/io/private/event_loop_impl.h>

#include <Network/Network.h>
#include <aws/io/private/dispatch_queue.h>
Expand All @@ -17,7 +18,6 @@
#include <arpa/inet.h>
#include <sys/socket.h>

#ifdef AWS_USE_DISPATCH_QUEUE
static int s_determine_socket_error(int error) {
switch (error) {
case ECONNREFUSED:
Expand Down Expand Up @@ -355,7 +355,6 @@ int aws_socket_init(struct aws_socket *socket, struct aws_allocator *alloc, cons
socket->options = *options;
socket->impl = nw_socket;
socket->vtable = &s_vtable;
socket->event_loop_style = AWS_EVENT_LOOP_STYLE_COMPLETION_PORT_BASED;

aws_mutex_init(&nw_socket->synced_data.lock);
aws_mutex_lock(&nw_socket->synced_data.lock);
Expand Down Expand Up @@ -833,7 +832,7 @@ static int s_socket_connect_fn(
socket->io_handle.set_queue = s_client_set_dispatch_queue;
socket->io_handle.clear_queue = s_client_clear_dispatch_queue;

aws_event_loop_connect_handle_to_completion_port(event_loop, &socket->io_handle);
aws_event_loop_connect_handle_to_io_completion_port(event_loop, &socket->io_handle);
socket->event_loop = event_loop;

nw_socket->on_connection_result_fn = on_connection_result;
Expand Down Expand Up @@ -1144,7 +1143,7 @@ static int s_socket_start_accept_fn(
return aws_raise_error(AWS_IO_SOCKET_ILLEGAL_OPERATION_FOR_STATE);
}

aws_event_loop_connect_handle_to_completion_port(accept_loop, &socket->io_handle);
aws_event_loop_connect_handle_to_io_completion_port(accept_loop, &socket->io_handle);
socket->event_loop = accept_loop;
socket->accept_result_fn = on_accept_result;
socket->connect_accept_user_data = user_data;
Expand Down Expand Up @@ -1314,7 +1313,7 @@ static int s_socket_assign_to_event_loop_fn(struct aws_socket *socket, struct aw
// aws_mutex_lock(&nw_socket->synced_data.lock);
nw_socket->synced_data.event_loop = event_loop;

if (!aws_event_loop_connect_handle_to_completion_port(event_loop, &socket->io_handle)) {
if (!aws_event_loop_connect_handle_to_io_completion_port(event_loop, &socket->io_handle)) {
nw_connection_start(socket->io_handle.data.handle);
aws_mutex_unlock(&nw_socket->synced_data.lock);
return AWS_OP_SUCCESS;
Expand Down Expand Up @@ -1609,4 +1608,3 @@ int aws_socket_get_bound_address(const struct aws_socket *socket, struct aws_soc
*out_address = socket->local_endpoint;
return AWS_OP_SUCCESS;
}
#endif // AWS_USE_DISPATCH_QUEUE
1 change: 0 additions & 1 deletion source/posix/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ static int s_socket_init(
socket->options = *options;
socket->impl = posix_socket;
socket->vtable = &s_vtable;
socket->event_loop_style = AWS_EVENT_LOOP_STYLE_POLL_BASED;

if (existing_socket_fd < 0) {
int err = s_create_socket(socket, options);
Expand Down
2 changes: 0 additions & 2 deletions source/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ int aws_socket_connect(
aws_socket_on_connection_result_fn *on_connection_result,
void *user_data) {
AWS_PRECONDITION(socket->vtable && socket->vtable->socket_connect_fn);
AWS_PRECONDITION(socket->event_loop_style & event_loop->vtable->event_loop_style);
return socket->vtable->socket_connect_fn(socket, remote_endpoint, event_loop, on_connection_result, user_data);
}

Expand Down Expand Up @@ -61,7 +60,6 @@ int aws_socket_set_options(struct aws_socket *socket, const struct aws_socket_op

int aws_socket_assign_to_event_loop(struct aws_socket *socket, struct aws_event_loop *event_loop) {
AWS_PRECONDITION(socket->vtable && socket->vtable->socket_assign_to_event_loop_fn);
AWS_PRECONDITION(socket->event_loop_style & event_loop->vtable->event_loop_style);
return socket->vtable->socket_assign_to_event_loop_fn(socket, event_loop);
}

Expand Down
1 change: 0 additions & 1 deletion source/windows/iocp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ static int s_socket_init(
socket->state = INIT;
socket->impl = impl;
socket->options = *options;
socket->event_loop_style = AWS_EVENT_LOOP_STYLE_COMPLETION_PORT_BASED;

if (options->domain != AWS_SOCKET_LOCAL && create_underlying_socket) {
if (s_create_socket(socket, options)) {
Expand Down

0 comments on commit 69c22b4

Please sign in to comment.