From: Felix Fietkau Date: Thu, 18 Apr 2024 12:54:28 +0000 (+0200) Subject: ustream-ssl: poll connection on incomplete reads X-Git-Url: http://git.openwrt.org/?p=project%2Fustream-ssl.git;a=commitdiff_plain;h=f9a28a9ce86473d934693fe59dcbe344ffbc695e ustream-ssl: poll connection on incomplete reads Reduces uloop roundtrips Signed-off-by: Felix Fietkau --- 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;