server session FEATURE check hello and idle timeouts
diff --git a/src/session.c b/src/session.c
index 04f7bf1..87ca628 100644
--- a/src/session.c
+++ b/src/session.c
@@ -754,10 +754,9 @@
int ver = -1;
int flag = 0;
- /* TODO */
- msgtype = nc_read_msg_poll(session, NC_CLIENT_HELLO_TIMEOUT * 1000, &xml);
+ msgtype = nc_read_msg_poll(session, server_opts.hello_timeout * 1000, &xml);
- switch(msgtype) {
+ switch (msgtype) {
case NC_MSG_HELLO:
/* get know NETCONF version */
LY_TREE_FOR(xml->child, node) {
@@ -787,6 +786,10 @@
case NC_MSG_ERROR:
/* nothing special, just pass it out */
break;
+ case NC_MSG_WOULDBLOCK:
+ ERR("Client's <hello> timeout elapsed.");
+ msgtype = NC_MSG_ERROR;
+ break;
default:
ERR("Unexpected message received instead of <hello>.");
msgtype = NC_MSG_ERROR;