diff options
| author | Lars Magne Ingebrigtsen | 2010-10-09 15:54:57 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2010-10-09 15:54:57 +0200 |
| commit | 2e6c74c53fbb318aa13144681400f3f80e3529f7 (patch) | |
| tree | d262f40b06be006a0ed0c87711cf1363088b5471 /src | |
| parent | 7450df5dfcac171bae556c26261ab2873573f34c (diff) | |
| download | emacs-2e6c74c53fbb318aa13144681400f3f80e3529f7.tar.gz emacs-2e6c74c53fbb318aa13144681400f3f80e3529f7.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/gnutls.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b147ab2d01f..dc80a88def3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -5,6 +5,9 @@ | |||
| 5 | (emacs_gnutls_read): Return -1 if we got an error from | 5 | (emacs_gnutls_read): Return -1 if we got an error from |
| 6 | gnutls_read(). This allows us to actually read lots of data from | 6 | gnutls_read(). This allows us to actually read lots of data from |
| 7 | the GnuTLS stream. | 7 | the GnuTLS stream. |
| 8 | (emacs_gnutls_write): Check for GNUTLS_E_AGAIN and not EINTR. | ||
| 9 | According to the documentation, this is correct, and it seems to | ||
| 10 | make things work. | ||
| 8 | 11 | ||
| 9 | 2010-10-09 Chong Yidong <cyd@stupidchicken.com> | 12 | 2010-10-09 Chong Yidong <cyd@stupidchicken.com> |
| 10 | 13 | ||
diff --git a/src/gnutls.c b/src/gnutls.c index da5b10d3190..d9ccaa5a62c 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -86,9 +86,9 @@ emacs_gnutls_write (int fildes, struct Lisp_Process *proc, char *buf, | |||
| 86 | { | 86 | { |
| 87 | rtnval = gnutls_write (state, buf, nbyte); | 87 | rtnval = gnutls_write (state, buf, nbyte); |
| 88 | 88 | ||
| 89 | if (rtnval == -1) | 89 | if (rtnval < 0) |
| 90 | { | 90 | { |
| 91 | if (errno == EINTR) | 91 | if (rtnval == GNUTLS_E_AGAIN || rtnval == GNUTLS_E_INTERRUPTED) |
| 92 | continue; | 92 | continue; |
| 93 | else | 93 | else |
| 94 | return (bytes_written ? bytes_written : -1); | 94 | return (bytes_written ? bytes_written : -1); |