Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ set(CMAKE_MACOSX_RPATH TRUE)
# micro version is changed with a set of small changes or bugfixes anywhere in the project.
set(LIBNETCONF2_MAJOR_VERSION 4)
set(LIBNETCONF2_MINOR_VERSION 2)
set(LIBNETCONF2_MICRO_VERSION 15)
set(LIBNETCONF2_MICRO_VERSION 16)
set(LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION}.${LIBNETCONF2_MINOR_VERSION}.${LIBNETCONF2_MICRO_VERSION})

# Version of the library
# Major version is changed with every backward non-compatible API/ABI change in the library, minor version changes
# with backward compatible change and micro version is connected with any internal change of the library.
set(LIBNETCONF2_MAJOR_SOVERSION 5)
set(LIBNETCONF2_MINOR_SOVERSION 3)
set(LIBNETCONF2_MICRO_SOVERSION 4)
set(LIBNETCONF2_MICRO_SOVERSION 5)
set(LIBNETCONF2_SOVERSION_FULL ${LIBNETCONF2_MAJOR_SOVERSION}.${LIBNETCONF2_MINOR_SOVERSION}.${LIBNETCONF2_MICRO_SOVERSION})
set(LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_SOVERSION})

Expand Down
17 changes: 10 additions & 7 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ nc_session_is_connected(const struct nc_session *session)
break;
#ifdef NC_ENABLED_SSH_TLS
case NC_TI_SSH:
return ssh_is_connected(session->ti.libssh.session);
fds.fd = ssh_get_fd(session->ti.libssh.session);
break;
case NC_TI_TLS:
Comment thread
Roytak marked this conversation as resolved.
fds.fd = nc_tls_get_fd_wrap(session);
break;
Expand Down Expand Up @@ -603,12 +604,8 @@ nc_write(struct nc_session *session, const void *buf, uint32_t count)

#ifdef NC_ENABLED_SSH_TLS
case NC_TI_SSH:
if (ssh_channel_is_closed(session->ti.libssh.channel) || ssh_channel_is_eof(session->ti.libssh.channel)) {
if (ssh_channel_is_closed(session->ti.libssh.channel)) {
ERR(session, "SSH channel unexpectedly closed.");
} else {
ERR(session, "SSH channel unexpected EOF.");
}
if (ssh_channel_is_closed(session->ti.libssh.channel)) {
ERR(session, "SSH channel unexpectedly closed.");
session->status = NC_STATUS_INVALID;
session->term_reason = NC_SESSION_TERM_DROPPED;
return -1;
Expand Down Expand Up @@ -862,6 +859,12 @@ nc_write_msg_io(struct nc_session *session, int io_timeout, int type, ...)
op = va_arg(ap, struct lyd_node *);
attrs = va_arg(ap, const char *);

if (session->ctx != LYD_CTX(op)) {
ERR(session, "RPC \"%s\" was created in different context than that of the session.", LYD_NAME(op));
ret = NC_MSG_ERROR;
goto cleanup;
}

/* <rpc> open */
count = asprintf(&buf, "<rpc xmlns=\"%s\" message-id=\"%" PRIu64 "\"%s>",
NC_NS_BASE, session->opts.client.msgid + 1, attrs ? attrs : "");
Expand Down
Loading