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.
2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
+ * gnutls.c (emacs_gnutls_handshake): Don't return a garbage 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.
+
lisp.h: Fix a problem with aliasing and vector headers.
GCC 4.6.0 optimizes based on type-based alias analysis. For
example, if b is of type struct buffer * and v of type struct
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
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);