@@ -379,12 +379,12 @@ retrieve_schema_data_getschema(const char *name, const char *rev, struct clb_dat
379379
380380 do {
381381 msg = nc_recv_reply (clb_data -> session , rpc , msgid , NC_READ_ACT_TIMEOUT * 1000 , 0 , & reply );
382- } while (msg == NC_MSG_NOTIF );
382+ } while (msg == NC_MSG_NOTIF || msg == NC_MSG_REPLY_ERR_MSGID );
383383 nc_rpc_free (rpc );
384384 if (msg == NC_MSG_WOULDBLOCK ) {
385385 ERR ("Session %u: timeout for receiving reply to a <get-schema> expired." , clb_data -> session -> id );
386386 return NULL ;
387- } else if (msg == NC_MSG_ERROR ) {
387+ } else if (msg == NC_MSG_ERROR || reply == NULL ) {
388388 ERR ("Session %u: failed to receive a reply to <get-schema>." , clb_data -> session -> id );
389389 return NULL ;
390390 }
@@ -710,11 +710,11 @@ build_schema_info_yl(struct nc_session *session, struct schema_info **result)
710710
711711 do {
712712 msg = nc_recv_reply (session , rpc , msgid , NC_READ_ACT_TIMEOUT * 1000 , 0 , & reply );
713- } while (msg == NC_MSG_NOTIF );
713+ } while (msg == NC_MSG_NOTIF || msg == NC_MSG_REPLY_ERR_MSGID );
714714 if (msg == NC_MSG_WOULDBLOCK ) {
715715 WRN ("Session %u: timeout for receiving reply to a <get> yang-library data expired." , session -> id );
716716 goto cleanup ;
717- } else if (msg == NC_MSG_ERROR ) {
717+ } else if (msg == NC_MSG_ERROR || reply == NULL ) {
718718 WRN ("Session %u: failed to receive a reply to <get> of yang-library data." , session -> id );
719719 goto cleanup ;
720720 }
0 commit comments