path: root/src/
diff options
authorCarsten Haitzler (Rasterman) <>2017-01-08 22:57:54 +0900
committerCarsten Haitzler (Rasterman) <>2017-01-09 15:29:33 +0900
commitbd2f189d4c8dcaecde9b821f59ccd3978f940dfd (patch)
treec5bba7b5ebda7b4e72fc0ee38acd518bb8b28560 /src/
parent5bb9294966ef8a95089edb390e1093750ba38ca7 (diff)
ecore_con - move libproxy to a slave binary with stdin/out msging
so here's the ugly problem. libproxy. yes. we've discussed memory usage (e.g. it may have to execute javascript and pull in lots of deps etc.) but we dlopene'd on the fly. ok... but this didn't solve another issue i hit: libproxy was causing enlightenment to abort(). some internal bit of libproxy was raising a c++ exception. this wasn't caught. this causes an abort(). takes down your entire desktop. FANTASTIC. this is bad. i wouldnt' expect a library we depend on to be THIS anti-social but libproxy seemingly is. it SHOULd catch its error sand just propagate back to us so we can handle gracefully. there reall is no way around this - isolate libproxy. it's even worse that libproxy can load arbitrary modules that come from anywhere sho who knows what issues this can cause. isolation is the best solution i can think of. so this makes an elf+net_proxy_helper we spawn the first time we need a proxy lookup. we re-use that binary again and again until it exits (it should exit after 10 seconds of being idle with no requests coming in/pending). it'll respawn again later if needed. this involves now the efl net threads having to marshall back to mainloop to do the spawn and to write to the proxy process (reading is done by async exe data events and the data is passed down a thread queue to the waitng efl net thread). if the exe dies with pending requests unanswered then it's respawned again and the req's are re-sent to it... just in case. it has a limit on how often it'll respawn quickly. this seems to work in my limited testing. this ALSO now isolates memory usage of libproxy to another slave process AND this process will die taking its memory with it once it's been idle for long enough. that;s also another good solution to keeping libproxy impact at bay.
Diffstat (limited to 'src/')
1 files changed, 23 insertions, 1 deletions
diff --git a/src/ b/src/
index 3c62337d2f..093c26a183 100644
--- a/src/
+++ b/src/
@@ -80,6 +80,7 @@ nodist_installed_ecoreconmainheaders_DATA = \
80lib_ecore_con_libecore_con_la_SOURCES = \ 80lib_ecore_con_libecore_con_la_SOURCES = \
81lib/ecore_con/ecore_con_alloc.c \ 81lib/ecore_con/ecore_con_alloc.c \
82lib/ecore_con/ecore_con.c \ 82lib/ecore_con/ecore_con.c \
83lib/ecore_con/ecore_con_proxy_helper.c \
83lib/ecore_con/ecore_con_legacy.c \ 84lib/ecore_con/ecore_con_legacy.c \
84lib/ecore_con/ecore_con_eet.c \ 85lib/ecore_con/ecore_con_eet.c \
85lib/ecore_con/ecore_con_socks.c \ 86lib/ecore_con/ecore_con_socks.c \
@@ -152,7 +153,12 @@ lib/ecore_con/efl_net_dialer_unix.c \
152lib/ecore_con/efl_net_server_unix.c 153lib/ecore_con/efl_net_server_unix.c
153endif 154endif
154 155
155lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_CON_CFLAGS@ 156lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
157-DPACKAGE_BIN_DIR=\"$(bindir)\" \
158-DPACKAGE_LIB_DIR=\"$(libdir)\" \
159-DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \
160-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
156lib_ecore_con_libecore_con_la_LIBADD = @ECORE_CON_LIBS@ @EVIL_LIBS@ 162lib_ecore_con_libecore_con_la_LIBADD = @ECORE_CON_LIBS@ @EVIL_LIBS@
157lib_ecore_con_libecore_con_la_DEPENDENCIES = @ECORE_CON_INTERNAL_LIBS@ 163lib_ecore_con_libecore_con_la_DEPENDENCIES = @ECORE_CON_INTERNAL_LIBS@
158lib_ecore_con_libecore_con_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ 164lib_ecore_con_libecore_con_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
@@ -169,6 +175,22 @@ static_libs/http-parser/test.c \
169static_libs/http-parser/contrib/parsertrace.c \ 175static_libs/http-parser/contrib/parsertrace.c \
170static_libs/http-parser/contrib/url_parser.c 176static_libs/http-parser/contrib/url_parser.c
171 177
178### Binary
179proxyhelperdir = \
181proxyhelper_PROGRAMS = bin/ecore_con/efl_net_proxy_helper
183bin_ecore_con_efl_net_proxy_helper_SOURCES = \
186bin_ecore_con_efl_net_proxy_helper_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
187-DPACKAGE_BIN_DIR=\"$(bindir)\" \
188-DPACKAGE_LIB_DIR=\"$(libdir)\" \
189-DPACKAGE_DATA_DIR=\"$(datadir)/ecore\" \
191bin_ecore_con_efl_net_proxy_helper_LDADD = @USE_EINA_LIBS@
192bin_ecore_con_efl_net_proxy_helper_DEPEDNENCIES = @USE_EINA_INTERNAL_LIBS@
172### Unit tests 194### Unit tests
173 195