According to the documentation, this is correct, and it seems to
make things work.
(emacs_gnutls_read): Return -1 if we got an error from
gnutls_read(). This allows us to actually read lots of data from
the GnuTLS stream.
+ (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR.
+ According to the documentation, this is correct, and it seems to
+ make things work.
2010-10-09 Chong Yidong <cyd@stupidchicken.com>
{
rtnval = gnutls_write (state, buf, nbyte);
- if (rtnval == -1)
+ if (rtnval < 0)
{
- if (errno == EINTR)
+ if (rtnval == GNUTLS_E_AGAIN || rtnval == GNUTLS_E_INTERRUPTED)
continue;
else
return (bytes_written ? bytes_written : -1);