tFix new libretls API with POLL* stuff. - rohrpost - A commandline mail client to change the world as we see it.
(HTM) git clone git://r-36.net/rohrpost
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit c783ccce7fb5e05d59bfc8815ba7191362632d96
(DIR) parent 64f5d81b5f7a51f072db45d8662563e6d8ec7307
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 14 Mar 2021 23:17:08 +0100
Fix new libretls API with POLL* stuff.
Diffstat:
imap.c | 1 -
net.c | 14 ++++++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/imap.c b/imap.c
t@@ -568,7 +568,6 @@ imap_spuriouscapability(imap_t *imap)
lineres = NULL;
retval = imap_parseline(imap, &lineres);
-
if (retval == -1 && lineres != NULL) {
retval = imap_capabilityset(imap, lineres);
if (!retval) {
(DIR) diff --git a/net.c b/net.c
t@@ -274,7 +274,12 @@ net_writetcp(net_t *net, char *buf, int len)
int
net_writetcps(net_t *net, char *buf, int len)
{
- return tls_write((struct tls *)net->data[0], buf, len);
+ int r = TLS_WANT_POLLIN;
+
+ while (r == TLS_WANT_POLLIN || r == TLS_WANT_POLLOUT)
+ r = tls_write((struct tls *)net->data[0], buf, len);
+
+ return r;
}
int
t@@ -334,7 +339,12 @@ net_readtcp(net_t *net, char *buf, int len)
int
net_readtcps(net_t *net, char *buf, int len)
{
- return tls_read((struct tls *)net->data[0], buf, len);
+ int r = TLS_WANT_POLLIN;
+
+ while (r == TLS_WANT_POLLIN || r == TLS_WANT_POLLOUT)
+ r = tls_read((struct tls *)net->data[0], buf, len);
+
+ return r;
}
int