forked from enlightenment/efl
parent
8c946dff90
commit
5d52fce3f6
|
@ -708,7 +708,7 @@ ecore_con_client_send(Ecore_Con_Client *cl, const void *data, int size)
|
||||||
ecore_main_fd_handler_active_set(
|
ecore_main_fd_handler_active_set(
|
||||||
cl->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
|
cl->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
|
||||||
|
|
||||||
if(cl->server && cl->server->type == ECORE_CON_REMOTE_UDP)
|
if(cl->server && ((cl->server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP))
|
||||||
sendto(cl->server->fd, data, size, 0, (struct sockaddr *)cl->client_addr,
|
sendto(cl->server->fd, data, size, 0, (struct sockaddr *)cl->client_addr,
|
||||||
cl->client_addr_len);
|
cl->client_addr_len);
|
||||||
else if (cl->buf)
|
else if (cl->buf)
|
||||||
|
@ -1116,7 +1116,7 @@ _ecore_con_cb_tcp_listen(void *data, Ecore_Con_Info *net_info)
|
||||||
sizeof(struct linger)) < 0)
|
sizeof(struct linger)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (svr->type == ECORE_CON_REMOTE_NODELAY)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
|
||||||
{
|
{
|
||||||
int flag = 1;
|
int flag = 1;
|
||||||
|
|
||||||
|
@ -1248,7 +1248,7 @@ _ecore_con_cb_tcp_connect(void *data, Ecore_Con_Info *net_info)
|
||||||
sizeof(curstate)) < 0)
|
sizeof(curstate)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (svr->type == ECORE_CON_REMOTE_NODELAY)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_NODELAY)
|
||||||
{
|
{
|
||||||
int flag = 1;
|
int flag = 1;
|
||||||
|
|
||||||
|
@ -1319,7 +1319,7 @@ _ecore_con_cb_udp_connect(void *data, Ecore_Con_Info *net_info)
|
||||||
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
|
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if(svr->type == ECORE_CON_REMOTE_BROADCAST)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_BROADCAST)
|
||||||
{
|
{
|
||||||
if (setsockopt(svr->fd, SOL_SOCKET, SO_BROADCAST,
|
if (setsockopt(svr->fd, SOL_SOCKET, SO_BROADCAST,
|
||||||
(const void *)&broadcast,
|
(const void *)&broadcast,
|
||||||
|
|
|
@ -77,7 +77,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
||||||
const char *homedir;
|
const char *homedir;
|
||||||
int socket_unix_len;
|
int socket_unix_len;
|
||||||
|
|
||||||
if (svr->type == ECORE_CON_LOCAL_USER)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||||
{
|
{
|
||||||
homedir = getenv("HOME");
|
homedir = getenv("HOME");
|
||||||
if (!homedir)
|
if (!homedir)
|
||||||
|
@ -89,7 +89,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
||||||
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
|
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
|
||||||
svr->port);
|
svr->port);
|
||||||
}
|
}
|
||||||
else if (svr->type == ECORE_CON_LOCAL_SYSTEM)
|
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
|
||||||
{
|
{
|
||||||
if (svr->port < 0)
|
if (svr->port < 0)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
||||||
svr->port);
|
svr->port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
|
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT)
|
||||||
strncpy(buf, svr->name,
|
strncpy(buf, svr->name,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ ecore_con_local_connect(Ecore_Con_Server *svr,
|
||||||
|
|
||||||
socket_unix.sun_family = AF_UNIX;
|
socket_unix.sun_family = AF_UNIX;
|
||||||
|
|
||||||
if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ABSTRACT_SOCKETS
|
#ifdef HAVE_ABSTRACT_SOCKETS
|
||||||
/* copy name insto sun_path, prefixed by null to indicate abstract namespace */
|
/* copy name insto sun_path, prefixed by null to indicate abstract namespace */
|
||||||
|
@ -206,7 +206,7 @@ ecore_con_local_listen(
|
||||||
|
|
||||||
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
|
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
|
||||||
|
|
||||||
if (svr->type == ECORE_CON_LOCAL_USER)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
|
||||||
{
|
{
|
||||||
homedir = getenv("HOME");
|
homedir = getenv("HOME");
|
||||||
if (!homedir)
|
if (!homedir)
|
||||||
|
@ -232,7 +232,7 @@ ecore_con_local_listen(
|
||||||
svr->port);
|
svr->port);
|
||||||
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
|
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
|
||||||
}
|
}
|
||||||
else if (svr->type == ECORE_CON_LOCAL_SYSTEM)
|
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
|
||||||
{
|
{
|
||||||
mask = 0;
|
mask = 0;
|
||||||
if (svr->name[0] == '/')
|
if (svr->name[0] == '/')
|
||||||
|
@ -256,7 +256,7 @@ ecore_con_local_listen(
|
||||||
svr->name,
|
svr->name,
|
||||||
svr->port);
|
svr->port);
|
||||||
}
|
}
|
||||||
else if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
|
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT)
|
||||||
strncpy(buf, svr->name,
|
strncpy(buf, svr->name,
|
||||||
sizeof(buf));
|
sizeof(buf));
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ start:
|
||||||
goto error_umask;
|
goto error_umask;
|
||||||
|
|
||||||
socket_unix.sun_family = AF_UNIX;
|
socket_unix.sun_family = AF_UNIX;
|
||||||
if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
|
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_ABSTRACT)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ABSTRACT_SOCKETS
|
#ifdef HAVE_ABSTRACT_SOCKETS
|
||||||
/* . is a placeholder */
|
/* . is a placeholder */
|
||||||
|
@ -302,8 +302,8 @@ start:
|
||||||
|
|
||||||
if (bind(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
|
if (bind(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
|
||||||
{
|
{
|
||||||
if (((svr->type == ECORE_CON_LOCAL_USER) ||
|
if ((((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER) ||
|
||||||
(svr->type == ECORE_CON_LOCAL_SYSTEM)) &&
|
((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)) &&
|
||||||
(connect(svr->fd, (struct sockaddr *)&socket_unix,
|
(connect(svr->fd, (struct sockaddr *)&socket_unix,
|
||||||
socket_unix_len) < 0) &&
|
socket_unix_len) < 0) &&
|
||||||
(unlink(buf) >= 0))
|
(unlink(buf) >= 0))
|
||||||
|
|
Loading…
Reference in New Issue