mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
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:
parent
494c302c7f
commit
21a2d1b69c
@ -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);
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user