Hello,
> I am doing a simple ssl server/client. I use a select function to read  
> and write in the socket.
>  From my client I send 1KB of data, in one time, and then I expect to  
> read it in the server.
> In the server appli, I have got a select read hit, and I read 500B.  
> Then I expect to have a second select read hit to finish the read. But  
> it never happened, and the program is blocked in the select.
You should be aware that SSL layer buffers data.
If for example you send 1K from client, data is encapsulated in SSL
stuff and send to server (if you send for example ~32kb client may send
two SSL records because max data size is ~16kb).
When client receives this record 1kb data will be but in buffer, and if
you will read 500b from SSL layer, second 500b will stay in buffer
and waiting in select() will not gave this data.
There is function SSL_pending() for checking data in SSL buffer and
if this function give you hit that there are data in SSL buffers you
should just call SSL_read().

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to