diff options
| author | Eli Zaretskii | 2012-01-01 18:26:51 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-01-01 18:26:51 +0200 |
| commit | 651e947eb84b9201faa63ff6dc855a8c99ac8018 (patch) | |
| tree | 9a6066cf3d55728499d235e830736efb08859eb9 /src | |
| parent | 7da5b94434256b084e7755d53e6708f6ff4f7dc1 (diff) | |
| download | emacs-651e947eb84b9201faa63ff6dc855a8c99ac8018.tar.gz emacs-651e947eb84b9201faa63ff6dc855a8c99ac8018.zip | |
Allow Emacs on w32 to build against and work with GnuTLS 3.x.
src/gnutls.c (init_gnutls_functions): Load gnutls_check_version.
Load gnutls_transport_set_lowat only if GnuTLS version is below
2.11.1.
(emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
GnuTLS versions below 2.11.1.
lisp/term/w32-win.el (dynamic-library-alist) <gnutls>: Load
libgnutls-28.dll, from GnuTLS version 3.x, in preference to
libgnutls-26.dll.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/gnutls.c | 14 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 937b96107bc..829895d1b72 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-01-01 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * gnutls.c (init_gnutls_functions): Load gnutls_check_version. | ||
| 4 | Load gnutls_transport_set_lowat only if GnuTLS version is below | ||
| 5 | 2.11.1. | ||
| 6 | (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for | ||
| 7 | GnuTLS versions below 2.11.1. | ||
| 8 | |||
| 1 | 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com> | 9 | 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com> |
| 2 | 10 | ||
| 3 | * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning | 11 | * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning |
diff --git a/src/gnutls.c b/src/gnutls.c index 500f09432b1..bcec07b36e6 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -125,6 +125,7 @@ DEF_GNUTLS_FN (ssize_t, gnutls_record_send, | |||
| 125 | (gnutls_session_t, const void *, size_t)); | 125 | (gnutls_session_t, const void *, size_t)); |
| 126 | DEF_GNUTLS_FN (const char *, gnutls_strerror, (int)); | 126 | DEF_GNUTLS_FN (const char *, gnutls_strerror, (int)); |
| 127 | DEF_GNUTLS_FN (void, gnutls_transport_set_errno, (gnutls_session_t, int)); | 127 | DEF_GNUTLS_FN (void, gnutls_transport_set_errno, (gnutls_session_t, int)); |
| 128 | DEF_GNUTLS_FN (const char *, gnutls_check_version, (const char *)); | ||
| 128 | DEF_GNUTLS_FN (void, gnutls_transport_set_lowat, (gnutls_session_t, int)); | 129 | DEF_GNUTLS_FN (void, gnutls_transport_set_lowat, (gnutls_session_t, int)); |
| 129 | DEF_GNUTLS_FN (void, gnutls_transport_set_ptr2, | 130 | DEF_GNUTLS_FN (void, gnutls_transport_set_ptr2, |
| 130 | (gnutls_session_t, gnutls_transport_ptr_t, | 131 | (gnutls_session_t, gnutls_transport_ptr_t, |
| @@ -184,7 +185,11 @@ init_gnutls_functions (Lisp_Object libraries) | |||
| 184 | LOAD_GNUTLS_FN (library, gnutls_record_send); | 185 | LOAD_GNUTLS_FN (library, gnutls_record_send); |
| 185 | LOAD_GNUTLS_FN (library, gnutls_strerror); | 186 | LOAD_GNUTLS_FN (library, gnutls_strerror); |
| 186 | LOAD_GNUTLS_FN (library, gnutls_transport_set_errno); | 187 | LOAD_GNUTLS_FN (library, gnutls_transport_set_errno); |
| 187 | LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat); | 188 | LOAD_GNUTLS_FN (library, gnutls_check_version); |
| 189 | /* We don't need to call gnutls_transport_set_lowat in GnuTLS 2.11.1 | ||
| 190 | and later, and the function was removed entirely in 3.0.0. */ | ||
| 191 | if (!fn_gnutls_check_version ("2.11.1")) | ||
| 192 | LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat); | ||
| 188 | LOAD_GNUTLS_FN (library, gnutls_transport_set_ptr2); | 193 | LOAD_GNUTLS_FN (library, gnutls_transport_set_ptr2); |
| 189 | LOAD_GNUTLS_FN (library, gnutls_transport_set_pull_function); | 194 | LOAD_GNUTLS_FN (library, gnutls_transport_set_pull_function); |
| 190 | LOAD_GNUTLS_FN (library, gnutls_transport_set_push_function); | 195 | LOAD_GNUTLS_FN (library, gnutls_transport_set_push_function); |
| @@ -282,7 +287,12 @@ emacs_gnutls_handshake (struct Lisp_Process *proc) | |||
| 282 | (Note: this is probably not strictly necessary as the lowat | 287 | (Note: this is probably not strictly necessary as the lowat |
| 283 | value is only used when no custom pull/push functions are | 288 | value is only used when no custom pull/push functions are |
| 284 | set.) */ | 289 | set.) */ |
| 285 | fn_gnutls_transport_set_lowat (state, 0); | 290 | /* According to GnuTLS NEWS file, lowat level has been set to |
| 291 | zero by default in version 2.11.1, and the function | ||
| 292 | gnutls_transport_set_lowat was removed from the library in | ||
| 293 | version 2.99.0. */ | ||
| 294 | if (!fn_gnutls_check_version ("2.11.1")) | ||
| 295 | fn_gnutls_transport_set_lowat (state, 0); | ||
| 286 | #else | 296 | #else |
| 287 | /* This is how GnuTLS takes sockets: as file descriptors passed | 297 | /* This is how GnuTLS takes sockets: as file descriptors passed |
| 288 | in. For an Emacs process socket, infd and outfd are the | 298 | in. For an Emacs process socket, infd and outfd are the |