summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2024-04-18 12:54:28 +0000
committerFelix Fietkau2024-04-18 12:54:42 +0000
commitf9a28a9ce86473d934693fe59dcbe344ffbc695e (patch)
treef30543ae4319c3b0765f4584c4e1885e63a6b13c
parentaf7c3532ad499bc97f568087a57ac0f4fe6f56e1 (diff)
downloadustream-ssl-f9a28a9ce86473d934693fe59dcbe344ffbc695e.tar.gz
ustream-ssl: poll connection on incomplete reads
Reduces uloop roundtrips Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--ustream-ssl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ustream-ssl.c b/ustream-ssl.c
index c4e7971..4af5a44 100644
--- a/ustream-ssl.c
+++ b/ustream-ssl.c
@@ -84,6 +84,11 @@ static bool __ustream_ssl_poll(struct ustream *s)
break;
ret = __ustream_ssl_read(us, buf, len);
+ if (ret == U_SSL_PENDING) {
+ ustream_poll(us->conn);
+ ret = __ustream_ssl_read(us, buf, len);
+ }
+
switch (ret) {
case U_SSL_PENDING:
return more;