[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnutls_record_check_pending() broken?
From: |
Simon Josefsson |
Subject: |
Re: gnutls_record_check_pending() broken? |
Date: |
Thu, 28 May 2009 18:46:03 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux) |
Simon Josefsson <address@hidden> writes:
> Peter Hendrickson <address@hidden> writes:
>
>> gnutls_record_check_pending() doesn't work for me. It always returns
>> 0, even when data is pending.
>
> How did you test this? A small code demonstrating the problem would
> help. I'll see if I can get something to work too...
Indeed, the patch below against mini.c demonstrate it working. For me
it prints:
...
ret 1
waiting 8
...
/Simon
diff --git a/tests/mini.c b/tests/mini.c
index b64401d..a883c67 100644
--- a/tests/mini.c
+++ b/tests/mini.c
@@ -218,7 +218,12 @@ doit (void)
ns = gnutls_record_send (server, MSG, strlen (MSG));
success ("server: sent %d\n", ns);
- ret = gnutls_record_recv (client, buffer, MAX_BUF);
+ ret = gnutls_record_recv (client, buffer, 1);
+ printf ("ret %d\n", ret);
+
+ printf ("waiting %d\n", gnutls_record_check_pending (client));
+
+ ret = gnutls_record_recv (client, buffer + 1, MAX_BUF);
if (ret == 0)
{
fail ("client: Peer has closed the TLS connection\n");