Skip to content

Commit

Permalink
Fix return value of accept()
Browse files Browse the repository at this point in the history
The subscripting to get the `peer` object was wrong.
  • Loading branch information
jepler committed Mar 21, 2024
1 parent 8c5d9d2 commit 14a1972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared-module/ssl/SSLSocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ mp_obj_t common_hal_ssl_sslsocket_accept(ssl_sslsocket_obj_t *self) {
mp_obj_t sock = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL);
ssl_sslsocket_obj_t *sslsock = common_hal_ssl_sslcontext_wrap_socket(self->ssl_context, sock, true, NULL);
do_handshake(sslsock);
mp_obj_t peer = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL);
mp_obj_t peer = mp_obj_subscr(accepted, MP_OBJ_NEW_SMALL_INT(1), MP_OBJ_SENTINEL);
mp_obj_t tuple_contents[2];
tuple_contents[0] = MP_OBJ_FROM_PTR(sslsock);
tuple_contents[1] = peer;
Expand Down

0 comments on commit 14a1972

Please sign in to comment.