if the object has been deleted already, scope data is null. handle it
correctly. this fixes a segv in the new efreetd when it starts and
there is an existing efreet running thus owning the socket fails.
@fix
spewing out errors for a failed dns lookup is not somehting to ERR out
in logs all the time. it is at best a debug log. the caller handles
the failed connect itself.
@fix
Summary:
This is still work in progress. I've added new file for temporary
purpose. Idea is to first eoify everything then change its namespace properly.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2602
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Since the move to Eo, in case of error we do not need to cleanup anything when
finalize finish. The kill function was arranged to do so, but it was still emiting
an event exposing the invalid Eo object. Looking closely at the code, that should
have not happened, as there was no symetrical ADD event and the function would do
nothing else. So removing it. This prevent any potential SEGV from a function that
would catch the DEL event.
@fix
Eo files will now fail to compile if a cycle is detected.
This required some temporary changes in existing eo files
(we had 2 cycles) for which I added a FIXME (they do not
affect C generation).
@feature
This is another cleanup in perparation for the Eo stable release.
This is no longer needed thanks to the proper error reporting with
eo_constructor()'s new return value.
The finalizer change cleans it up a bit so it catches more cases/issues.
This also means that the finalizer cleans up the object in all cases,
and not only some.
@feature.
Because we defer the deletion of this object until we get all the
responses from the network, we must manually free it. A better solution
would possibly be to just free the requests upon object deletion instead
of deferring the deletion.
@fix
From now on, constructors should return a value, usually the object
being worked on, or NULL (if the constructor failed). This can also
be used for implementing singletons, by just always returning the same
object from the constructor.
This is one of the final steps towards stabilizing Eo.
@feature
Instead of "@in type name;" we now use "@in name: type;". This change
is done because of consistency with the rest of Eolian; pretty much
every other part of Eolian syntax uses the latter form.
This is a big breaking change in the .eo format, so please update your
.eo files accordingly and compile Elementary together with the EFL.
@feature
Summary: This is just the beginning. I tried for one class to check.
Tell me if this is fine, I'll change in other classes also. The goal
is to simplify and make our API clearer to understand to new comers.
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2468
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
While creating ecore_con_eet_server, if client is not set to false, then while deleting, it is checking for client and it is by default not false. So set it.
ecore_con_reply object is being deleted twice. So removed code to delete the reply object as it would be deleted after the callback.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Maniphest Tasks: T2372
Differential Revision: https://phab.enlightenment.org/D2445
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Curl is using a strange soname bumping where soname version is changed by configure when it detects some differences with off_t.
Explanations here: http://curl.haxx.se/dev/readme-curl_off_t.html
As we are not using curl_off_t in our code, we can simply load libcurl.so.5 if present.
Summary:
When executed ecore_con_lookup_example function, we were getting a crash. This is the fix for the crash. I analysed it in the valgrind and found the error. Valgrind reported invalid free at this place.
svr->name is getting freed in _ecore_con_server_eo_base_destructor function and svr is getting freed in ecore_con_shutdown function.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2398
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
last_ms is not needed at all. If curl_multi_timeout returns non zero, then its error, if it returns zero, then its fine. If ms is zero, then call curl_multi_perform immediately.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Maniphest Tasks: T2200
Differential Revision: https://phab.enlightenment.org/D2294
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
While creating a Ecore_con_url object, the url is given in this format "ftp://ftp.example.com". While uploading a file, this function was prefixing "ftp://" to this url which resulted in DNS failure, and upload fail. So corrected the issue.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2221
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
1. Have refactored code in ecore_con_local.c
2. Changed env variable from "TMP" to "TMPDIR".
3. Added check for negetive port number when type is ECORE_CON_LOCAL_USER.
4. Added check to check TMPDIR before assuming /tmp as temp directory.
5. Updated documentation in Ecore_Con.h explaining about local socket and port number.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2194
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
The socket can be created even with negative port number, but in that case the port
is ignored so that you can connect to non Ecore_Con based IPC. This patch remove
that test to make the client and server match.
@fix
Bug: While creating ECORE_CON_LOCAL_SYSTEM server and client pair, when the socket
name was "test_socket" and port number "-8" (Any negative number). Then while creating
listening socket, the code would go to line no 291 and socket is created in tmp by
".ecore_servicetest_socket|-8". When the same is passed to bind then the code would
go to line 118 and the socket it would try to bind would be ".ecore_servicetest_socket" !!
So the bind would fail.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2186
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
If the socket is local, then there is no need to through error if the port is less than 0 (i.e., negetive). The behavior is same in _ecore_con_connector_eo_base_finalize funtion. So applied the same here. There is code in ecore_con_local.c to handle if port is less than zero for local sockets.
In _ecore_con_connector_eo_base_finalize function, I've added a space just so that it shows difference in phabricator and would be easy for you to review.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2089
Summary:
ecore_con_local doesn't currently require any initialization, but it might need
that on some platform and not having the init make the source code non obvious.
This is just a patch to improve future maintenability.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2098
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: Ordered events into server side events, client side events and update the text.
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1976
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: When ecore_init failed or when failed to initialize ecore_con_log_domain, then evil_shutdown was not called. So cleaned up code and added the fix.
@fix
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1921
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary: _init_con_ssl_init_count should not go below zero. This can occur if a developer mistakenly calls ssl shutdown before calling ssl init. So adding the check to prevent this.
Reviewers: cedric
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1925
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
curl is dumb. it needs to poll its own fd for data, it gets confused with its own timeouts, and sometimes it forgets that it's supposed to be doing anything.
this fixes:
* connection timeout processing
* connection data processing order
also curl_multi_timeout calls are now done from a single function to handle all of this stupidness in one place
maybe backport after more testing...
Summary: It is removed because it was a deadcode case zero is never reached and executed.
Reviewers: singh.amitesh, seoz, raster
Reviewed By: raster
Subscribers: raster, cedric
Differential Revision: https://phab.enlightenment.org/D1432
We'll be removing function pointer support from Eolian, instead
replacing any callback we can with events (arbitrary callbacks are
very difficult to support in bindings). As we'll be handling all
callbacks at once, we'll do this one at that point as well.
silence this annoying warning we've had for a while:
In file included from /usr/include/stdint.h:25:0,
from
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include/stdint.h:9,
from lib/ecore_con/dns.c:45:
/usr/include/features.h:148:3: warning: #warning
"_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
[-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
_DEFAULT_SOURCE"
Summary:
_ecore_con_init_count should not go below zero. I've added a test case to test this and also the code to fix this.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1603
Some parts of the API documentation where not compiled at all by doxygen
because of missing '@{' and '@}' tags. This commit adds the missing tags
in Ecore_Getopt.h, Ecore_Con_Eet.h, and Ecore_IMF.h headers.
If connect() returns 0, we must send the ECORE_CON_EVENT_SERVER_ADD event
because it wont be given by select(). select() will ONLY notice it if connect
returns -1 with errno set to EINPROGRESS.
This bug is reproductible with 100% chance using ecore_con_telnet_client example
from https://github.com/gfriloux/examples if you connect to 127.0.0.1 instead of
of an external network ip, under FreeBSD (and likely any BSD).
Seems very rare to trigger it under GNU/Linux as it seems that connect()
doesnt want to return 0 when having non blocking sockets (or is too slow),
but it seems i was having this bug too on production servers, without being
ever able to reproduce it.
Summary:
If the function jumpes to the error, the scope data is freed, this is
wrong, just the object should be destroyed, so not free, just eo_unref
the object. Cause the object is just added above the object ref count
should get 0 and obj will get removed
Test Plan: Use the ecore_con_server_client_limit_set function and set the max count to 1, at the connect of a second client the server will fail at this free.
Reviewers: tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1459
Summary: C++ takes the second typedef as redefinition and yields errors.
Reviewers: zmike, tasn
Reviewed By: tasn
Subscribers: larry, cedric, felipealmeida
Differential Revision: https://phab.enlightenment.org/D1455
From now on, there are 5 builtin complex types, particularly accessor, array,
iterator, hash and list. All other types are simple - they can't have a complex
part. Also, the <> now binds to the type itself, not the pointer. More builtin
complex types will be added as needed.
Summary:
The pass of the wrong pointer caused a wrong scope get call cause the the
passed pointer was not a valid eo pointer.
Test Plan: Run enlightenment entrance, it wont crash anymore
Reviewers: tasn
Subscribers: cedric, Sachiel
Differential Revision: https://phab.enlightenment.org/D1352
this fixes potential leak due to
ff652084e0 fixing a valgrind access
issue. make sure the server is in the list before handling error
conditions in case a callback sets delete_me (should never though).
this should fix T1508 - my testing seems to indicate so. test suite
succeeds, some manual tests of mine work. so is ay this is a good fix
that could fix critical segvs in apps using ecore-con - eg like
weather module in e
this fixes T1341. also it removes the pointless return value from
these two functions as the return is never used. also the ifdef in
ecore_main.c seemed wrong as it wasd using fcntl not execvp but the
ifdef was for execvp. this just never was discovered, so it's slid
under the hood for a long time.
num was changed to size_t which makes it unsigned while count is a normal
(signed) int. Comparing them does not always work as expected but in this
case we already checked if count is < 0 before and would have returned if
that would be true. Thus we can safely cast count to unsigned here as it
will be greater 0 anyway.
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
ERR<7807>: lib/eina/eina_binbuf_template_c.x:95 eina_binbuf_append_length() *** Eina Magic Check Failed !!!
This fix a problem where eina_binbuf was used without
calling eina_binbuf_new when ECORE_CON_REMOTE_UDP is used.
Being annoyed by different types of eina critical macros - CRI, CRIT,
CRITICAL -, I concluded to unify them to one. Discussed on IRC and
finally, CRI was chosen to meet the consistency with other macros -
ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
inexistant DNS, or having a DNS resolution error, there isnt any event
generated for the application to know.
This is not a complete fix has you need to fix a timeout value for it to
happen, but still, it makes it possible to work around it.
More work is needed on this.
this makes curl support a pure runtime-only thing. libcurl is loaded by
eina_module (dlopen/dlsym) when curl is actually first needed (when a
url connection/object is created). this means that ecore-con has no
link or compile dependencies on curl, only runtime, AND this saves
memory (due to curl inits using apparently a chunk of private pages).
so this saves memory and moves the dependency to runtime (though still
consider libcurl a dependency of efl - but like a binary executed,
it's at runtime).
NB: dns_so_submit calls dns_so_reset twice (once at start, once at end
on error). As so_reset will free so->answer the first time through,
add validity check of so->answer for the second iteration.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
ecore_con_event_server_add() is never called (at least not in the
standard TCP connection case, so initialize svr->start_time in
ecore_con_server_add(). This shouldn't regress any other behaviour as
this is done at the very beginning and any later change to start_time
will still happen.
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Be careful, systemd socket activation require you to always order
server socket creation in the same order as defined in the unit file.
This means ecore_con_server_add should always been in the same order
for those of them using systemd socket activation.
* rename USE_GNUTLS and USE_OPENSSL to HAVE_GNUTLS and HAVE_OPENSSL
in ecore_con, to match other modules such as Eet.
* define requirements_pc_crypto, requirements_pc_deps_crypto and
requirements_libs_crypto so modules can use that.
* move to a common check section.
SVN revision: 80288