[gnutls-devel] pull_timeout_func invoked with transport_send_ptr instead of transport_recv_ptr

JMRecio josemrecio at gmail.com
Wed Apr 16 20:30:13 CEST 2014

Hello, all,

I am using GnuTLS 3.2.13 (background on the project below), I have found 
a behaviour that I think is a bug:

pull_timeout_func() is invoked with the transport pointer registered for 
push_func(), it is not invoked with the same transport pointer as 

See first line in _gnutls_io_check_recv(), fd is assigned to 
session->internals.transport_send_ptr instead of 

int _gnutls_io_check_recv(gnutls_session_t session, unsigned int ms)
         gnutls_transport_ptr_t fd = session->internals.transport_send_ptr;
         int ret = 0, err;

         if (unlikely
             (session->internals.pull_timeout_func == system_recv_timeout
              && session->internals.pull_func != system_read)) {
                 _gnutls_debug_log("The pull function has been replaced 
but not the pull timeout.");

Background (probably not relevant, but just in case): I am developing a 
SSL adaptor to netty.io (powerful java async and threading framework) 
based on GnuTLS.

I/O and threading is managed by netty, received datagrams are stored in 
queues, that I can get from the pull_func() and pull_func_timeout() 
based on the transport pointer. For example, when pull_func_timeout() is 
invoked, I return a positive number if the queue is not empty.

I have found some "impedance matching" problems (that I would be happy 
to comment) but I think GnuTLS documentation and code is much better 
than anything else out there for this project, kudos for the great job.


More information about the Gnutls-devel mailing list