From ec9f09be7b5252d6bb462d6b58aee58e61129f96 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 27 Sep 2010 17:03:58 +0200 Subject: [PATCH] (emacs_gnutls_read): Don't infloop while reading. --- src/ChangeLog | 1 + src/gnutls.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 85a623bed50..14177dbb6ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2010-09-27 Lars Magne Ingebrigtsen * gnutls.c (gnutls_log_function): Added more debugging. + (emacs_gnutls_read): Don't infloop while reading. 2010-09-27 Kenichi Handa diff --git a/src/gnutls.c b/src/gnutls.c index ff538328984..5d8a946fa9a 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -67,12 +67,11 @@ emacs_gnutls_read (int fildes, gnutls_session_t state, char *buf, { register int rtnval; - do { - rtnval = gnutls_read (state, buf, nbyte); - } while (rtnval == GNUTLS_E_INTERRUPTED || rtnval == GNUTLS_E_AGAIN); - fsync (STDOUT_FILENO); - - return (rtnval); + rtnval = gnutls_read (state, buf, nbyte); + if (rtnval >= 0) + return rtnval; + else + return -1; } /* convert an integer error to a Lisp_Object; it will be either a @@ -268,8 +267,8 @@ KEYFILE and optionally CALLBACK. */) state = XPROCESS (proc)->gnutls_state; - gnutls_global_set_log_level(4); - gnutls_global_set_log_function(gnutls_log_function); + //gnutls_global_set_log_level(4); + //gnutls_global_set_log_function(gnutls_log_function); /* always initialize globals. */ global_init = gnutls_emacs_global_init (); -- 2.39.5