diff options
| author | Ted Zlatanov | 2013-11-04 21:29:03 -0500 |
|---|---|---|
| committer | Ted Zlatanov | 2013-11-04 21:29:03 -0500 |
| commit | 194b4d9f7da7d539173b03d8a0ad434a86f6e124 (patch) | |
| tree | 58e4bc5e422254ab7029f46c0402458bb3fc72a4 /src/process.c | |
| parent | b5d402d6bda921874bc6ad6a560b19b59ac62a29 (diff) | |
| download | emacs-194b4d9f7da7d539173b03d8a0ad434a86f6e124.tar.gz emacs-194b4d9f7da7d539173b03d8a0ad434a86f6e124.zip | |
Several GnuTLS fixes for log level and initialization.
* 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.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index f6aa576e8b7..ec4cda77e1c 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4609,7 +4609,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4609 | { | 4609 | { |
| 4610 | struct Lisp_Process *p = | 4610 | struct Lisp_Process *p = |
| 4611 | XPROCESS (chan_process[channel]); | 4611 | XPROCESS (chan_process[channel]); |
| 4612 | if (p && p->gnutls_p && p->infd | 4612 | if (p && p->gnutls_p && p->gnutls_state && p->infd |
| 4613 | && ((emacs_gnutls_record_check_pending | 4613 | && ((emacs_gnutls_record_check_pending |
| 4614 | (p->gnutls_state)) | 4614 | (p->gnutls_state)) |
| 4615 | > 0)) | 4615 | > 0)) |
| @@ -4623,6 +4623,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4623 | { | 4623 | { |
| 4624 | /* Check this specific channel. */ | 4624 | /* Check this specific channel. */ |
| 4625 | if (wait_proc->gnutls_p /* Check for valid process. */ | 4625 | if (wait_proc->gnutls_p /* Check for valid process. */ |
| 4626 | && p->gnutls_state | ||
| 4626 | /* Do we have pending data? */ | 4627 | /* Do we have pending data? */ |
| 4627 | && ((emacs_gnutls_record_check_pending | 4628 | && ((emacs_gnutls_record_check_pending |
| 4628 | (wait_proc->gnutls_state)) | 4629 | (wait_proc->gnutls_state)) |
| @@ -5004,7 +5005,7 @@ read_process_output (Lisp_Object proc, register int channel) | |||
| 5004 | proc_buffered_char[channel] = -1; | 5005 | proc_buffered_char[channel] = -1; |
| 5005 | } | 5006 | } |
| 5006 | #ifdef HAVE_GNUTLS | 5007 | #ifdef HAVE_GNUTLS |
| 5007 | if (p->gnutls_p) | 5008 | if (p->gnutls_p && p->gnutls_state) |
| 5008 | nbytes = emacs_gnutls_read (p, chars + carryover + buffered, | 5009 | nbytes = emacs_gnutls_read (p, chars + carryover + buffered, |
| 5009 | readmax - buffered); | 5010 | readmax - buffered); |
| 5010 | else | 5011 | else |
| @@ -5498,7 +5499,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, | |||
| 5498 | #endif | 5499 | #endif |
| 5499 | { | 5500 | { |
| 5500 | #ifdef HAVE_GNUTLS | 5501 | #ifdef HAVE_GNUTLS |
| 5501 | if (p->gnutls_p) | 5502 | if (p->gnutls_p && p->gnutls_state) |
| 5502 | written = emacs_gnutls_write (p, cur_buf, cur_len); | 5503 | written = emacs_gnutls_write (p, cur_buf, cur_len); |
| 5503 | else | 5504 | else |
| 5504 | #endif | 5505 | #endif |