/* Let's ignore the input at the moment. */
rv = stream_read_try(fnc->ibuf, fnc->socket,
STREAM_WRITEABLE(fnc->ibuf));
+ /* We've got an interruption. */
+ if (rv == -2) {
+ /* Schedule next read. */
+ thread_add_read(fnc->fthread->master, fpm_read, fnc,
+ fnc->socket, &fnc->t_read);
+ return 0;
+ }
if (rv == 0) {
atomic_fetch_add_explicit(&fnc->counters.connection_closes, 1,
memory_order_relaxed);
return 0;
}
if (rv == -1) {
- if (errno == EAGAIN || errno == EWOULDBLOCK
- || errno == EINTR)
- return 0;
-
atomic_fetch_add_explicit(&fnc->counters.connection_errors, 1,
memory_order_relaxed);
zlog_warn("%s: connection failure: %s", __func__,
fnc->connecting = false;
+ /* Permit receiving messages now. */
+ thread_add_read(fnc->fthread->master, fpm_read, fnc,
+ fnc->socket, &fnc->t_read);
+
/*
* Walk the route tables to send old information before starting
* to send updated information.
fnc->connecting = (errno == EINPROGRESS);
fnc->socket = sock;
- thread_add_read(fnc->fthread->master, fpm_read, fnc, sock,
- &fnc->t_read);
+ if (!fnc->connecting)
+ thread_add_read(fnc->fthread->master, fpm_read, fnc, sock,
+ &fnc->t_read);
thread_add_write(fnc->fthread->master, fpm_write, fnc, sock,
&fnc->t_write);