In event.c the processing of new data is not working always for SSL connections.
More specifically, the select is made on the 'real' socket (conn->sock), not on the encrypted one. More over there is a 4096 bytes buffer read for each return of select. The following scenario will not work in case of SSL connections:
'real' sockets receives 8000 bytes.
select detects the available data, but the connection is SSL so tls_read is invoked.
tls_read reads 8000 bytes, decrypts them and puts them in an internal buffer
tls_read returns the first 4096 bytes
at next select call, the program does not do anything as there is no data on the 'real' socket.
The fix adds a new function "tls_pending" which will return the number of bytes that can be returned from the descrypted tls buffer. I provided implementations for all 3 tls backends, but tested only openssl and windows. The gnutls implementation is trivial so probably there will not be problems with it.
In event.c the processing of new data is not working always for SSL connections.
More specifically, the select is made on the 'real' socket (conn->sock), not on the encrypted one. More over there is a 4096 bytes buffer read for each return of select. The following scenario will not work in case of SSL connections:
The fix adds a new function "tls_pending" which will return the number of bytes that can be returned from the descrypted tls buffer. I provided implementations for all 3 tls backends, but tested only openssl and windows. The gnutls implementation is trivial so probably there will not be problems with it.