2019-01-18 05:22:23 -08:00
|
|
|
class Efl.Net.Server_Ssl extends Efl.Net.Server_Tcp {
|
2016-10-31 20:31:56 -07:00
|
|
|
[[A SSL server over TCP.
|
|
|
|
|
|
|
|
@since 1.19
|
|
|
|
]]
|
|
|
|
|
|
|
|
methods {
|
|
|
|
@property ssl_context {
|
|
|
|
[[Defines the SSL context to use for this server.
|
|
|
|
|
|
|
|
This specifies a shared context for all clients, with
|
|
|
|
certificate, private keys, CRL, CAs...
|
|
|
|
|
|
|
|
If changed in runtime, it will only affect new clients.
|
|
|
|
]]
|
|
|
|
values {
|
2016-11-07 06:58:54 -08:00
|
|
|
ssl_context: Efl.Net.Ssl.Context; [[SSL context]]
|
2016-10-31 20:31:56 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
2018-04-09 17:01:21 -07:00
|
|
|
Efl.Object.invalidate;
|
2016-10-31 20:31:56 -07:00
|
|
|
Efl.Object.destructor;
|
efl_net_server: add 'client_announce', share logic and fix a bug.
I just realized that if a client is not referenced it would leak in
the 'ssl' server as we must del it.
However, if we del the SSL socket, we're going to close the underlying
TCP. But we're from the TCP "client,add" callback and this causes
issues since "closed" will be emitted, our close callback will
unparent the client, which lead to it being deleted.
The proper solution is to only monitor "closed" if the client is
accepted. Otherwise we just check if it was closed, if we're the
parent, etc...
Fixing this in all servers were painful, we could share since most
inherit from Efl.Net.Server.Fd. Then add the "client_announce"
protected method to do it, and document how it should work.
2016-11-24 23:32:16 -08:00
|
|
|
Efl.Net.Server.client_announce;
|
2018-04-13 01:54:41 -07:00
|
|
|
Efl.Net.Server_Fd.client_add;
|
2016-10-31 20:31:56 -07:00
|
|
|
}
|
|
|
|
}
|