all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10
@ 2011-04-26  7:18 Paul Eggert
  2011-04-26 13:05 ` Ted Zlatanov
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2011-04-26  7:18 UTC (permalink / raw)
  To: 8556; +Cc: Ted Zlatanov

bzr 103998 introduced a bug in emacs_gnutls_handshake: it has
a 'return;' statement in a function returning an integer, which
violates the C standard.  I plan to fix this with the following
patch, for lack of a better idea, but it would be nice if someone
with more expertise in gnutls could double-check this.

* gnutls.c (emacs_gnutls_handshake): Always return a value.
Expect the caller to check whether GNUTLS_STAGE_HANDSHAKE_CANDO <=
proc->gnutls_initstage, if the check is needed.  The check isn't
needed for one caller, Fgnutls_boot.
(emacs_gnutls_read): Do that check.  This is the other caller.
=== modified file 'src/gnutls.c'
--- src/gnutls.c	2011-04-26 06:17:52 +0000
+++ src/gnutls.c	2011-04-26 07:05:42 +0000
@@ -73,9 +73,6 @@
   gnutls_session_t state = proc->gnutls_state;
   int ret;

-  if (proc->gnutls_initstage < GNUTLS_STAGE_HANDSHAKE_CANDO)
-    return;
-
   if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET)
     {
 #ifdef WINDOWSNT
@@ -179,7 +176,8 @@

   if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
     {
-      emacs_gnutls_handshake (proc);
+      if (GNUTLS_STAGE_HANDSHAKE_CANDO <= proc->gnutls_initstage)
+	emacs_gnutls_handshake (proc);
       return -1;
     }
   rtnval = gnutls_read (state, buf, nbyte);






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10
  2011-04-26  7:18 bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10 Paul Eggert
@ 2011-04-26 13:05 ` Ted Zlatanov
  2011-04-26 17:57   ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Ted Zlatanov @ 2011-04-26 13:05 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnu-emacs

On Tue, 26 Apr 2011 00:18:16 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 

PE> bzr 103998 introduced a bug in emacs_gnutls_handshake: it has
PE> a 'return;' statement in a function returning an integer, which
PE> violates the C standard.  I plan to fix this with the following
PE> patch, for lack of a better idea, but it would be nice if someone
PE> with more expertise in gnutls could double-check this.

I committed a different fix, because I *think* your fix would loop
forever: we just return -1 instead, now (this doesn't overlap with
EAGAIN or GNUTLS_E_AGAIN).  But maybe I misunderstood something in your
suggestion.  

I won't be able to commit for a few days so if you still think your fix
is better or have further suggestions, please go ahead and make them.

Thanks
Ted





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10
  2011-04-26 13:05 ` Ted Zlatanov
@ 2011-04-26 17:57   ` Paul Eggert
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Eggert @ 2011-04-26 17:57 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: 8556-done

On 04/26/11 06:05, Ted Zlatanov wrote:
> I committed a different fix, because I *think* your fix would loop
> forever

Thanks for looking into it.  I'm sure your fix is better, because
I didn't really follow the code.  I'll mark this bug as done.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-26 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26  7:18 bug#8556: recent gnutls.c changes broke build on Ubuntu 10.10 Paul Eggert
2011-04-26 13:05 ` Ted Zlatanov
2011-04-26 17:57   ` Paul Eggert

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.