Hello everyone,

I need a deeper understanding of SSL_read()/SSL_write() and was
wondering if someone could please provide some insight.

As far as I understand, OpenSSL has is a record-oriented protocol.
Lets say the record size is 16K. Let's say a client requests data of
size 40K and then waits on epoll.

1) Assuming all is well, the server will package the 40K in 3 SSL
records and send them across. Is this correct?

2) The client has now 3 SSL records in its network buffer. epoll
returns and the client app issues as SSL_read(). SSL will now read all
the 3 records, if it has sufficient internal buffer, do all the error
checking and pass it on to the application. If SSL's internal buffer
is not large enough, then the data remains in the network buffer. Is
this correct?

3) Now, if the client application wants to read all the data, then all
is well. But let's say, the app does not want to read more than 10K.
So after reading 10K, the client is done. But we still have another
30K of data in the SSL buffer. Now, the same client issues another
request for the same 40K of data from the server. What happens when
the client receives the new data? Now the SSL buffer will have 30 + 40
= 70K of data. Will the SSL read pointer still be at the beginning,
meaning the next 10 K to be delivered to the app is really data from
the previous call?

Regards, Rij
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to