Commit Graph

66 Commits

Author SHA1 Message Date
Avi Levin fa8f786d44 back 2015-03-16 15:55:32 +02:00
Srivardhan Hebbar 9b1cdff941 ecore_con: Not returning error if port is less than zero for local sockets.
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
2015-03-06 20:19:21 +01:00
Srivardhan Hebbar 6721800e7b ecore_con: calling ecore_con_local_init/shutdown from ecore_con_init/shutdown.
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>
2015-03-06 20:19:21 +01:00
Tom Hacohen 648ad2591c Fix code to conform to recent Eo changes. 2015-02-23 17:16:02 +00:00
Guillaume Friloux 797c921f10 ecore_con: EAGAIN is replaced by WSAEWOULDBLOCK on Windows. 2015-02-11 17:03:39 +01:00
Guillaume Friloux d0dabf8613 ecore: improve network events handling on Windows. 2015-02-11 17:03:39 +01:00
Guillaume Friloux 211d54dc8e ecore_con: make disconnects work on Windows. 2015-02-11 17:03:38 +01:00
Guillaume Friloux 388f8fbcaa ecore_con: fix use of FormatMessage for error reporting on windows.
@fix
2015-02-11 17:03:38 +01:00
Guillaume Friloux d6f08ba032 ecore_con: silent warning with send() usage. 2015-02-11 17:03:38 +01:00
Guillaume Friloux c77c0107a2 ecore_con: use send() instead of write() for portability. 2015-02-11 17:03:37 +01:00
Guillaume Friloux 8873bfeb2b ecore_con: use recv() instead of read for better portability. 2015-02-11 17:03:37 +01:00
Guillaume Friloux e57c1d396e ecore_con: fix _ecore_con_server_flush on Windows.
@fix
2015-02-11 17:03:37 +01:00
Nicolas Aguirre 7d4f95171c ecore_con: Fix checks from socket() and accept() under windows.
import from Guillaume Friloux ecore's fork : ab2d406a37
2015-02-11 17:03:37 +01:00
Guillaume Friloux 0e8e4b2728 ecore_con: use ioctlsocket() when building for windows.
fcntl() doesnt work under windows.

References :
- http://msdn.microsoft.com/en-us/library/windows/desktop/ms738573%28v=vs.85%29.aspx
- http://msdn.microsoft.com/en-us/library/windows/desktop/ms740096%28v=vs.85%29.aspx

imported from Guillaume Friloux ecore fork : 66da77d491
2015-02-11 17:03:37 +01:00
Srivardhan Hebbar a2d40968df Ecore_con: fix initialisation clean up and avoid memory leak.
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>
2015-02-05 11:27:00 +01:00
Cedric BAIL aa69cd89a6 ecore_con: the timer callback is waiting for the Eo object not its private data.
This @fix T1962 .
2014-12-30 11:19:38 +01:00
Srivardhan Hebbar be5b00cfd1 ecore_con: Added test case to check if _ecore_con_init_count goes below zero.
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
2014-10-29 08:24:53 -04:00
Guillaume Friloux 101c13d582 ecore_con: Fix connect() handling
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.
2014-10-08 15:34:48 -04:00
Cedric BAIL 93b865767f ecore_con: check that we have an actual server data before using it. 2014-10-07 16:28:52 +02:00
Marcel Hollerbach f5e24c3bcf ecore_con: Fix error goto, scope data should not be freed
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
2014-09-19 02:16:37 +01:00
Stefan Schmidt fdc8e455e4 ecore_con: Make sure host_server is not NUL before dereferencing
This was intended to get fixed in f53683f76a

CID 1232731
2014-09-04 10:57:19 +02:00
Tom Hacohen 0c9a1d8a99 Ecore con: Add Connector class (the connecting variant of server).
This change also consists of cleaning up the server class and adding a
constructor and a finalizer to it.
2014-09-01 12:35:22 +01:00
Tom Hacohen 056c54ebc9 Ecore con server: Fix destructor to call super correctly. 2014-09-01 11:12:17 +01:00
Mike Blumenkrantz 7b0db79c2d revert all recent ecore-con related eo changes. completely broken.
please test things before committing.

reverts all changes since and including f6156c9a62
2014-08-30 08:12:54 -04:00
Tom Hacohen 607901fb0e Ecore con server: Fix destructor to call super correctly. 2014-08-29 10:26:23 +01:00
Tom Hacohen 61cd629a59 Ecore con: Limit some functions to only be called from inside eo_add(). 2014-08-29 10:26:23 +01:00
Tom Hacohen bba7ac87f1 Ecore con: Add Connector class (the connecting variant of server).
This change also consists of cleaning up the server class and adding a
constructor and a finalizer to it.
2014-08-28 14:31:17 +01:00
Carsten Haitzler f53683f76a ecore-con - fix explicit null dereference
fix CID 1232731
2014-08-27 17:16:17 +09:00
Carsten Haitzler f5b975174f ecore-con - use return valude of sendto.
fixes CID 1232726
2014-08-27 14:49:47 +09:00
Tom Hacohen 540581f629 Ecore con: Hopefully fix for windows. 2014-08-26 11:11:20 +01:00
Tom Hacohen 974e3afabc Ecore con: Rename to Ecore.Con.Base for the C++ bindings. 2014-08-22 17:37:56 +01:00
Tom Hacohen 9a8a416325 Ecore con server: Add support for some eo events. 2014-08-22 17:37:56 +01:00
Tom Hacohen d72f809fb8 Ecore con server: Migrate to eo. 2014-08-22 17:37:56 +01:00
Tom Hacohen 718a942bde Ecore con client: Add support for some eo events. 2014-08-22 17:11:54 +01:00
Tom Hacohen d9b5f192d4 Ecore con client: Migrate to eo. 2014-08-22 17:11:54 +01:00
Tom Hacohen 218e76fd30 Ecore con: Start migration to eo. 2014-08-22 17:00:49 +01:00
Carsten Haitzler c0ca1bcf44 ecore-con - fix possible leak due to other fix
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).
2014-08-13 08:44:44 +09:00
Carsten Haitzler ff652084e0 fix valgrind report on ecore con server connect failure
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
2014-08-11 20:49:42 +09:00
Stefan Schmidt 9f7c9f9536 ecore_con: Force unsigned to unsigned comparison
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.
2014-04-11 11:50:47 +02:00
Stefan Schmidt b53a68d4c6 ecore_con: Remove superfluous >= 0 check for unsigned
Since num was changed from (signed) int to (unsigned)  size_t in
16d7b981eb this check no longer
makes sense as it will always be true.
2014-04-11 11:26:18 +02:00
Carsten Haitzler 16d7b981eb ecore-con - deal with internal buffer growing over 2g in size
@fix this fixes a corner case where you may buffer 2g or more of data
in ecore-con buffers. this leads to a stall. @fix
2014-04-04 19:36:50 +09:00
Nicolas Aguirre 503e7a5b03 ecore_con - Fix binary buffer when using ECORE_CON_REMOTE_UDP.
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.
2014-01-03 18:57:56 +01:00
discomfitor 0808259eff Revert "workaround for a weird ecore-con crash"
This reverts commit c751a220d6.
2013-12-20 22:04:58 -05:00
discomfitor c751a220d6 workaround for a weird ecore-con crash
kuri ping in case I don't get to this soon it needs to be fixed somewhere else
2013-12-20 21:36:58 -05:00
discomfitor 41fe698fc2 reformat ecore_con so I can read it... 2013-12-20 00:08:43 -05:00
Chris Michael 164269a2da Malloc cannot accept a negative number so check 'num' parameter before
calling malloc.

Fixes Coverity CID1039352

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-18 11:50:42 +00:00
Guillaume Friloux 838c3bed85 Fixes a bug where when you try to connect to a server using an
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.
2013-11-06 14:32:11 +01:00
Chris Michael d9f8e6b525 Do not call _ecore_con_client_flush with a NULL client.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 12:39:19 +01:00
Guillaume Friloux 6aab5a9690 This patch is a port of commit 4b885b9b24de9e188c861422d7d2738b49359d22.
It fixes ecore_con_server_timeout_set().
2013-07-17 16:20:45 +02:00
Daniel Willmann 16cbbb202f ecore_con: Server start time was not initialized correctly
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>
2013-05-24 16:18:02 +01:00