gnutls-devel
[Top][All Lists]
Advanced

[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:38:12 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux)

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...

Note that the function doesn't peek in the socket, it just returns
what's stored in the internal buffer.  You need to use poll or select to
check whether data is pending in the socket.

Presumably, if you set up a server that returns a large buffer, and
writes a client that reads just one byte, then the g_r_check_pending
function should return non-0.

> I followed the 2.7.11 version in the debugger and it quickly ends up
> in gnutls_buffers.c:_gnutls_record_buffer_get_size().  That function
> just returns the value kept in
> session->internals.application_data_buffer.length -- and that value
> seems to be consistently zero.  I haven't figured out what is supposed
> to be setting it.

It is typically set by, e.g., _gnutls_record_buffer_put.

/Simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]