1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

gnutls: peek blocks until data is available.

This commit is contained in:
Giuseppe Scrivano 2010-10-23 12:34:49 +02:00
parent c5dc4d1664
commit b38c40b34e
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2010-10-23 Giuseppe Scrivano <gscrivano@gnu.org>
* gnutls.c (wgnutls_peek): Block until data is available.
2010-10-21 Giuseppe Scrivano <gscrivano@gnu.org>
* retr.c (retrieve_url): Do not register HTML files twice.

View File

@ -184,13 +184,14 @@ wgnutls_peek (int fd, char *buf, int bufsize, void *arg)
{
do
{
if (gnutls_record_check_pending (ctx->session)
|| select_fd (fd, 0, WAIT_FOR_READ))
ret = gnutls_record_recv (ctx->session, buf + offset,
bufsize - offset);
ret = gnutls_record_recv (ctx->session, buf + offset,
bufsize - offset);
}
while (ret == GNUTLS_E_INTERRUPTED);
if (ret < 0)
return ret;
if (ret > 0)
{
memcpy (ctx->peekbuf + offset, buf + offset,