char ignore;
sigset_t oldmask, blockedsigs;
int timeout = -1;
+ virNetMessagePtr msg = NULL;
/* If we have existing SASL decoded data we don't want to sleep in
* the poll(), just check if any other FDs are also ready.
if (thiscall->nonBlock)
timeout = 0;
+ /* Limit timeout so that we can send keepalive request in time */
+ if (timeout == -1)
+ timeout = virKeepAliveTimeout(client->keepalive);
+
fds[0].events = fds[0].revents = 0;
fds[1].events = fds[1].revents = 0;
virNetClientLock(client);
+ if (virKeepAliveTrigger(client->keepalive, &msg)) {
+ client->wantClose = true;
+ } else if (msg && virNetClientQueueNonBlocking(client, msg) < 0) {
+ VIR_WARN("Could not queue keepalive request");
+ virNetMessageFree(msg);
+ }
+
/* If we have existing SASL decoded data, pretend
* the socket became readable so we consume it
*/