mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
reds-stream: add reds_stream_is_plain_unix()
Utility function used in follow-up code. Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
2db3868864
commit
9a0efecd93
@ -236,6 +236,24 @@ int reds_stream_get_family(const RedsStream *s)
|
||||
return s->priv->info->laddr_ext.ss_family;
|
||||
}
|
||||
|
||||
int reds_stream_is_plain_unix(const RedsStream *s)
|
||||
{
|
||||
spice_return_val_if_fail(s != NULL, FALSE);
|
||||
|
||||
if (reds_stream_get_family(s) != AF_UNIX)
|
||||
return FALSE;
|
||||
|
||||
#if HAVE_SASL
|
||||
if (s->priv->sasl.conn)
|
||||
return FALSE;
|
||||
#endif
|
||||
if (s->priv->ssl)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -73,6 +73,7 @@ RedsStreamSslStatus reds_stream_ssl_accept(RedsStream *stream);
|
||||
int reds_stream_enable_ssl(RedsStream *stream, SSL_CTX *ctx);
|
||||
void reds_stream_set_info_flag(RedsStream *stream, unsigned int flag);
|
||||
int reds_stream_get_family(const RedsStream *stream);
|
||||
int reds_stream_is_plain_unix(const RedsStream *stream);
|
||||
|
||||
typedef enum {
|
||||
REDS_SASL_ERROR_OK,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user