Skip to content

Commit 87c01fd

Browse files
committed
session client BUGFIX return error on parsing errors
Refs cesnet/libnetconf2#3671
1 parent b2ab4c2 commit 87c01fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/session_client.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,14 +2202,14 @@ recv_reply(struct nc_session *session, int timeout, struct lyd_node *op, uint64_
22022202
{
22032203
LY_ERR lyrc;
22042204
struct ly_in *msg = NULL;
2205-
NC_MSG_TYPE ret = NC_MSG_ERROR;
2205+
NC_MSG_TYPE ret;
22062206
uint32_t temp_lo = LY_LOSTORE, *prev_lo;
22072207

22082208
assert(op && (op->schema->nodetype & (LYS_RPC | LYS_ACTION)));
22092209

22102210
*envp = NULL;
22112211

2212-
/* Receive messages until a rpc-reply is found or a timeout or error reached */
2212+
/* receive a message */
22132213
ret = recv_msg(session, timeout, NC_MSG_REPLY, &msg);
22142214
if (ret != NC_MSG_REPLY) {
22152215
goto cleanup;
@@ -2223,6 +2223,8 @@ recv_reply(struct nc_session *session, int timeout, struct lyd_node *op, uint64_
22232223
if (*envp) {
22242224
/* if the envelopes were parsed, check the message-id, even on error */
22252225
ret = recv_reply_check_msgid(session, *envp, msgid);
2226+
}
2227+
if (ret != NC_MSG_REPLY) {
22262228
goto cleanup;
22272229
}
22282230

0 commit comments

Comments
 (0)