void-packages/srcpkgs/libfetch/patches/use-ssl-pending.patch

19 lines
574 B
Diff
Raw Normal View History

select() times out if there's no IO ready in the socket which sometimes
might happen due to OpenSSL buffering.
Use SSL_pending(3) to make sure SSL_read(3) sucks in last buffered bytes.
--- common.c.orig 2013-01-13 17:12:06.434631196 +0100
+++ common.c 2013-01-13 17:12:36.185921621 +0100
@@ -529,6 +529,10 @@ fetch_read(conn_t *conn, char *buf, size
fetch_syserr();
return (-1);
}
+#ifdef WITH_SSL
+ if (conn->ssl && SSL_pending(conn->ssl))
+ break;
+#endif
errno = 0;
r = select(conn->sd + 1, &readfds, NULL, NULL, &waittv);
if (r == -1) {