Skip to content

Commit 423cc0d

Browse files
romanmichalvasko
authored andcommitted
session server REFACTOR move ifdefs
1 parent 8341e8b commit 423cc0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/session_server.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct nc_server_opts server_opts = {
5757

5858
static nc_rpc_clb global_rpc_clb = NULL;
5959

60+
#ifdef NC_ENABLED_SSH_TLS
6061
/**
6162
* @brief Lock CH client structures for reading and lock the specific client.
6263
*
@@ -107,6 +108,8 @@ nc_server_ch_client_unlock(struct nc_ch_client *client)
107108
pthread_rwlock_unlock(&server_opts.ch_client_lock);
108109
}
109110

111+
#endif /* NC_ENABLED_SSH_TLS */
112+
110113
int
111114
nc_server_get_referenced_endpt(const char *name, struct nc_endpt **endpt)
112115
{
@@ -2258,7 +2261,6 @@ nc_connect_ch_endpt(struct nc_ch_endpt *endpt, nc_server_ch_session_acquire_ctx_
22582261
(*session)->port = endpt->port;
22592262

22602263
/* sock gets assigned to session or closed */
2261-
#ifdef NC_ENABLED_SSH_TLS
22622264
if (endpt->ti == NC_TI_LIBSSH) {
22632265
ret = nc_accept_ssh_session(*session, endpt->opts.ssh, sock, NC_TRANSPORT_TIMEOUT);
22642266
(*session)->data = NULL;
@@ -2282,9 +2284,7 @@ nc_connect_ch_endpt(struct nc_ch_endpt *endpt, nc_server_ch_session_acquire_ctx_
22822284
msgtype = NC_MSG_WOULDBLOCK;
22832285
goto fail;
22842286
}
2285-
} else
2286-
#endif /* NC_ENABLED_SSH_TLS */
2287-
{
2287+
} else {
22882288
ERRINT;
22892289
close(sock);
22902290
msgtype = NC_MSG_ERROR;

0 commit comments

Comments
 (0)