Marek Marcola wrote:
   I've one query regarding SSL_write call provided by OpenSSL
library. The SSL_write could return with READ_ERROR or WRITE_ERROR
with partial writing of data. While re-attempting to send the data
once again SSL_Write expects the same arguments as that of the
previous one. If I give a different argument (say different data to
write) then what will happen to my previously unwritten data and the
new data that I'm trying to write. Can any one please explain this to
me?
Look at:

http://www.nabble.com/SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER-tf1833027.html#a5046113

Don't forget the conclusion IIRC:

http://www.nabble.com/forum/ViewPost.jtp?post=5004572&framed=y

This option does nothing active that I could see.


If you remember you put up the argument that some Operating System's require memory pinning. I took from this you meant for doing Overlapped IO on windows, I dont think that is the case with OpenSSL using the standard BIO_socket on windows.

Otherwise if your application supplied buffer was still being used by the Operating System you wouldn't be able to refill it and call SSL_write() again until that previous IO was known to have completed.

I believe BIO_socket on windows uses traditional BSD like sockets in blocking and non-blocking mode of operation (plus/minus windows socket quirks). But they dont use the native windows only Overlappping IO mode which is a different IO model all together that allows for a zero-copy for kernel.


If as you say the SSL_write() function will return >0 if it is able to fill at least one SSL record but WANT_WRITE if it can't fill any new record due to buffering full. Then providing OpenSSL does not keep around any information from the unsucessful SSL_write() call to the next; so that at the next SSL_write() starts to fill a brand new SSL record from the beginning with the application data given this time. I believe the API usage detail about the moving buffer is bogus in modern times, setting the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag does nothing but prevent the SSL_F_SSL3_WRITE_PENDING,SSL_R_BAD_WRITE_RETRY error condition.


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

Reply via email to