diff options
| author | Lars Magne Ingebrigtsen | 2011-07-17 00:49:20 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2011-07-17 00:49:20 +0200 |
| commit | 750c33f71e7281e651f7315689f9085a1d0894d7 (patch) | |
| tree | a473a0cd2af2f03d570a71bc6d3aa7650f80c84b /src | |
| parent | a80314570479945eb610a4f3f30fd6e82100195d (diff) | |
| download | emacs-750c33f71e7281e651f7315689f9085a1d0894d7.tar.gz emacs-750c33f71e7281e651f7315689f9085a1d0894d7.zip | |
Move the defintion of `gnutls-log-level' to the C level to avoid loading problems
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/gnutls.c | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 961b3e0234a..27a375c978d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -4,6 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org> | 5 | 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 6 | 6 | ||
| 7 | * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since | ||
| 8 | it's used from the C level. | ||
| 9 | |||
| 7 | * process.c: Use the same condition for POLL_FOR_INPUT in both | 10 | * process.c: Use the same condition for POLL_FOR_INPUT in both |
| 8 | keyboard.c and process.c (bug#1858). | 11 | keyboard.c and process.c (bug#1858). |
| 9 | 12 | ||
diff --git a/src/gnutls.c b/src/gnutls.c index fdc0c13a53b..52e80a69ae5 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -35,7 +35,6 @@ static int | |||
| 35 | emacs_gnutls_handle_error (gnutls_session_t, int err); | 35 | emacs_gnutls_handle_error (gnutls_session_t, int err); |
| 36 | 36 | ||
| 37 | static Lisp_Object Qgnutls_dll; | 37 | static Lisp_Object Qgnutls_dll; |
| 38 | static Lisp_Object Qgnutls_log_level; | ||
| 39 | static Lisp_Object Qgnutls_code; | 38 | static Lisp_Object Qgnutls_code; |
| 40 | static Lisp_Object Qgnutls_anon, Qgnutls_x509pki; | 39 | static Lisp_Object Qgnutls_anon, Qgnutls_x509pki; |
| 41 | static Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again, | 40 | static Lisp_Object Qgnutls_e_interrupted, Qgnutls_e_again, |
| @@ -146,7 +145,6 @@ static int | |||
| 146 | init_gnutls_functions (Lisp_Object libraries) | 145 | init_gnutls_functions (Lisp_Object libraries) |
| 147 | { | 146 | { |
| 148 | HMODULE library; | 147 | HMODULE library; |
| 149 | Lisp_Object gnutls_log_level = Fsymbol_value (Qgnutls_log_level); | ||
| 150 | int max_log_level = 1; | 148 | int max_log_level = 1; |
| 151 | 149 | ||
| 152 | if (!(library = w32_delayed_load (libraries, Qgnutls_dll))) | 150 | if (!(library = w32_delayed_load (libraries, Qgnutls_dll))) |
| @@ -195,8 +193,8 @@ init_gnutls_functions (Lisp_Object libraries) | |||
| 195 | LOAD_GNUTLS_FN (library, gnutls_x509_crt_import); | 193 | LOAD_GNUTLS_FN (library, gnutls_x509_crt_import); |
| 196 | LOAD_GNUTLS_FN (library, gnutls_x509_crt_init); | 194 | LOAD_GNUTLS_FN (library, gnutls_x509_crt_init); |
| 197 | 195 | ||
| 198 | if (NUMBERP (gnutls_log_level)) | 196 | if (NUMBERP (Vgnutls_log_level)) |
| 199 | max_log_level = XINT (gnutls_log_level); | 197 | max_log_level = XINT (Vgnutls_log_level); |
| 200 | 198 | ||
| 201 | GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", | 199 | GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", |
| 202 | SDATA (Fget (Qgnutls_dll, QCloaded_from))); | 200 | SDATA (Fget (Qgnutls_dll, QCloaded_from))); |
| @@ -399,7 +397,6 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, EMACS_INT nbyte) | |||
| 399 | static int | 397 | static int |
| 400 | emacs_gnutls_handle_error (gnutls_session_t session, int err) | 398 | emacs_gnutls_handle_error (gnutls_session_t session, int err) |
| 401 | { | 399 | { |
| 402 | Lisp_Object gnutls_log_level = Fsymbol_value (Qgnutls_log_level); | ||
| 403 | int max_log_level = 0; | 400 | int max_log_level = 0; |
| 404 | 401 | ||
| 405 | int ret; | 402 | int ret; |
| @@ -409,8 +406,8 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err) | |||
| 409 | if (err >= 0) | 406 | if (err >= 0) |
| 410 | return 0; | 407 | return 0; |
| 411 | 408 | ||
| 412 | if (NUMBERP (gnutls_log_level)) | 409 | if (NUMBERP (Vgnutls_log_level)) |
| 413 | max_log_level = XINT (gnutls_log_level); | 410 | max_log_level = XINT (Vgnutls_log_level); |
| 414 | 411 | ||
| 415 | /* TODO: use gnutls-error-fatalp and gnutls-error-string. */ | 412 | /* TODO: use gnutls-error-fatalp and gnutls-error-string. */ |
| 416 | 413 | ||
| @@ -1118,7 +1115,6 @@ syms_of_gnutls (void) | |||
| 1118 | gnutls_global_initialized = 0; | 1115 | gnutls_global_initialized = 0; |
| 1119 | 1116 | ||
| 1120 | DEFSYM (Qgnutls_dll, "gnutls"); | 1117 | DEFSYM (Qgnutls_dll, "gnutls"); |
| 1121 | DEFSYM (Qgnutls_log_level, "gnutls-log-level"); | ||
| 1122 | DEFSYM (Qgnutls_code, "gnutls-code"); | 1118 | DEFSYM (Qgnutls_code, "gnutls-code"); |
| 1123 | DEFSYM (Qgnutls_anon, "gnutls-anon"); | 1119 | DEFSYM (Qgnutls_anon, "gnutls-anon"); |
| 1124 | DEFSYM (Qgnutls_x509pki, "gnutls-x509pki"); | 1120 | DEFSYM (Qgnutls_x509pki, "gnutls-x509pki"); |
| @@ -1158,6 +1154,10 @@ syms_of_gnutls (void) | |||
| 1158 | defsubr (&Sgnutls_deinit); | 1154 | defsubr (&Sgnutls_deinit); |
| 1159 | defsubr (&Sgnutls_bye); | 1155 | defsubr (&Sgnutls_bye); |
| 1160 | defsubr (&Sgnutls_available_p); | 1156 | defsubr (&Sgnutls_available_p); |
| 1157 | |||
| 1158 | DEFVAR_INT ("gnutls-log-level", Vgnutls_log_level, | ||
| 1159 | doc: /* Logging level used by the GnuTLS functions. */); | ||
| 1160 | Vgnutls_log_level = make_number (0); | ||
| 1161 | } | 1161 | } |
| 1162 | 1162 | ||
| 1163 | #endif /* HAVE_GNUTLS */ | 1163 | #endif /* HAVE_GNUTLS */ |