aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-26 00:12:16 -0700
committerPaul Eggert2011-04-26 00:12:16 -0700
commit080e5a8d90830c0d5c9d365e429f748e938a9485 (patch)
tree0ae2c4ffc8f01c1b22411e0785ce97ad569fe28b /src
parent671875dac181f7f1337f21d013a9c3d5f235ddf2 (diff)
downloademacs-080e5a8d90830c0d5c9d365e429f748e938a9485.tar.gz
emacs-080e5a8d90830c0d5c9d365e429f748e938a9485.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/gnutls.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6614375a7c6..8bdc3861f9b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12011-04-26 Paul Eggert <eggert@cs.ucla.edu> 12011-04-26 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * gnutls.c (emacs_gnutls_handshake): Don't return a garbage value.
4 Expect the caller to check whether GNUTLS_STAGE_HANDSHAKE_CANDO <=
5 proc->gnutls_initstage, if the check is needed. The check isn't
6 needed for one caller, Fgnutls_boot.
7 (emacs_gnutls_read): Do that check. This is the other caller.
8
3 lisp.h: Fix a problem with aliasing and vector headers. 9 lisp.h: Fix a problem with aliasing and vector headers.
4 GCC 4.6.0 optimizes based on type-based alias analysis. For 10 GCC 4.6.0 optimizes based on type-based alias analysis. For
5 example, if b is of type struct buffer * and v of type struct 11 example, if b is of type struct buffer * and v of type struct
diff --git a/src/gnutls.c b/src/gnutls.c
index ea0a9857035..e75d8e71757 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -73,9 +73,6 @@ emacs_gnutls_handshake (struct Lisp_Process *proc)
73 gnutls_session_t state = proc->gnutls_state; 73 gnutls_session_t state = proc->gnutls_state;
74 int ret; 74 int ret;
75 75
76 if (proc->gnutls_initstage < GNUTLS_STAGE_HANDSHAKE_CANDO)
77 return;
78
79 if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) 76 if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET)
80 { 77 {
81#ifdef WINDOWSNT 78#ifdef WINDOWSNT
@@ -179,7 +176,8 @@ emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf,
179 176
180 if (proc->gnutls_initstage != GNUTLS_STAGE_READY) 177 if (proc->gnutls_initstage != GNUTLS_STAGE_READY)
181 { 178 {
182 emacs_gnutls_handshake (proc); 179 if (GNUTLS_STAGE_HANDSHAKE_CANDO <= proc->gnutls_initstage)
180 emacs_gnutls_handshake (proc);
183 return -1; 181 return -1;
184 } 182 }
185 rtnval = gnutls_read (state, buf, nbyte); 183 rtnval = gnutls_read (state, buf, nbyte);