#include "sd-daemon.h"
+#include "af-list.h"
#include "alloc-util.h"
#include "def.h"
#include "errno-util.h"
assert(fd >= 0);
assert(source);
- if (!GREEDY_REALLOC0(s->sources, s->sources_size, fd + 1))
+ if (!GREEDY_REALLOC0(s->sources, fd + 1))
return log_oom();
r = journal_remote_get_writer(s, name, &writer);
RemoteSource *source;
assert(s);
- assert(fd >= 0 && fd < (ssize_t) s->sources_size);
+ assert(fd >= 0 && fd < (ssize_t) MALLOC_ELEMENTSOF(s->sources));
source = s->sources[fd];
if (source) {
hashmap_free_with_destructor(s->daemons, MHDDaemonWrapper_free);
#endif
- assert(s->sources_size == 0 || s->sources);
- for (i = 0; i < s->sources_size; i++)
+ for (i = 0; i < MALLOC_ELEMENTSOF(s->sources); i++)
remove_source(s, i);
free(s->sources);
* 0 if data is currently exhausted, negative on error.
*/
- assert(fd >= 0 && fd < (ssize_t) s->sources_size);
+ assert(fd >= 0 && fd < (ssize_t) MALLOC_ELEMENTSOF(s->sources));
source = s->sources[fd];
assert(source->importer.fd == fd);
log_debug("Accepted %s %s connection from %s",
type,
- socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
+ af_to_ipv4_ipv6(socket_address_family(addr)),
a);
*hostname = b;