Commit Graph

21 Commits

Author SHA1 Message Date
Andreas Grueninger
01703fdf62 Fix: Unlink files before qb_ipcc_us_sock_close
Changed the #if clauses to all non linux OSe.
2015-01-13 19:01:57 +01:00
Andreas Grueninger
ea4d931563 Fix: Unlink files bound to unix domain sockets
In qb_ipcs_us_connect 4 files are created and bound.
I dont' know how this works for QB_LINUX or QB_CYGWIN.
But for the other OS the files are created and must be unlinked.
I use the same logic to construct the file names and unlink the files.

qb_ipcc_us_connect calls this
...
  res = qb_ipc_dgram_sock_connect(r->response, "response", "request",
          r->max_msg_size, &c->request.u.us.sock);
and qb_ipc_dgram_sock_connect calls
..
set_sock_addr

and in set_sock_addr the files are created if not Linux or Cygwin.
...
#if defined(QB_LINUX) || defined(QB_CYGWIN)
  snprintf(address->sun_path + 1, UNIX_PATH_MAX - 1, "%s", socket_name);
#else
  snprintf(address->sun_path, sizeof(address->sun_path), "%s/%s", SOCKETDIR,
     socket_name);
#endif
...
2014-12-22 22:05:36 +01:00
Super-User
22d0f94cd2 High: ipc_socket: Signalhandler must be resetted to Default, use only cleanup_sigpipe to return from qb_ipc_dgram_sock_setup.
Some OS like Solaris/Illumos return with ECONNRESET or EPIPE in the case of a disconnecting peer.
Change the return code to ENOTCONN and continue.
2014-08-14 14:53:59 -04:00
David Vossel
08356b84fa Fix: ipcc: Properly timeout during recv when timeout value is provided 2014-03-12 14:05:13 -04:00
David Vossel
334762c90e Low: ipc_socket: further optimize max msg size calculations for fbsd portability tests 2014-02-11 11:19:57 -06:00
David Vossel
9e6cacd4e6 Low: ipc_socket: Allow socket max msg size to be calculated more accurately 2014-02-10 16:55:36 -06:00
David Vossel
58c0c90979 Low: ipc: Remove ipc connection reference given to dispatch functions
We don't need to give the dispatch_add callback a reference
since the dispatch_del callback must occur before the
connection is destroyed. This extra reference counting
causes unnecessary complexity.
2014-01-15 11:44:44 -06:00
David Vossel
b327dbec73 Low: ipc_socket: Fixes fd leak in socket ipc client disconnection 2013-09-16 18:38:20 -05:00
Michael van der Westhuizen
57e630f63f Use sizeof to get the correct size of the sockaddr_un sun_path member in a portable way. Fixes corosync on Mac OS X. 2013-09-03 08:44:15 +02:00
David Vossel
2a0a0790e9 Low: ipc_socket: Output send event failure as debug instead of error 2013-07-23 22:37:08 -05:00
David Vossel
54ef796126 High: ipc_socket.c: Detect EOF connection on connection STREAM socket 2013-07-23 20:01:41 -05:00
David Vossel
e6c99f6280 Merge pull request #81 from davidvossel/dgram_max_msg
Added ability to estimate kernel's actual max dgram buffer size in a portable way.
2013-07-22 14:04:52 -07:00
David Vossel
a881c14086 Low: ipc_socket.c: Handle the unlikely event of an EAGAIN or EINTR during dgram max size detection 2013-07-22 20:29:24 -05:00
David Vossel
c04e887cf1 fixes double close 2013-07-22 16:58:46 -05:00
David Vossel
f14be872a1 Fixes double close 2013-07-22 16:57:47 -05:00
David Vossel
65d044be18 High: ipcc: Add abilty to verify dgram kernel buffer size meets max msg value 2013-07-19 18:51:59 -05:00
David Vossel
6a1186863f Low: ipc_socket: In fbsd send() returns ENOBUFS when dgram queue is full, this should be treated similar to EAGAIN 2013-07-12 19:04:47 -05:00
David Vossel
95e48fdb76 Fix: ipcs: Properly disconnect client connection on POLLNVAL or any other error causing connection removal from mainloop.
qb_ipcs_dispatch_connection_request is a callback function registered with
mainloop, or whatever other looping thread implementation is in use.  When
this callback is registered, a reference of the connection object is given
to the mainloop thread.  If this callback ever returns something none zero
the callback (and corresponding fd) is unregistered from the loop automatically,
so we must decrement the reference in this instance.

Since unregistering this callback from mainloop guarantees a disconnect
simply because requests on the fd are no longer processed, it is best
that we completely disconnect the connection (which will handle the unref)
when this callback returns an error... Otherwise since the fd is unregistered
from the mainloop thread, it may not be possible to detect a disconnect
in the future.
2013-07-01 18:46:31 -05:00
Angus Salkeld
75a550d8d3 IPC: fix call to QB_SUN_LEN
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-03-12 20:45:47 +11:00
Angus Salkeld
31d9f0900d Use dgram sockets for message oriented communications
This is to prevent partial sends and gettting stuck in
retry loops.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-18 20:51:33 +11:00
Angus Salkeld
9d2eca251b IPC: seperate ipc_us.c into 2 files
Seperate into a setup file and a socket backend file, it was getting messy
and confusing. Also preparing for using DGRAM sockets.

This should not result in any logical changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2013-02-06 11:21:05 +11:00