David Schwartz wrote:
> 
> 
>> Hi,
>> Can anyone tell me if SSL_peek is a blocking or non-blocking call ?
> 
> It can be either.
> 
>> When I use it inside my code, then the program blocks on this fuction
>> call
>> where there is no data on the socket.
> 
> If you're using blocking socket calls, that's what will happen.
> <vne>
> Yes you are right. I made the socket non-blocking and then SSL_peek
> returned when there is no data.
> </vne>
> 
>> The reason I want to use this call is that before closing the SSL
>> connection
>> by using 'SSL_shutdown', I want to make sure that there is no pending
>> data
>> present on this connection.
> 
> SSL_peek won't help. You need to call SSL_shutdown first and then check
> for
> any pending data. No matter when and how you call SSL_peek, there will
> still
> be a point before you call SSL_shutdown and after you call SSL_peek.
> 
> If your protocol requires you to do this, the protocol is broken and
> really
> should be fixed. If it doesn't, why do this?
> <vne>
> Actually before closing a TLS connection I need to make sure that no
> pending data is present on the that socket. So, calling SSL_peek would
> tell if this is the case or not. 
> 
> As you are saying that SSL_peek should be called before SSL_shutdown, then
> how is it ensured that the connection gets closed only if all the data
> arrived on that socket is processed ? Does SSL_shutdown takes care of this
> ? or what is the significance of calling SSL_peek after SSL_shutdown ?
> 
> I am using SIP over TLS and it does not specify any such thing related to
> tls.
> 
> thanks !!!
> </vne>
> 
>> Is there any method to make the call SSL_peek non-blocking,i.e. it should
>> return if there is no data present on SSL connection like that
>> happens with
>> tcp peek by using option MSG_PEEK|MSG_DONTWAIT.
> 
>> Or can SSL_pending be used for this purpose?
>> Please suggest...
> 
>> I am using openSSL version 0.9.7b.
> 
> What is your outer problem? Why do you think you need to do this? What
> protocol are you implementing over SSL?
> 
> DS
> 
> 
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/non-blocking-version-of-SSL_peek-tp19876548p19917760.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.

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

Reply via email to