Skip to content

Commit

Permalink
session REFACTOR clarify server/client side when receiving hello
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed May 27, 2024
1 parent d3f425f commit 1022f92
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,8 +1354,14 @@ nc_send_hello_io(struct nc_session *session)
return ret;
}

/**
* @brief Receive server hello message on the client.
*
* @param[in] session Client session to use.
* @return Received message type.
*/
static NC_MSG_TYPE
nc_recv_client_hello_io(struct nc_session *session)
nc_client_recv_hello_io(struct nc_session *session)
{
struct ly_in *msg;
struct lyd_node *hello = NULL, *iter;
Expand Down Expand Up @@ -1437,8 +1443,14 @@ nc_recv_client_hello_io(struct nc_session *session)
return rc;
}

/**
* @brief Receive client hello message on the server.
*
* @param[in] session Server session to use.
* @return Received message type.
*/
static NC_MSG_TYPE
nc_recv_server_hello_io(struct nc_session *session)
nc_server_recv_hello_io(struct nc_session *session)
{
struct ly_in *msg;
struct lyd_node *hello = NULL, *iter;
Expand Down Expand Up @@ -1515,9 +1527,9 @@ nc_handshake_io(struct nc_session *session)
}

if (session->side == NC_CLIENT) {
type = nc_recv_client_hello_io(session);
type = nc_client_recv_hello_io(session);
} else {
type = nc_recv_server_hello_io(session);
type = nc_server_recv_hello_io(session);
}

return type;
Expand Down

0 comments on commit 1022f92

Please sign in to comment.