rpc: serverclient: Add option to suppress errors on EOF

The protocol may not use an explicit API to close the connection and
just close the socket instead. Add option to suppress errors in such
case.
This commit is contained in:
Peter Krempa 2017-03-17 16:18:08 +01:00
parent 494c302c7f
commit 21a2d1b69c
2 changed files with 15 additions and 0 deletions

View File

@ -1637,3 +1637,16 @@ virNetServerClientGetInfo(virNetServerClientPtr client,
virObjectUnlock(client);
return ret;
}
/**
* virNetServerClientSetQuietEOF:
*
* Don't report errors for protocols that close connection by hangup of the
* socket rather than calling an API to close it.
*/
void
virNetServerClientSetQuietEOF(virNetServerClientPtr client)
{
virNetSocketSetQuietEOF(client->sock);
}

View File

@ -152,4 +152,6 @@ int virNetServerClientGetInfo(virNetServerClientPtr client,
bool *readonly, char **sock_addr,
virIdentityPtr *identity);
void virNetServerClientSetQuietEOF(virNetServerClientPtr client);
#endif /* __VIR_NET_SERVER_CLIENT_H__ */