When re-connecting to the remote redis server
try to re-resolve if the redist hostname
was an FQDN and not IP address.
Change-Id: Ie80e1d1a1ea76811c54123201ad4fe8cb64fc748
Use a small stack buffer instead of obtaining a thread-local one when
writing directly to a GString.
Change-Id: Ia15b8eee365ddb14e35eddc72358c4793ccba7d9
For typed hash tables, enforce the correct type in the arguments to the
hashing and equality functions.
Adapt existing affected callback functions and change their arguments
from void* to the respective types.
Add reverse casts to GHashFunc and GEqualFunc in instances where these
functions are used in non-typed hash tables (that should be converted at
a later point).
Add convenience macro to create typed wrapper functions for hash tables
that use "direct" hashing (i.e. the pointer value).
Add wrappers for existing GLib functions that have generic arguments so
that they can be used in typed hash tables.
Change-Id: I43bb32969208f4aae49584d95c0df8353df6e2a0
To support asynchronous pollers which may hold references on underlying
sockets, let the poller close the socket after it has released its
references. This prevents cases of file descriptor re-use while an
underlying socket is still open.
Add reset_socket() to be used in place of close_socket() which does the
same thing except the actual closing of the socket.
Add poller_del_item_callback() for cases where more action than just
closing the file descriptor is needed.
Change-Id: Iefda1487ecb89263729120ecb964436dd79b2a0e
Older glibc uses a strange (and seemingly broken) approach to verifying
the cmsg structures by inspecting the *next* cmsg header and using its
length to see if there is enough space in the buffer. Since we're
constructing the cmsg list, at this point there is no next cmsg yet,
therefore causing spurious failures of CMSG_NXTHDR.
Work around this by initialising the entire buffer first.
See 9c443ac455closes#1720
Change-Id: I00ce9bc5686ab0c1612aff51f1b3e75d8cbd8a69
UDP packets sent in response to a UDP request should have the same
source address as the request's destination address.
This can be achieved with sockets bound to a specific address, but in
the case of ANY-bound sockets, we can use the PKTINFO mechanism to do
this.
Extend control_ng_process() to accept an extra socket address
corresponding to the local address to use. Extend the signature of the
callback function (to do the actual sending) accordingly.
Extend socket_sendiov() to be able to set the PKTINFO cmsg when sending
a packet.
Add socket_sendto_from() as a convenience wrapper.
Extend control_udp_incoming() to pass the address from
udp_buf->local_addr back to socket_sendiov().
Change-Id: Idd019fdcfd796098e7807427e6686d4b05de35d1
Similar to recvfrom_ts, this return the local (destination) address of
the received packet, extracted from the PKTINFO struct.
Change-Id: Icfed12eb7d9bf6c9d707318e85363fcff8d9aca6