These are chat archives for IndySockets/Indy

21st
May 2016
davidpn
@davidpn
May 21 2016 00:00
OK.. I tried creating an instance of TIdSSLIOHandlerSocketOpenSSL for each TIdNNTP and was receiving invalid pointer issues when the objects are being destroyed
Remy Lebeau
@rlebeau
May 21 2016 00:01
I can't answer that since I can't see how your code creates and destroys objects, or what the call stack looks like when the pointer errors happen. That is what your debugger is for.
davidpn
@davidpn
May 21 2016 00:53
I've put together a test case that illustrates the problem: https://forums.embarcadero.com/thread.jspa?messageID=826456&tstart=0#826456
Remy Lebeau
@rlebeau
May 21 2016 01:03
FSSLClone.SSLOptions := SSL.SSLOptions; is wrong, don't do that. The SSLOptions property setter does not make a copy, it assigns ownership. On desktop platforms, sharing a TIdSSSLOptions object is a memory leak and a pointer error as you end up with multiple TIdSSLIOHandlerSocketOpenSSL objects trying to free the same TIdSSLOptions object during destruction. On mobile systems, ARC should be handling those issues, but it is still a logic bug having multiple client-side TIdSSLIOHandlerSocketOpenSSL objects sharing the same TIdSSLOptions object in general.
davidpn
@davidpn
May 21 2016 01:11
oops.. here was me thinking it was a set :worried:
thanks
(I'd forgotten)
davidpn
@davidpn
May 21 2016 01:42
Making progress.. now instead of never returning I get a connection timeout
davidpn
@davidpn
May 21 2016 02:15
So the problem was that I was creating the handler instance inside of a method and assigning it directly to IOHandler.. it gets destroyed at the end of the method.. holding a reference to it solves the problem