--- Begin Message ---
Subject: |
recent gnutls.c changes broke build on Ubuntu 10.10 |
Date: |
Tue, 26 Apr 2011 00:18:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
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);
--- End Message ---
--- Begin Message ---
Subject: |
Re: recent gnutls.c changes broke build on Ubuntu 10.10 |
Date: |
Tue, 26 Apr 2011 10:57:39 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 |
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.
--- End Message ---