changeset 110608:06497cf3e920

(emacs_gnutls_read): Don't infloop while reading.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Mon, 27 Sep 2010 17:03:58 +0200
parents be2bf8f5f3ed
children 7867879a43ce
files src/ChangeLog src/gnutls.c
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 27 16:56:27 2010 +0200
+++ b/src/ChangeLog	Mon Sep 27 17:03:58 2010 +0200
@@ -1,6 +1,7 @@
 2010-09-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnutls.c (gnutls_log_function): Added more debugging.
+	(emacs_gnutls_read): Don't infloop while reading.
 
 2010-09-27  Kenichi Handa  <handa@m17n.org>
 
--- a/src/gnutls.c	Mon Sep 27 16:56:27 2010 +0200
+++ b/src/gnutls.c	Mon Sep 27 17:03:58 2010 +0200
@@ -67,12 +67,11 @@
 {
   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 @@
 
   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 ();