setup_service (struct GNUNET_SERVICE_Context *sctx)
{
unsigned long long maxbuf;
- unsigned long long idleout;
+ struct GNUNET_TIME_Relative idleout;
char *hostname;
unsigned long long port;
int disablev6;
sctx->serviceName, "TIMEOUT"))
{
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_number (sctx->cfg,
- sctx->serviceName,
- "TIMEOUT", &idleout))
+ GNUNET_CONFIGURATION_get_value_time (sctx->cfg,
+ sctx->serviceName,
+ "TIMEOUT", &idleout))
return GNUNET_SYSERR;
- sctx->timeout.value = idleout;
+ sctx->timeout = idleout;
}
else
sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
if (pos == NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to find IPv4 address for `%s'.\n"), hostname);
+ _("Failed to find %saddress for `%s'.\n"),
+ disablev6 ? "IPv4 " : "", hostname);
freeaddrinfo (res);
GNUNET_free (hostname);
return GNUNET_SYSERR;
GNUNET_assert (pos->ai_addrlen == sizeof (struct sockaddr_in6));
sctx->addrlen = pos->ai_addrlen;
sctx->addr = GNUNET_malloc (sctx->addrlen);
+ memcpy (sctx->addr, res->ai_addr, sctx->addrlen);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_
("Configured to bind to %s address; %s connections to this service will fail!\n"),
GNUNET_break (0 == CLOSE (0));
GNUNET_break (0 == CLOSE (1));
GNUNET_break (0 == CLOSE (filedes[0]));
- nullfd = GNUNET_DISK_file_open ("/dev/null", O_RDWR | O_APPEND);
+ nullfd = OPEN ("/dev/null", O_RDWR | O_APPEND);
if (nullfd < 0)
return GNUNET_SYSERR;
/* set stdin/stdout to /dev/null */