ustream-ssl: poll connection on incomplete reads
authorFelix Fietkau <nbd@nbd.name>
Thu, 18 Apr 2024 12:54:28 +0000 (14:54 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 18 Apr 2024 12:54:42 +0000 (14:54 +0200)
Reduces uloop roundtrips

Signed-off-by: Felix Fietkau <nbd@nbd.name>
ustream-ssl.c

index c4e79710998e0caeaa2b0af553809f09cf84b10b..4af5a4408f14814ac0e6a8104827eaf90d2ca755 100644 (file)
@@ -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;