* gnutls.c (emacs_gnutls_handle_error): Adjust log level for EAGAIN.
(Fgnutls_boot): Set process gnutls_p later, after initialization.
* process.c (wait_reading_process_output, read_process_output)
(send_process): Check gnutls_state is not NULL.
+2013-11-05 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * process.c (wait_reading_process_output, read_process_output)
+ (send_process): Check gnutls_state is not NULL.
+
+ * gnutls.c (emacs_gnutls_handle_error): Adjust log level for EAGAIN.
+ (Fgnutls_boot): Set process gnutls_p later, after initialization.
+
2013-11-04 Jan Djärv <jan.h.d@swipnet.se>
* nsterm.m (init, run, stop:): New methods in EmacsApp for
else
{
ret = 1;
- GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str);
- /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */
+
+ switch (err)
+ {
+ case GNUTLS_E_AGAIN:
+ GNUTLS_LOG2 (3,
+ max_log_level,
+ "retry:",
+ str);
+ default:
+ GNUTLS_LOG2 (1,
+ max_log_level,
+ "non-fatal error:",
+ str);
+ }
}
if (err == GNUTLS_E_WARNING_ALERT_RECEIVED
c_hostname = SSDATA (hostname);
state = XPROCESS (proc)->gnutls_state;
- XPROCESS (proc)->gnutls_p = 1;
if (TYPE_RANGED_INTEGERP (int, loglevel))
{
emacs_gnutls_deinit (proc);
/* Mark PROC as a GnuTLS process. */
- XPROCESS (proc)->gnutls_p = 1;
XPROCESS (proc)->gnutls_state = NULL;
XPROCESS (proc)->gnutls_x509_cred = NULL;
XPROCESS (proc)->gnutls_anon_cred = NULL;
fn_gnutls_x509_crt_deinit (gnutls_verify_cert);
}
+ // Only set this flag if the whole initialization succeeded.
+ XPROCESS (proc)->gnutls_p = 1;
+
return gnutls_make_error (ret);
}
{
struct Lisp_Process *p =
XPROCESS (chan_process[channel]);
- if (p && p->gnutls_p && p->infd
+ if (p && p->gnutls_p && p->gnutls_state && p->infd
&& ((emacs_gnutls_record_check_pending
(p->gnutls_state))
> 0))
{
/* Check this specific channel. */
if (wait_proc->gnutls_p /* Check for valid process. */
+ && p->gnutls_state
/* Do we have pending data? */
&& ((emacs_gnutls_record_check_pending
(wait_proc->gnutls_state))
proc_buffered_char[channel] = -1;
}
#ifdef HAVE_GNUTLS
- if (p->gnutls_p)
+ if (p->gnutls_p && p->gnutls_state)
nbytes = emacs_gnutls_read (p, chars + carryover + buffered,
readmax - buffered);
else
#endif
{
#ifdef HAVE_GNUTLS
- if (p->gnutls_p)
+ if (p->gnutls_p && p->gnutls_state)
written = emacs_gnutls_write (p, cur_buf, cur_len);
else
#endif