diff --git a/wmbiff/wmbiff/Imap4Client.c b/wmbiff/wmbiff/Imap4Client.c index ba12a66..ea24dd9 100644 --- a/wmbiff/wmbiff/Imap4Client.c +++ b/wmbiff/wmbiff/Imap4Client.c @@ -258,7 +258,7 @@ FILE *imap_open(Pop3 pc) encrypted session. */ tlscomm_printf(scs, "a000 CAPABILITY\r\n"); if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) { - IMAP_DM(pc, DEBUG_ERROR, "unable to query capability string"); + IMAP_DM(pc, DEBUG_ERROR, "unable to query capability string\n"); goto communication_failure; } diff --git a/wmbiff/wmbiff/tlsComm.c b/wmbiff/wmbiff/tlsComm.c index 85426a0..f37f3f5 100644 --- a/wmbiff/wmbiff/tlsComm.c +++ b/wmbiff/wmbiff/tlsComm.c @@ -229,10 +229,12 @@ tlscomm_expect(struct connection_state *scs, #ifdef USE_GNUTLS if (scs->tls_state) { /* BUF_SIZE - 1 leaves room for trailing \0 */ - thisreadbytes = - gnutls_read(scs->tls_state, - &scs->unprocessed[buffered_bytes], - BUF_SIZE - 1 - buffered_bytes); + do { + thisreadbytes = + gnutls_read(scs->tls_state, + &scs->unprocessed[buffered_bytes], + BUF_SIZE - 1 - buffered_bytes); + } while (thisreadbytes == GNUTLS_E_AGAIN); if (thisreadbytes < 0) { handle_gnutls_read_error(thisreadbytes, scs); return 0; @@ -240,9 +242,11 @@ tlscomm_expect(struct connection_state *scs, } else #endif { - thisreadbytes = - read(scs->sd, &scs->unprocessed[buffered_bytes], - BUF_SIZE - 1 - buffered_bytes); + do { + thisreadbytes = + read(scs->sd, &scs->unprocessed[buffered_bytes], + BUF_SIZE - 1 - buffered_bytes); + } while (thisreadbytes == EAGAIN); if (thisreadbytes < 0) { TDM(DEBUG_ERROR, "%s: error reading: %s\n", scs->name, strerror(errno));