<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi<br>
</p>
<br>
<div class="moz-cite-prefix">On 12/22/2017 12:07 PM, Frediano Ziglio
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20171222100713.6265-3-fziglio@redhat.com">
<pre wrap="">These functions do not set errno so is possible that errno is EAGAIN.</pre>
</blockquote>
<br>
s/is possible/it is possible/<br>
<br>
<blockquote type="cite"
cite="mid:20171222100713.6265-3-fziglio@redhat.com">
<pre wrap="">This would cause an infinite loop in functions like
red_stream_write_all (or potentially using the event loop).
Signed-off-by: Frediano Ziglio <a class="moz-txt-link-rfc2396E" href="mailto:fziglio@redhat.com"><fziglio@redhat.com></a>
---
server/red-stream.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server/red-stream.c b/server/red-stream.c
index f4637808c..3dbdfca82 100644
--- a/server/red-stream.c
+++ b/server/red-stream.c
@@ -596,6 +596,7 @@ static ssize_t red_stream_sasl_write(RedStream *s, const void *buf, size_t nbyte
&s->priv->sasl.encodedLength);
if (err != SASL_OK) {
spice_warning("sasl_encode error: %d", err);
+ errno = EIO;
return -1;
}
@@ -657,6 +658,7 @@ static ssize_t red_stream_sasl_read(RedStream *s, uint8_t *buf, size_t nbyte)
&decoded, &decodedlen);
if (err != SASL_OK) {
spice_warning("sasl_decode error: %d", err);
+ errno = EIO;
return -1;
}
</pre>
</blockquote>
<br>
</body>
</html>