#include "gnunet_getopt_lib.h"
#include "gnunet_os_lib.h"
#include "gnunet_protocols.h"
+#include "gnunet_resolver_service.h"
#include "gnunet_server_lib.h"
#include "gnunet_service_lib.h"
next = pos->ai_next;
if ( (disablev6) && (pos->ai_family == AF_INET6))
continue;
+ if ( (pos->ai_protocol != IPPROTO_TCP) && (pos->ai_protocol != 0) )
+ continue; /* not TCP */
+ if ( (pos->ai_socktype != SOCK_STREAM) && (pos->ai_socktype != 0) )
+ continue; /* huh? */
#if DEBUG_SERVICE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Service `%s' will bind to `%s'\n",
}
GNUNET_free (hostname);
freeaddrinfo (res);
+ resi = i;
}
else
{
struct GNUNET_SERVICE_Context *sctx = cls;
unsigned int i;
+ GNUNET_RESOLVER_connect (sctx->cfg);
if (sctx->lsocks != NULL)
sctx->server = GNUNET_SERVER_create_with_sockets (&check_access,
sctx,
char *logfile;
int do_daemonize;
unsigned int i;
+ unsigned long long skew_offset;
+ unsigned long long skew_variance;
+ long long clock_offset;
struct GNUNET_SERVICE_Context sctx;
struct GNUNET_CONFIGURATION_Handle *cfg;
struct GNUNET_GETOPT_CommandLineOption service_options[] = {
"Service `%s' runs with configuration from `%s'\n",
serviceName, cfg_fn);
#endif
+ if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number(sctx.cfg, "testing", "skew_offset", &skew_offset) &&
+ (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number(sctx.cfg, "testing", "skew_variance", &skew_variance)))
+ {
+ clock_offset = skew_offset - skew_variance;
+ GNUNET_TIME_set_offset(clock_offset);
+#if DEBUG_SERVICE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skewing clock by %dll\n", clock_offset);
+#endif
+ }
/* actually run service */
GNUNET_SCHEDULER_run (&service_task, &sctx);