CESNET / libnetconf

C NETCONF library
Other
113 stars 84 forks source link

user callbacks for handling interrupt signal while waiting on receive #262

Open parkrish opened 7 years ago

parkrish commented 7 years ago

In nc_session_receive, on interrupt we break the poll and then continue. However, the interruption from the client application would have come as a result of user choosing to break the receive may be due to a long wait. In this case it may not be good to continue.

It will be good if an API is present to control a variable by user application, which can be used here and choose to continue or not depending on the variable value.

} else if (((status == -1) && (errno == EINTR))

ifndef DISABLE_LIBSSH

                            || (status == SSH_AGAIN)

endif

                            ) {
                    /* poll was interrupted */
                    continue;