Commit 080e5a8d authored by Paul Eggert's avatar Paul Eggert

* 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.
parent 671875da
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
......
......@@ -73,9 +73,6 @@ emacs_gnutls_handshake (struct Lisp_Process *proc)
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 @@ emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf,
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment