return -1;
}
- do {
+ do
+ {
ret = gnutls_record_recv (data->state, buf, len);
- if (ret < 0 && gnutls_error_is_fatal(ret) == 1)
- {
- mutt_error ("tls_socket_read (%s)", gnutls_strerror (ret));
- mutt_sleep (4);
- return -1;
- }
+ } while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+
+ if (ret < 0)
+ {
+ mutt_error ("tls_socket_read (%s)", gnutls_strerror (ret));
+ mutt_sleep (4);
+ return -1;
}
- while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
return ret;
}
do
{
- ret = gnutls_record_send (data->state, buf + sent, len - sent);
+ do
+ {
+ ret = gnutls_record_send (data->state, buf + sent, len - sent);
+ } while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+
if (ret < 0)
{
- if (gnutls_error_is_fatal(ret) == 1)
- {
- mutt_error ("tls_socket_write (%s)", gnutls_strerror (ret));
- mutt_sleep (4);
- return -1;
- }
- return ret;
+ mutt_error ("tls_socket_write (%s)", gnutls_strerror (ret));
+ mutt_sleep (4);
+ return -1;
}
+
sent += ret;
} while (sent < len);