#define EFL_NET_DIALER_SSL_PROTECTED 1
+#define EFL_NET_SOCKET_SSL_PROTECTED 1
#define EFL_NET_DIALER_PROTECTED 1
#define EFL_NET_SOCKET_PROTECTED 1
#define EFL_IO_READER_PROTECTED 1
EOLIAN static Eo*
_efl_net_dialer_ssl_efl_object_finalize(Eo *o, Efl_Net_Dialer_Ssl_Data *pd)
{
- if (!pd->ssl_ctx)
- pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get(EFL_NET_SSL_CONTEXT_CLASS));
+ Eo *a_sock, *a_ctx;
+
+ if (efl_net_socket_ssl_adopted_get(o, &a_sock, &a_ctx))
+ {
+ efl_del(pd->sock); /* stub TCP we created */
+ pd->sock = a_sock;
+ pd->ssl_ctx = a_ctx;
+ }
+ else
+ {
+ if (!pd->ssl_ctx)
+ pd->ssl_ctx = efl_ref(efl_net_ssl_context_default_dialer_get(EFL_NET_SSL_CONTEXT_CLASS));
+
+ efl_net_socket_ssl_adopt(o, pd->sock, pd->ssl_ctx);
+ }
- efl_net_socket_ssl_adopt(o, pd->sock, pd->ssl_ctx);
return efl_finalize(efl_super(o, MY_CLASS));
}
efl_event_callback_call(o, EFL_IO_CLOSER_EVENT_CLOSED, NULL);
}
+EOLIAN static Eina_Bool
+_efl_net_socket_ssl_adopted_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd, Efl_Net_Socket **sock, Efl_Net_Ssl_Context **context)
+{
+ if (sock) *sock = pd->sock;
+ if (context) *context = pd->context;
+ return !!pd->sock;
+}
+
static Efl_Net_Ssl_Verify_Mode
_efl_net_socket_ssl_verify_mode_get(Eo *o EINA_UNUSED, Efl_Net_Socket_Ssl_Data *pd)
{
}
}
+ @property adopted @protected {
+ [[Return the adopted object, if any. Be careful!]]
+ get {
+ return: bool(false); [[$true if adopted, $false otherwise]]
+ }
+ values {
+ efl_net_socket: Efl.Net.Socket; [[The adopted object, if any, otherwise NULL]]
+ ctx: Efl.Net.Ssl.Context; [[The SSL context used when adopting the socket, if any, otherwise NULL]]
+ }
+ }
+
@property verify_mode {
[[How to verify the remote peer.]]
values {