Find size of available data prior to ssl_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a way to obtain the amount of data available to be read?

I'm working with a system that operates in non-blocking mode using 
epoll. When an EPOLLIN event is received the aim is to read the data. 
For the non-SSL case, the amount of data can be obtained using ioctl 
FIONREAD.  This is used to malloc a suitable sized buffer, followed by 
read the data into the buffer.

How should the SSL version of our code work?  At present it is using the 
sum of the number obtained from ioctl FIONREAD (which seems suspect when 
SSL is in use and appears to be always too large) and the number from 
ssl_pending (which seems to be zero).  The buffer then has to be truncated.

Can this approach work?  Could it be improved?  Or is there some 
fundamental problem with operating in this way?




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux