path: root/src/lib/ecore_con/efl_net_server_unix.c (unfollow)
AgeCommit message (Collapse)Author
2020-04-12fix buid on bsdCarsten Haitzler (Rasterman)
2020-04-12ecore con - clean up file lock andunlock on failed bindCarsten Haitzler (Rasterman)
didnt do this if bind failed... so do it now.
2020-02-15ecore con - also be paranoid with same nul byte checks in path strCarsten Haitzler (Rasterman)
this won't affect the target system which doesn't do abstract sockets anyway, and it's just unlink "" ... but check if first byte is nul for an asbtract socket and dont do lock files or unlinking in this case
2020-02-15ecore_con - on bsd if we get flock unlink old socket by forceCarsten Haitzler (Rasterman)
trying to address other parts of the bsd socket hanging on bind() etc. ... unlink socket if we get the file lock as we should now have an exclusive lock on the socket anyway - clear out the old one by force once we have the lock.
2020-01-27ecore_con - try an extended bsd workaround by keeping lock openCarsten Haitzler (Rasterman)
so keep lock file open for whole duration the socket is bound because bsd seesm to not do this right... :( (2 things can call bind() on the same socket with 1 of them block forever).
2020-01-18ecore_con - freebsd bind blocking workaroundCarsten Haitzler (Rasterman)
this is to try do a workaround a hard to reproduce blocking bind on some freebsd systems (i can't repro it on my fbsd vm), so try use file locks as an extra barrier and hope they do the right thing without other mysterious problems. @fix
2019-03-08efl-net: namespace events to avoid naming conflictsMike Blumenkrantz
Reviewed-by: Cedric BAIL <> Differential Revision:
2018-05-01ecore: move close_on_destructor to close_on_invalidate as that describe the ↵Cedric BAIL
behavior best. Fix all use to correctly behave on invalidate.
2018-04-17eolian gen: enable constness generation on property getter implsDaniel Kolesa
This changes a lot of things all across the EFL. Previously, methods tagged @const had both their external prototype and internal impl generated with const on object, while property getters only had const on the external API. This is now changed and it all has const everywhere. Ref T6859.
2017-12-20ecore_con: bug workaround SO_REUSEADDR and EADDRINUSE from bind (fix)Carsten Haitzler (Rasterman)
what i'm seeing is this with local unix sockets: 1. server process not cleanly shut down (kill -9 for example). 2. run server process again and bind fails due to EADDRINUSE 3. we ARE doing setsockopt() with SO_REUSEADDR set to 1 ... this just makes no sense because setsockopt() SHOULD allow use to re-use... the previous efreetd process for example is gone. no such process, yet socket is not re-usable. this should just not happen due to SO_REUSEADDR, but it does. this has nasty consequences like efreetd maybe never running because of stale sockets. this should never have happened, but it does. odd. so a hacky workaround: 1. try bind. 2. if bind fails with EADDRINUSE and its a socket path AND pd->unlink_before_bind is NOT set... then try a connect to the socket. 3. if connect succeeds then fail as normal (close socket and error on bind'ing) if connect fails then we have a stale socket, so unlink it forcibly. create the socket again and try bind again. hacky but... fixes the core issue. @fix
2017-07-29efl net - fix ipv6 getsockname to use the proper struct to do itCarsten Haitzler (Rasterman)
struct sockaddr_storage *addr; AS the actual storage ( a ptr to store the whole data). kind of... wrong. it should be: struct sockaddr_storage addr; see examples of this kind of usage of getsockname: found by PVS studio @fix
2016-12-12efl_net: move error COULDNT_RESOLVE_HOST to broader scope.Gustavo Sverzut Barbieri
This error is shared by Dialer and Server, will also be used by IP resolution.
2016-12-09efl_net_server_unix: do not mkpath for abstract sockets.Gustavo Sverzut Barbieri
2016-11-25efl_net_server_unix: add leading_directories_create property.Gustavo Sverzut Barbieri
This allows us to crete any parent directories that are missing.
2016-11-25efl_net_server: add 'client_announce', share logic and fix a bug.Gustavo Sverzut Barbieri
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-23efl_net_server_unix: do bind() from serve() method.Gustavo Sverzut Barbieri
Instead of adding a job to create the socket and call bind(), do it straight from the serve() method, this allows the caller to set umask(), permissions and so on. Document this behavior in the class, since we can't extend the method's documentation.
2016-11-18efl_net: use SOCKET_FMT to format SOCKET so it works on UNIX and Windows.Gustavo Sverzut Barbieri
On Windows SOCKET is unsigned, thus will cause sign errors when formatting with "%d" or comparing with signed values. On UNIX it was quiet and easy to miss, thus a new #define can be used to check for those. It will use 'unsigned long' as SOCKET, thus will complain out loud and not even work correctly when using pointers on 64bits UNIX on mistakes -- which should improve the situation. This helped to fix lots of missing conversions, all fixed. This partially addresses D4357.
2016-11-09efl_net_server_unix: fix invalid socket comparison.Gustavo Sverzut Barbieri
Fixes CID 1365321.
2016-11-01efl_net_server support systemd socket activation.Gustavo Sverzut Barbieri
It includes extensive verifications to avoid mistakes and usage of incorrect sockets.
2016-10-26addded efl_net_{socket,dialer,server}_unixGustavo Sverzut Barbieri
This introduces AF_UNIX server and dialer, these are not available on Windows as in that platform we'll create a custom class for native 'local' communication. In the future we can add a wrapper class Efl.Net.Local that will use the class for each platform, but won't expose its details. For instance, if we ever expose 'credentials' (which I didn't because they are not portable), then it doesn't make sense to try to match that on Windows. The 'Efl.Net.Local' would just stick to the basics: Reader, Writer and Closer APIs.