server_load_file (const char *file)
{
struct GNUNET_DISK_FileHandle *gn_file;
- struct stat fstat;
+ uint64_t fsize;
char *text = NULL;
- if (0 != STAT (file, &fstat))
+ if (GNUNET_OK != GNUNET_DISK_file_size (file,
+ &fsize, GNUNET_NO, GNUNET_YES))
return NULL;
- text = GNUNET_malloc (fstat.st_size + 1);
+ text = GNUNET_malloc (fsize + 1);
gn_file =
GNUNET_DISK_file_open (file, GNUNET_DISK_OPEN_READ,
GNUNET_DISK_PERM_USER_READ);
GNUNET_free (text);
return NULL;
}
- if (GNUNET_SYSERR == GNUNET_DISK_file_read (gn_file, text, fstat.st_size))
+ if (GNUNET_SYSERR == GNUNET_DISK_file_read (gn_file, text, fsize))
{
GNUNET_free (text);
GNUNET_DISK_file_close (gn_file);
return NULL;
}
- text[fstat.st_size] = '\0';
+ text[fsize] = '\0';
GNUNET_DISK_file_close (gn_file);
return text;
}
#endif
errno = 0;
cert_creation =
- GNUNET_OS_start_process (NULL, NULL,
+ GNUNET_OS_start_process (GNUNET_NO, NULL, NULL,
"gnunet-transport-certificate-creation",
"gnunet-transport-certificate-creation",
key_file, cert_file, NULL);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
-
+#if 0
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Running IPv4 server\n");
-
+#endif
GNUNET_assert (MHD_YES == MHD_run (plugin->server_v4));
if (plugin->server_v4 != NULL)
plugin->server_v4_task =
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
-
+#if 0
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Running IPv6 server\n");
-
+#endif
GNUNET_assert (MHD_YES == MHD_run (plugin->server_v6));
if (plugin->server_v6 != NULL)
plugin->server_v6_task =
GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK;
}
-#if VERBOSE_SERVER
+#if 0
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Scheduling IPv4 server task in %llu ms\n", tv);
#endif
GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
}
-#if VERBOSE_SERVER
+#if 0
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Scheduling IPv6 server task in %llu ms\n", tv);
#endif