Commit Graph

39 Commits

Author SHA1 Message Date
Carsten Haitzler 34be04121d efreet - windows - still call stat but skip lstat/readlink
now stat is filled with data on windows

@fix
2020-10-06 10:18:32 +02:00
Carsten Haitzler 047872e7cc efreet - mtime 0 fix build on windows 2020-06-18 11:35:44 +01:00
Carsten Haitzler a5b84c6c6e efreetd - cache - add more statinfo work around 0 mtime distros
some distros 9notably in this case nixos) want to do reproducible
builds. to them this means going around setting mtime for all files to
0. this means efreetd not only thinks mtime is invalid/stupid (0 is
generally just that as midnight on jan 1 1970 is not exactly a
sensible dare for a modified timestamp of a file as no filesystem with
any sanity will have not been modified since that time), but it keeps
mtime at 0 even when things update. this totally breaks efreetd that
expects to find mtime increases over time as things change. it's
necessary because it has to perform a "are mu caches up to date" scan
of all file data it caches and it needs to know if it should rebuild
something based on this.

so this does a few things:

1. it makes mtime have to be an exact match to the cache, not cache
mtime >= file mtime. so any change forward or back is an inavlidation.
2. it now also uses ctime, mode, size, uid, gid, block count and if a
symlink, the sha1 of the symlink path in addition and any change to
these == invalid.

this adds a lot of code and changes how dirs get scanned a bit but it
means it can pick up changes on these 0 mtime distros.

interestingly the policy of mtime being 0 is to have a reprodcible fs
... but ctime still changes and is > 0, as does inode info, so it's
not actually possible to have it totally work... but they try still,
so this is a fix for that problem.

whilst i was doing thisi also noticed efreetd re-red dirs many times
due to icon theme inhritance. i also fixed that to do a LOT less
syscalls by only scanning a dir once as i was rejigging the scanning
code at the time anyway. this should optimize thr scan costs at
efreetd startup too.

@fix
@opt
2020-06-18 11:13:52 +01:00
Carsten Haitzler 9fd9a3b120 efreetd - ensure on bsd where connects succed despite daemon being gone
just get it to work... getting unamused with this.
2020-04-10 01:15:30 +02:00
Carsten Haitzler 6df39f0382 efreet - try less chaotic efreetd restart and delay 0.5-1.0 rand sec
try work on T8490
2020-04-09 20:45:57 +01:00
Carsten Haitzler ee6cc91a03 eina - fix eina_strndup test passing 2020-01-15 19:23:44 +00:00
Boris Faure b26085819e efreet: fix typo
Summary: efreet: fix typo

Test Plan: None

Reviewers: cedric, raster, lauromoura, devilhorns, marcelhollerbach, segfaultxavi, zmike, vtorri

Reviewed By: segfaultxavi, vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10676
2019-11-15 12:57:08 +01:00
Carsten Haitzler 2f534b0256 efreet - make efreet launch timeout configurable by env var
also report as an ERR explicitly if its a timeout.
2019-08-25 11:24:54 +01:00
Carsten Haitzler 8531380de0 efreet - be more patient for efreet to start - up to 2 sec now
seems people have issues with efreetd starting in 0.5 sec on some
systems... even rpi's manage that, but lets be more patient and wait
up to 2 sec
2019-08-09 19:09:25 +01:00
Mike Blumenkrantz 5ad16095a4 efreet: include buildsystem.h in efreet_cache.c
Summary: lib/efreet/efreet_cache.c:121:6: warning: implicit declaration of function 'bs_binary_get' is invalid in C99 [-Wimplicit-function-declaration]

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6556
2018-07-10 11:41:25 -04:00
Mike Blumenkrantz 36fc0ce77e efreet: simplify and fix efreetd launch
this previously used an entire eina prefix to determine where to find
efreetd, when a simpler approach would have been to just pass the directory
where it's being installed

this also inhibited running the correct efreetd during in-tree builds and tests,
as it was using the install prefix instead of the in-tree wrapper script

@fix
fix T6713

Differential Revision: https://phab.enlightenment.org/D6516
2018-07-06 15:51:59 +02:00
Mike Blumenkrantz b4c2db8d05 efreet: use correct path when generating error message about stale efreetd socket
Summary:
using runtime directory in all cases for this is wrong, as ecore-con has a number
of fallback codepaths for the case where runtime directory is not set or not valid.

by using the same ecore-con function which ecore-ipc uses to generate the socket
string, the error message path should always be the same as the path which is
used by efreetd

extra linkage was required by efreet in order to use ecore-con functions, so
the internal lib variable in the build system was modified to provide this

@fix

fix T7045

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T7045

Differential Revision: https://phab.enlightenment.org/D6425
2018-07-03 12:49:08 -04:00
Mike Blumenkrantz 18b6b1248d efreet: add method for disabling efreetd connection
Summary:
some minimal applications, such as test suites, may want to
disable this if they are not in need of any of the
functionality that is provided

@feature

Depends on D5965

Reviewers: cedric, stefan_schmidt

Reviewed By: cedric

Subscribers: stefan_schmidt, cedric

Differential Revision: https://phab.enlightenment.org/D5966
2018-04-27 14:35:13 +02:00
Mike Blumenkrantz 10ce0cbd8a efreet: reset ipc connection after fork
ensure that existing connection is not reused
2018-02-02 16:59:44 -05:00
Jean-Philippe Andre ff24ac2d6d efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would
become invalid, since they are now stored in a dynamic array rather than
a statically stored array.

The risk here is that if a module of EFL tends to init/shutdown in a
"normal" scenario then the event type array will grow in a leaking
manner. This could be fixed by resetting those event ID's only when the
loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using
EFL_EVENT_DEL in this patch as this would add too many event callbacks
to the main loop object, which may result in slightly slower event calls
to it, affecting the overall performance.
2017-12-19 11:14:37 +09:00
Carsten Haitzler a6dc7da029 efreetd - make ability to not connect to efreetd non-critical
it's an error we can survive, so make it that level
2017-04-23 21:17:40 +09:00
Mike Blumenkrantz d0e5564c18 efreet: CRI and fail after 10 attempts to connect to efreetd
if efreetd cannot be connected to, stop infinitely trying to spawn it
since this generates crazy cpu load

probably this path should also send some cache events so that watchers
do not simply idle forever

ref T5200
2017-03-17 15:15:25 -04:00
Cedric BAIL 168d2a1446 efreet: avoid crash during shutdown due to Ecore_Event queue. 2017-03-09 16:17:58 -08:00
Carsten Haitzler a6f7b0f834 efreet cache - handle corner case where efreetd keeps disconnecting
so an odd one. there is a socket, but nothing is actually listening on
it, but clients keep spinning launching efreetd's because the launch,
connect, then get a disconnect and try again immediately keeping
things spinning heavily, so add a delay of 0.5 sec before launchnig
another efreetd if the launch + connect fails and gets a disconnect
within 0.5 sec ... so give up for 0.5 sec before trying again to avoid
a runaway system.

@fix
2016-12-26 13:06:35 +09:00
Carsten Haitzler 561f8eaa8f efreet - save about 240-300k or so of memory used by efreet mime
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.

so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.

this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.

@optimize
2016-08-23 12:04:06 +09:00
Marcel Hollerbach 3f1d40cff8 efreet: free fallback cache on shutdown
this fixes errors like:
ERR<4864>:eet lib/eet/eet_lib.c:645 eet_shutdown() File '/home/osauser/.cache/efreet/icons___efreet_fallback_localhost.localdomain.eet' is still open 1 times !

@fix
2016-08-04 17:04:50 +02:00
Carsten Haitzler 9527240d74 efl - fix lots of little init/shutdown pairs that are wrong
i've fixed almost all the eina init/shutdown pairs to do the right
thing now... except one (ecore_shutdown) with comment inline where
eo_shutdown is not called. if this is called we are in crash land.
this needs further inspection.
2016-07-04 21:30:34 +09:00
Carsten Haitzler e89253e597 efreet - fix efreetd kill and start with clean cache case blank icons
if you kill efreetd ANd delete all the caches, the restart of efreetd
will lose all icons until an app re-registeres icon extensions and it
can scan all icons .. and then app has to actually get the right
upodate events and do the update properly when this happens. this
fixes that scenario

@fix
2015-08-12 20:08:14 +09:00
Carsten Haitzler ddb3a60518 efreetd - new ipc - re-register on reconnect 2015-06-25 11:41:15 +09:00
Carsten Haitzler 5abfefe99e efl - efreetd service move from dbus session bus to ecore ipc
this fixes warnings about no efreet dbus session bus in non session
environments as brought up on the mailing lists with:

Subject: Re: [E-devel] [EGIT] [core/efl] master 01/01: edje: unset
efreet cache update flag to prevent dbus connections

this moves all of efreetd client and server to ecore ipc, with client
auto-launching efreetd if not found as a service and trying for up to
500ms to connect. efreetd times out on last connection or no
connections after 10sec so it wont hang around forever if not in use.
it seems to work in my testing, so let me know if there is an issue.

@fix
2015-06-24 19:28:17 +09:00
Cedric BAIL 493a2b3ab4 efreet: lower error message to warning. 2015-05-14 18:41:47 +02:00
Sebastian Dransfeld b624345bbd efreet: improve messages 2014-09-29 09:39:38 +02:00
Sebastian Dransfeld 793fd5e847 efreet: Implement fields added by desktop spec 1.1 2014-09-25 08:47:45 +02:00
Sebastian Dransfeld 233ca45db0 efreet: Only lock once for efficiency 2013-11-21 09:29:25 +01:00
Sebastian Dransfeld 9707fee051 efreet: Check return value of eet_list
CID: #1039327
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 73ad466cbc efreet: TODO++ 2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 92437d7204 efreet: Formatting 2013-08-05 10:45:29 +02:00
Sebastian Dransfeld 71122d5920 efreet: Init no longer fails without dbus session
Allow programs to use efreet without requiering a dbus session. This
gives limited functionality, as efreet_icon wont work without a cache.
efreet_desktop will partially work, as it reads info from files directly
if cache is missing.
2013-06-25 04:32:26 +02:00
Sebastian Dransfeld ebcd97cc93 efreet: Create cache dir in efreet_cache_init
efreetd used efreet functions before efreet init which fails.
2013-06-21 10:00:20 +02:00
Sebastian Dransfeld ceb19aaaaa efreet: Make desktop cache threadsafe 2013-06-20 11:56:46 +02:00
Lucas De Marchi 4e3804041f Rename edbus->eldbus
git grep -l edbus2 | while read f; do sed -i 's/edbus2/eldbus/g' "$f"; done
find . -name '*edbus2*' -exec rename edbus2 eldbus {} \;

git grep -l "EDBUS" | while read f; do sed -i 's/EDBUS/ELDBUS/g' "$f"; done
git grep -l "EDBus" | while read f; do sed -i 's/EDBus/Eldbus/g' "$f"; done
git grep -l "edbus (v2)" | while read f; do sed -i 's/edbus (v2)/eldbus/g' "$f"; done
git grep -l "Edbus" | while read f; do sed -i 's/Edbus/Eldbus/g' "$f"; done
git grep -l "edbus" | while read f; do sed -i 's/edbus/eldbus/g' "$f"; done

find . -name '*edbus*' -exec rename edbus eldbus {} \;
find . -name '*EDBus*' -exec rename EDBus Eldbus {} \;
2013-04-23 12:36:29 -03:00
Cedric Bail 9abcb77c73 efreet: shutdown in the right order. 2013-04-19 15:41:41 +09:00
Lucas De Marchi d4da99698e efl/edbus: make all edbus_*_send() methods unref its msg
There's no reason to keep a msg after it was sent. Before this patch we
had edbus_service_signal_send() unref'ing its msg and all the others
not. Also, several users (particularly the edbus_proxy_send() ones) were
forgetting to unref the msg.

This patch makes all these methods unref the message after it has been
succesfully sent:

 - edbus_connection_send()
 - edbus_object_send()
 - edbus_proxy_send()
 - edbus_service_signal_send()



SVN revision: 82807
2013-01-15 14:33:48 +00:00
Gustavo Sverzut Barbieri 4bc0210bd3 efl: merge efreet.
seems to be fine, pass distcheck and friends. please report.

changes:
 - documentation hierarchy fixes
 - replaced __UNUSED__ with EINA_UNUSED
 - replaced PKG_DATA_DIR with PACKAGE_DATA_DIR"/efreet"



SVN revision: 81889
2012-12-29 23:04:40 +00:00