switch (result)
{
case GNUNET_ARM_PROCESS_UNKNOWN:
- fprintf (stderr, _("Service `%s' is unknown to ARM.\n"), service);
+ FPRINTF (stderr, _("Service `%s' is unknown to ARM.\n"), service);
ret = 1;
break;
case GNUNET_ARM_PROCESS_DOWN:
if (quiet != GNUNET_YES)
- fprintf (stdout, _("Service `%s' has been stopped.\n"), service);
+ FPRINTF (stdout, _("Service `%s' has been stopped.\n"), service);
break;
case GNUNET_ARM_PROCESS_ALREADY_RUNNING:
- fprintf (stderr, _("Service `%s' was already running.\n"), service);
+ FPRINTF (stderr, _("Service `%s' was already running.\n"), service);
ret = 1;
break;
case GNUNET_ARM_PROCESS_STARTING:
if (quiet != GNUNET_YES)
- fprintf (stdout, _("Service `%s' has been started.\n"), service);
+ FPRINTF (stdout, _("Service `%s' has been started.\n"), service);
break;
case GNUNET_ARM_PROCESS_ALREADY_STOPPING:
- fprintf (stderr, _("Service `%s' was already being stopped.\n"), service);
+ FPRINTF (stderr, _("Service `%s' was already being stopped.\n"), service);
ret = 1;
break;
case GNUNET_ARM_PROCESS_ALREADY_DOWN:
- fprintf (stderr, _("Service `%s' was already not running.\n"), service);
+ FPRINTF (stderr, _("Service `%s' was already not running.\n"), service);
ret = 1;
break;
case GNUNET_ARM_PROCESS_SHUTDOWN:
- fprintf (stderr, _("Request ignored as ARM is shutting down.\n"));
+ FPRINTF (stderr, "%s", _("Request ignored as ARM is shutting down.\n"));
ret = 1;
break;
case GNUNET_ARM_PROCESS_COMMUNICATION_ERROR:
- fprintf (stderr, _("Error communicating with ARM service.\n"));
+ FPRINTF (stderr, "%s", _("Error communicating with ARM service.\n"));
ret = 1;
break;
case GNUNET_ARM_PROCESS_COMMUNICATION_TIMEOUT:
- fprintf (stderr, _("Timeout communicating with ARM service.\n"));
+ FPRINTF (stderr, "%s", _("Timeout communicating with ARM service.\n"));
ret = 1;
break;
case GNUNET_ARM_PROCESS_FAILURE:
- fprintf (stderr, _("Operation failed.\n"));
+ FPRINTF (stderr, "%s", _("Operation failed.\n"));
ret = 1;
break;
default:
- fprintf (stderr, _("Unknown response code from ARM.\n"));
+ FPRINTF (stderr, "%s", _("Unknown response code from ARM.\n"));
break;
}
GNUNET_SCHEDULER_add_continuation (&cps_loop, NULL,
#if LOG_BACKOFF
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
{
- fprintf (killLogFilePtr, "%d.Reason is shutdown!\n", trialCount);
+ FPRINTF (killLogFilePtr, "%d.Reason is shutdown!\n", trialCount);
}
else if ((tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT) != 0)
{
- fprintf (killLogFilePtr, "%d.Reason is timeout!\n", trialCount);
+ FPRINTF (killLogFilePtr, "%d.Reason is timeout!\n", trialCount);
}
else if ((tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE) != 0)
{
- fprintf (killLogFilePtr, "%d.Service is running!\n", trialCount);
+ FPRINTF (killLogFilePtr, "%d.Service is running!\n", trialCount);
}
#endif
GNUNET_SCHEDULER_add_now (&kill_task, &a);
waitedFor = GNUNET_TIME_absolute_get_duration (startedWaitingAt);
#if LOG_BACKOFF
- fprintf (killLogFilePtr, "Waited for: %llu ms\n",
+ FPRINTF (killLogFilePtr, "Waited for: %llu ms\n",
(unsigned long long) waitedFor.rel_value);
#endif
}
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
"gethostname");
- fprintf (stderr,
- "Failed to determine my own hostname, testcase not run.\n");
+ FPRINTF (stderr,
+ "Failed to determine my own hostname, testcase not run.\n", NULL);
return 0;
}
if (NULL == gethostbyname (hostname))
{
- fprintf (stderr,
+ FPRINTF (stderr,
"Failed to resolve my hostname `%s', testcase not run.\n",
hostname);
return 0;
stddev[0] /= c_new;
stddev[0] = sqrt (stddev[0]);
if (!machine_parsable)
- fprintf (stderr, "new, %i measurements, average: %f stddev: %f\n", c_new,
+ FPRINTF (stderr, "new, %i measurements, average: %f stddev: %f\n", c_new,
average[0], stddev[0]);
average[1] = 0.0;
stddev[1] /= c_modified;
stddev[1] = sqrt (stddev[1]);
if (!machine_parsable)
- fprintf (stderr, "modified, %i measurements, average: %f stddev: %f\n",
+ FPRINTF (stderr, "modified, %i measurements, average: %f stddev: %f\n",
c_modified, average[1], stddev[1]);
average[2] = 0.0;
stddev[2] = sqrt (stddev[2]);
if (!machine_parsable)
- fprintf (stderr, "unmodified, %i measurements, average: %f stddev: %f\n",
+ FPRINTF (stderr, "unmodified, %i measurements, average: %f stddev: %f\n",
c_unmodified, average[2], stddev[2]);
if (machine_parsable)
- fprintf (stderr,
+ FPRINTF (stderr,
"peers,%i,mechs,%llu," "new,%i,%f,%f," "mod,%i,%f,%f,"
"unmod,%i,%f,%f\n", peers - 1,
(unsigned long long) results_unmodified[0].mechs, c_new,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %llu peers connected\n", value);
#if !VERBOSE
if (!machine_parsable)
- fprintf (stderr, "%i", count);
+ FPRINTF (stderr, "%i", count);
#endif
}
}
count++;
#if VERBOSE
- fprintf (stderr, "(new: %i / modified: %i / unmodified: %i) of %i \n",
+ FPRINTF (stderr, "(new: %i / modified: %i / unmodified: %i) of %i \n",
c_new, c_modified, c_unmodified, MEASUREMENTS);
#endif
if ((c_modified >= MEASUREMENTS) && (c_new >= MEASUREMENTS) &&
{
#if !VERBOSE
if (!machine_parsable)
- fprintf (stdout, "\n");
+ FPRINTF (stdout, "\n");
#endif
if (stats_task != GNUNET_SCHEDULER_NO_TASK)
{
current.timestamp = value;
#if !VERBOSE
if (!machine_parsable)
- fprintf (stderr, "..%i", count);
+ FPRINTF (stderr, "..%i", count);
#endif
return GNUNET_OK;
}
GNUNET_BLOCK_context_destroy (ctx);
GNUNET_CONFIGURATION_destroy (cfg);
if (ret != 0)
- fprintf (stderr, "Tests failed: %d\n", ret);
+ FPRINTF (stderr, "Tests failed: %d\n", ret);
return ret;
}
static int
join_cb (void *cls)
{
- fprintf (stdout, _("Joined\n"));
+ FPRINTF (stdout, "%s", _("Joined\n"));
return GNUNET_OK;
}
break;
}
time = GNUNET_STRINGS_absolute_time_to_string (timestamp);
- fprintf (stdout, fmt, time, nick, message);
+ FPRINTF (stdout, fmt, time, nick, message);
GNUNET_free (nick);
GNUNET_free (time);
return GNUNET_OK;
char *nick;
nick = GNUNET_PSEUDONYM_id_to_name (cfg, receiver);
- fprintf (stdout, _("'%s' acknowledged message #%d\n"), nick, orig_seq_number);
+ FPRINTF (stdout, _("'%s' acknowledged message #%d\n"), nick, orig_seq_number);
return GNUNET_OK;
}
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
&id);
nick = GNUNET_PSEUDONYM_id_to_name (cfg, &id);
- fprintf (stdout,
+ FPRINTF (stdout,
member_info !=
NULL ? _("`%s' entered the room\n") : _("`%s' left the room\n"),
nick);
&confirmation_cb, NULL, &me);
if (NULL == room)
{
- fprintf (stdout, _("Could not change username\n"));
+ FPRINTF (stdout, "%s", _("Could not change username\n"));
return GNUNET_SYSERR;
}
my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me);
- fprintf (stdout, _("Joining room `%s' as user `%s'...\n"), room_name,
+ FPRINTF (stdout, _("Joining room `%s' as user `%s'...\n"), room_name,
my_name);
GNUNET_free (my_name);
return GNUNET_OK;
&confirmation_cb, NULL, &me);
if (NULL == room)
{
- fprintf (stdout, _("Could not change username\n"));
+ FPRINTF (stdout, "%s", _("Could not change username\n"));
return GNUNET_SYSERR;
}
my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me);
- fprintf (stdout, _("Changed username to `%s'\n"), my_name);
+ FPRINTF (stdout, _("Changed username to `%s'\n"), my_name);
GNUNET_free (my_name);
return GNUNET_OK;
}
struct UserList *pos;
GNUNET_HashCode pid;
- fprintf (stdout, _("Users in room `%s': "), room_name);
+ FPRINTF (stdout, _("Users in room `%s': "), room_name);
pos = users;
while (NULL != pos)
{
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
&pid);
name = GNUNET_PSEUDONYM_id_to_name (cfg, &pid);
- fprintf (stdout, "`%s' ", name);
+ FPRINTF (stdout, "`%s' ", name);
GNUNET_free (name);
pos = pos->next;
}
- fprintf (stdout, "\n");
+ FPRINTF (stdout, "%s", "\n");
return GNUNET_OK;
}
if (NULL == strstr (msg, " "))
{
- fprintf (stderr, _("Syntax: /msg USERNAME MESSAGE"));
+ FPRINTF (stderr, "%s", _("Syntax: /msg USERNAME MESSAGE"));
return GNUNET_OK;
}
user = GNUNET_strdup (msg);
msg += strlen (user) + 1;
if (GNUNET_OK != GNUNET_PSEUDONYM_name_to_id (cfg, user, &uid))
{
- fprintf (stderr, _("Unknown user `%s'\n"), user);
+ FPRINTF (stderr, _("Unknown user `%s'\n"), user);
GNUNET_free (user);
return GNUNET_OK;
}
}
if (NULL == pos)
{
- fprintf (stderr, _("User `%s' is currently not in the room!\n"), user);
+ FPRINTF (stderr, _("User `%s' is currently not in the room!\n"), user);
GNUNET_free (user);
return GNUNET_OK;
}
static int
do_unknown (const char *msg, const void *xtra)
{
- fprintf (stderr, _("Unknown command `%s'\n"), msg);
+ FPRINTF (stderr, _("Unknown command `%s'\n"), msg);
return GNUNET_OK;
}
{
if (0 == strncasecmp (&args[1], &commands[i].command[1], strlen (args) - 1))
{
- fprintf (stdout, "%s\n", gettext (commands[i].helptext));
+ FPRINTF (stdout, "%s\n", gettext (commands[i].helptext));
return GNUNET_OK;
}
i++;
}
i = 0;
- fprintf (stdout, "Available commands:");
+ FPRINTF (stdout, "%s", "Available commands:");
while (commands[i].Action != &do_help)
{
- fprintf (stdout, " %s", gettext (commands[i].command));
+ FPRINTF (stdout, " %s", gettext (commands[i].command));
i++;
}
- fprintf (stdout, "\n");
- fprintf (stdout, "%s\n", gettext (commands[i].helptext));
+ FPRINTF (stdout, "%s", "\n");
+ FPRINTF (stdout, "%s\n", gettext (commands[i].helptext));
return GNUNET_OK;
}
/* check arguments */
if (NULL == nickname)
{
- fprintf (stderr, _("You must specify a nickname\n"));
+ FPRINTF (stderr, "%s", _("You must specify a nickname\n"));
ret = -1;
return;
}
&confirmation_cb, NULL, &me);
if (NULL == room)
{
- fprintf (stderr, _("Failed to join room `%s'\n"), room_name);
+ FPRINTF (stderr, _("Failed to join room `%s'\n"), room_name);
GNUNET_free (room_name);
GNUNET_free (nickname);
GNUNET_CONTAINER_meta_data_destroy (meta);
return;
}
my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me);
- fprintf (stdout, _("Joining room `%s' as user `%s'...\n"), room_name,
+ FPRINTF (stdout, _("Joining room `%s' as user `%s'...\n"), room_name,
my_name);
GNUNET_free (my_name);
handle_cmd_task =
/*
* new_address = GNUNET_malloc (sizeof (struct AddressStringList));
* #if VERBOSE
- * fprintf (stderr, "Received address %s\n", address);
+ * FPRINTF (stderr, "Received address %s\n", address);
* #endif
*
* new_address->address_string = GNUNET_strdup ("FIXME");
if (peer != NULL) /* Not yet finished */
{
#if VERBOSE
- fprintf (stderr, "Learned about peer %s\n", GNUNET_i2s (peer));
+ FPRINTF (stderr, "Learned about peer %s\n", GNUNET_i2s (peer));
peer_count++;
#endif
pc = GNUNET_malloc (sizeof (struct PrintContext));
#if VERBOSE
else
{
- fprintf (stderr, "Counted %u total connected peers.\n", peer_count);
+ FPRINTF (stderr, "Counted %u total connected peers.\n", peer_count);
}
#endif
}
cfg = c;
if (args[0] != NULL)
{
- fprintf (stderr, _("Invalid command line argument `%s'\n"), args[0]);
+ FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]);
return;
}
terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
#if VERBOSE
- fprintf (stderr, "ENDING ANGRILY %u\n", ok);
+ FPRINTF (stderr, "ENDING ANGRILY %u\n", ok);
#endif
GNUNET_break (0);
if (NULL != p1.ch)
GNUNET_TRANSPORT_disconnect (p2.th);
p2.th = NULL;
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
- fprintf (stderr, "\nThroughput was %llu kb/s\n",
+ FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
total_bytes * 1000 / 1024 / delta);
GAUGER ("CORE", "Core throughput/s", total_bytes * 1000 / 1024 / delta,
"kb/s");
#endif
n++;
if (0 == (n % (TOTAL_MSGS / 100)))
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (n == TOTAL_MSGS)
{
GNUNET_SCHEDULER_cancel (err_task);
static int ok;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
static void
timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- fprintf (stderr, "Timeout.\n");
+ FPRINTF (stderr, "%s", "Timeout.\n");
if (p1.ch != NULL)
{
GNUNET_CORE_disconnect (p1.ch);
enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG;
measure_task = GNUNET_SCHEDULER_NO_TASK;
- fprintf (stdout, "\n");
+ FPRINTF (stdout, "%s", "\n");
running = GNUNET_NO;
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
#endif
n++;
if (0 == (n % 10))
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (running == GNUNET_YES)
if (h == NULL)
{
- fprintf (stderr,
- "Failed to initialize datacache. Database likely not setup, skipping test.\n");
+ FPRINTF (stderr, "%s", "Failed to initialize datacache. Database likely not setup, skipping test.\n");
return;
}
exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS);
for (i = 0; i < ITERATIONS; i++)
{
if (0 == i % (ITERATIONS / 80))
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
ASSERT (GNUNET_OK ==
GNUNET_DATACACHE_put (h, &k, sizeof (GNUNET_HashCode),
(const char *) &n, 1 + i % 16, exp));
k = n;
}
- fprintf (stderr, "\n");
- fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS,
+ FPRINTF (stderr, "%s", "\n");
+ FPRINTF (stdout, "Stored %u items in %llums\n", ITERATIONS,
(unsigned long long)
GNUNET_TIME_absolute_get_duration (start).rel_value);
GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name);
for (i = 0; i < ITERATIONS; i++)
{
if (0 == i % (ITERATIONS / 80))
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n);
k = n;
}
- fprintf (stderr, "\n");
- fprintf (stdout,
+ FPRINTF (stderr, "%s", "\n");
+ FPRINTF (stdout,
"Found %u/%u items in %llums (%u were deleted during storage processing)\n",
found, ITERATIONS,
(unsigned long long)
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"perf-datacache", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some perfcases: %d\n", ok);
+ FPRINTF (stderr, "Missed some perfcases: %d\n", ok);
return ok;
}
h = GNUNET_DATACACHE_create (cfg, "testcache");
if (h == NULL)
{
- fprintf (stderr,
- "Failed to initialize datacache. Database likely not setup, skipping test.\n");
+ FPRINTF (stderr,
+ "Failed to initialize datacache. Database likely not setup, skipping test.\n", NULL);
return;
}
exp = GNUNET_TIME_absolute_get ();
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-datacache", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %d\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %d\n", ok);
return ok;
}
if (h == NULL)
{
- fprintf (stderr,
- "Failed to initialize datacache. Database likely not setup, skipping test.\n");
+ FPRINTF (stderr, "%s", "Failed to initialize datacache. Database likely not setup, skipping test.\n");
return;
}
exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS);
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 10; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
for (j = i; j < sizeof (buf); j += 10)
{
}
k = n;
}
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 10; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
if (i < 2)
ASSERT (0 == GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL));
ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL));
k = n;
}
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_DATACACHE_destroy (h);
return;
FAILURE:
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-datacache-quota", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %d\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %d\n", ok);
return ok;
}
return;
}
#if REPORT_ID
- fprintf (stderr, "I");
+ FPRINTF (stderr, "%s", "I");
#endif
stored_bytes += crc->size;
stored_ops++;
return;
}
#if REPORT_ID
- fprintf (stderr, "D");
+ FPRINTF (stderr, "%s", "D");
#endif
GNUNET_assert (GNUNET_OK == success);
GNUNET_SCHEDULER_add_now (&run_continuation, crc);
if (success != GNUNET_YES)
{
- fprintf (stderr,
+ FPRINTF (stderr,
"Test 'put' operation failed with error `%s' database likely not setup, skipping test.",
msg);
GNUNET_free (crc);
(GNUNET_TIME_UNIT_SECONDS), 0, 1,
GNUNET_TIME_UNIT_MINUTES, &run_tests, crc))
{
- fprintf (stderr, "Test 'put' operation failed.\n");
+ FPRINTF (stderr, "%s", "Test 'put' operation failed.\n");
ok = 1;
GNUNET_free (crc);
}
if (pos != plugin_name)
pos[0] = '.';
#if REPORT_ID
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
#endif
GNUNET_DISK_directory_remove (dir_name);
return ret;
GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg))
{
- fprintf (stderr, "ERROR: `%s'\n", msg);
+ FPRINTF (stderr, "ERROR: `%s'\n", msg);
GNUNET_free_non_null (msg);
return;
}
hits[i / 8] |= (1 << (i % 8));
#if VERBOSE
- fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
+ FPRINTF (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
type, priority, size, (unsigned long long) expiration.abs_value);
#endif
crc->cnt++;
crc->phase = RP_ERROR;
}
#if VERBOSE
- fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
+ FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
#endif
switch (crc->phase)
{
GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env)))
{
- fprintf (stderr, "Failed to load plugin `%s'!\n", name);
+ FPRINTF (stderr, "Failed to load plugin `%s'!\n", name);
return NULL;
}
GNUNET_free (libname);
api = load_plugin (c);
if (api == NULL)
{
- fprintf (stderr,
- "Could not initialize plugin, assuming database not configured. Test not run!\n");
+ FPRINTF (stderr,
+ "Could not initialize plugin, assuming database not configured. Test not run!\n", NULL);
return;
}
crc = GNUNET_malloc (sizeof (struct CpsRunContext));
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
"perf-plugin-datastore", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %u\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
return ok;
}
return;
}
#if 0
- fprintf (stderr, "Check value got `%s' of size %u, type %d, expire %llu\n",
+ FPRINTF (stderr, "Check value got `%s' of size %u, type %d, expire %llu\n",
GNUNET_h2s (key), (unsigned int) size, type,
(unsigned long long) expiration.abs_value);
- fprintf (stderr,
+ FPRINTF (stderr,
"Check value iteration %d wants size %u, type %d, expire %llu\n", i,
(unsigned int) get_size (i), get_type (i),
(unsigned long long) get_expiration (i).abs_value);
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
return;
case GNUNET_NO:
- fprintf (stderr, "Test 'put' operation failed, key already exists (!?)\n");
+ FPRINTF (stderr, "%s", "Test 'put' operation failed, key already exists (!?)\n");
GNUNET_free (crc);
return;
case GNUNET_SYSERR:
- fprintf (stderr,
+ FPRINTF (stderr,
"Test 'put' operation failed with error `%s' database likely not setup, skipping test.\n",
msg);
GNUNET_free (crc);
(GNUNET_TIME_UNIT_SECONDS), 0, 1,
GNUNET_TIME_UNIT_MINUTES, &run_tests, crc))
{
- fprintf (stderr, "Test 'put' operation failed.\n");
+ FPRINTF (stderr, "%s", "Test 'put' operation failed.\n");
ok = 1;
GNUNET_free (crc);
}
proc = NULL;
#endif
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %u\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
return ok;
}
if (success != GNUNET_YES)
{
- fprintf (stderr,
+ FPRINTF (stderr,
"Test 'put' operation failed with error `%s' database likely not setup, skipping test.",
msg);
GNUNET_free (crc);
(GNUNET_TIME_UNIT_SECONDS), 0, 1,
GNUNET_TIME_UNIT_MINUTES, &run_tests, crc))
{
- fprintf (stderr, "Test 'put' operation failed.\n");
+ FPRINTF (stderr, "%s", "Test 'put' operation failed.\n");
GNUNET_free (crc);
ok = 1;
}
GNUNET_OS_process_close (proc);
proc = NULL;
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %u\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
return ok;
}
msg = NULL;
prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100);
#if VERBOSE
- fprintf (stderr, "putting type %u, anon %u under key %s\n", i + 1, i,
+ FPRINTF (stderr, "putting type %u, anon %u under key %s\n", i + 1, i,
GNUNET_h2s (&key));
#endif
if (GNUNET_OK != api->put (api->cls, &key, size, value, i + 1 /* type */ ,
GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg))
{
- fprintf (stderr, "ERROR: `%s'\n", msg);
+ FPRINTF (stderr, "ERROR: `%s'\n", msg);
GNUNET_free_non_null (msg);
return;
}
guid = uid;
crc->phase++;
#if VERBOSE
- fprintf (stderr,
+ FPRINTF (stderr,
"Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n",
type, priority, size, (unsigned long long) expiration.abs_value,
GNUNET_h2s (key));
crc->phase = RP_ERROR;
}
#if VERBOSE
- fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
+ FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
#endif
switch (crc->phase)
{
GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env)))
{
- fprintf (stderr, "Failed to load plugin `%s'!\n", name);
+ FPRINTF (stderr, "Failed to load plugin `%s'!\n", name);
return NULL;
}
GNUNET_free (libname);
api = load_plugin (c);
if (api == NULL)
{
- fprintf (stderr,
- "Could not initialize plugin, assuming database not configured. Test not run!\n");
+ FPRINTF (stderr,
+ "Could not initialize plugin, assuming database not configured. Test not run!\n", NULL);
return;
}
crc = GNUNET_malloc (sizeof (struct CpsRunContext));
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
"test-plugin-datastore", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %u\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
return ok;
}
unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
size_t size, const void *data)
{
- fprintf (stdout, "Result %d, type %d:\n%.*s\n", result_count, type,
+ FPRINTF (stdout, "Result %d, type %d:\n%.*s\n", result_count, type,
(unsigned int) size, (char *) data);
result_count++;
}
if (query_key == NULL)
{
if (verbose)
- fprintf (stderr, "Must provide key for DHT GET!\n");
+ FPRINTF (stderr, "%s", "Must provide key for DHT GET!\n");
ret = 1;
return;
}
if (dht_handle == NULL)
{
if (verbose)
- fprintf (stderr, "Couldn't connect to DHT service!\n");
+ FPRINTF (stderr, "%s", "Couldn't connect to DHT service!\n");
ret = 1;
return;
}
else if (verbose)
- fprintf (stderr, "Connected to DHT service!\n");
+ FPRINTF (stderr, "%s", "Connected to DHT service!\n");
if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */
query_type = GNUNET_BLOCK_TYPE_TEST;
absolute_timeout = GNUNET_TIME_relative_to_absolute (timeout);
if (verbose)
- fprintf (stderr, "Issuing GET request for %s!\n", query_key);
+ FPRINTF (stderr, "Issuing GET request for %s!\n", query_key);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
(absolute_timeout), &cleanup_task, NULL);
get_handle =
message_sent_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
if (verbose)
- fprintf (stderr, _("PUT request sent!\n"));
+ FPRINTF (stderr, "%s", _("PUT request sent!\n"));
GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
if ((query_key == NULL) || (data == NULL))
{
- fprintf (stderr, _("Must provide KEY and DATA for DHT put!\n"));
+ FPRINTF (stderr, "%s", _("Must provide KEY and DATA for DHT put!\n"));
ret = 1;
return;
}
dht_handle = GNUNET_DHT_connect (cfg, 1);
if (dht_handle == NULL)
{
- fprintf (stderr, _("Could not connect to %s service!\n"), "DHT");
+ FPRINTF (stderr, _("Could not connect to %s service!\n"), "DHT");
ret = 1;
return;
}
else if (verbose)
- fprintf (stderr, _("Connected to %s service!\n"), "DHT");
+ FPRINTF (stderr, _("Connected to %s service!\n"), "DHT");
if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */
query_type = GNUNET_BLOCK_TYPE_TEST;
expiration_seconds));
if (verbose)
- fprintf (stderr, _("Issuing put request for `%s' with data `%s'!\n"),
+ FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"),
query_key, data);
GNUNET_DHT_put (dht_handle, &key, replication, GNUNET_DHT_RO_NONE, query_type,
strlen (data), data, expiration, timeout, &message_sent_cont,
static GNUNET_SCHEDULER_TaskIdentifier die_task;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
{
/* do work here */
#if VERBOSE
- fprintf (stderr, "Ending on an unhappy note.\n");
+ FPRINTF (stderr, "%s", "Ending on an unhappy note.\n");
#endif
if ((retry_context.peer_ctx != NULL) &&
{
if (emsg != NULL)
{
- fprintf (stderr, "Failed to shutdown testing topology: %s\n", emsg);
+ FPRINTF (stderr, "Failed to shutdown testing topology: %s\n", emsg);
if (ok == 0)
ok = 2;
}
struct StatMaster *sm = cls;
stats[sm->value].total += value;
- fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
+ FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
name, (unsigned long long) value);
return GNUNET_OK;
}
i = 0;
while (stats[i].name != NULL)
{
- fprintf (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem,
+ FPRINTF (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem,
stats[i].name, (unsigned long long) stats[i].total);
i++;
}
struct TestGetContext *test_get;
die_task = GNUNET_SCHEDULER_NO_TASK;
- fprintf (stderr, "Failing test with error: `%s'!\n", emsg);
+ FPRINTF (stderr, "Failing test with error: `%s'!\n", emsg);
while (NULL != (test_put = all_puts_head))
{
if (test_put->task != GNUNET_SCHEDULER_NO_TASK)
if (test_get->succeeded != GNUNET_YES)
{
gets_failed++;
- fprintf (stderr, "Get from peer %s for key %s failed!\n",
+ FPRINTF (stderr, "Get from peer %s for key %s failed!\n",
GNUNET_i2s (&test_get->daemon->id), GNUNET_h2s (&search_key));
}
GNUNET_assert (test_get->get_handle != NULL);
if ((gets_failed > 10) && (outstanding_gets == 0))
{
/* Had more than 10% failures */
- fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed,
+ FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed,
gets_failed);
GNUNET_SCHEDULER_cancel (die_task);
ok = 1;
}
if ((gets_completed + gets_failed == num_peers * num_peers) && (outstanding_gets == 0)) /* All gets successful */
{
- fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed,
+ FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed,
gets_failed);
GNUNET_SCHEDULER_cancel (die_task);
ok = 0;
{
unsigned int i;
- fprintf (stderr, "PUT (%u) Path: ", test_get->uid);
+ FPRINTF (stderr, "PUT (%u) Path: ", test_get->uid);
for (i = 0; i < put_path_length; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
+ FPRINTF (stderr, "%s", "\n");
}
if (get_path != NULL)
{
unsigned int i;
- fprintf (stderr, "GET (%u) Path: ", test_get->uid);
+ FPRINTF (stderr, "GET (%u) Path: ", test_get->uid);
for (i = 0; i < get_path_length; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
- fprintf (stderr, "%s%s\n", get_path_length > 0 ? "->" : "",
+ FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
+ FPRINTF (stderr, "%s%s\n", get_path_length > 0 ? "->" : "",
GNUNET_i2s (&test_get->daemon->id));
}
#endif
if ((0 != memcmp (&search_key, key, sizeof (GNUNET_HashCode))) ||
(0 != memcmp (original_data, data, sizeof (original_data))))
{
- fprintf (stderr, "Key or data is not the same as was inserted!\n");
+ FPRINTF (stderr, "%s", "Key or data is not the same as was inserted!\n");
return;
}
gets_completed++;
struct TestGetContext *test_get;
#if VERBOSE
- fprintf (stderr, "Issuing %llu GETs\n",
+ FPRINTF (stderr, "Issuing %llu GETs\n",
(unsigned long long) (num_peers * num_peers));
#endif
for (i = 0; i < num_peers; i++)
GNUNET_assert (test_put->dht_handle != NULL);
outstanding_puts++;
#if VERBOSE > 2
- fprintf (stderr, "PUT %u at `%s'\n", test_put->uid,
+ FPRINTF (stderr, "PUT %u at `%s'\n", test_put->uid,
GNUNET_i2s (&test_put->daemon->id));
#endif
GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option,
die_task =
GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly,
"from setup puts/gets");
- fprintf (stderr, "Issuing %llu PUTs (one per peer)\n",
+ FPRINTF (stderr, "Issuing %llu PUTs (one per peer)\n",
(unsigned long long) (num_peers * num_peers));
for (i = 0; i < num_peers * num_peers; i++)
{
{
if (emsg != NULL)
{
- fprintf (stderr, "Failed to setup topology: %s\n", emsg);
+ FPRINTF (stderr, "Failed to setup topology: %s\n", emsg);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, "topology setup failed");
return;
}
{
const char *emsg = cls;
- fprintf (stderr, "Error: %s\n", emsg);
+ FPRINTF (stderr, "Error: %s\n", emsg);
if (curr_get_ctx.retry_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (curr_get_ctx.retry_task);
if (0 !=
memcmp (&get_context->peer->hashPubKey, key, sizeof (GNUNET_HashCode)))
{
- fprintf (stderr, "??\n");
+ FPRINTF (stderr, "%s", "??\n");
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Key returned is not the same key as was searched for!\n");
GNUNET_SCHEDULER_cancel (die_task);
"key mismatch in get response!\n");
return;
}
- fprintf (stderr, "!\n");
+ FPRINTF (stderr, "%s", "!\n");
if (get_context->retry_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (get_context->retry_task);
get_context->get_attempts);
else
{
- fprintf (stderr, "?\n");
+ FPRINTF (stderr, "%s", "?\n");
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Too many attempts failed, ending test!\n",
get_context->get_attempts);
"GET attempt failed, ending test!\n");
return;
}
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
get_context->get_attempts++;
get_context->retry_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
{
if (emsg != NULL)
{
- fprintf (stderr, "Failed to start daemon: `%s'\n", emsg);
+ FPRINTF (stderr, "Failed to start daemon: `%s'\n", emsg);
return;
}
GNUNET_assert (id != NULL);
#if VERBOSE
if (put_path != NULL)
{
- fprintf (stderr, "PUT Path: ");
+ FPRINTF (stderr, "%s", "PUT Path: ");
for (i = 0; i < put_path_length; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i]));
+ FPRINTF (stderr, "%s", "\n");
}
if (get_path != NULL)
{
- fprintf (stderr, "GET Path: ");
+ FPRINTF (stderr, "%s", "GET Path: ");
for (i = 0; i < get_path_length; i++)
- fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i]));
+ FPRINTF (stderr, "%s", "\n");
}
#endif
#endif
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
fclose (dotOutFile);
+ FPRINTF (dotOutFile, "%s", "}");
}
ok = 0;
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
}
if (dotOutFile != NULL)
{
if (distance == 1)
- fprintf (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname);
+ FPRINTF (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname);
else if (distance == 2)
- fprintf (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname,
second_shortname);
else if (distance == 3)
- fprintf (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname,
second_shortname);
else if (distance == 4)
- fprintf (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname,
second_shortname);
else
- fprintf (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname,
second_shortname);
}
GNUNET_free (second_shortname);
dotOutFile = fopen (dotOutFileName, "w");
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "strict graph G {\n");
+ FPRINTF (dotOutFile, "%s", "strict graph G {\n");
}
#if VERBOSE
const char *buf;
#if DETAILS
- fprintf (stderr, "!"); /* message complete, good! */
+ FPRINTF (stderr, "%s", "!"); /* message complete, good! */
#endif
buf = (const char *) hdr;
for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++)
total++;
#if ! DETAILS
if (0 == (total % (NUM_MSGS / 100)))
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
#endif
/* tolerate 10% loss, i.e. due to duplicate fragment IDs */
if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0))
if (ret == GNUNET_OK)
{
#if DETAILS
- fprintf (stderr, "@"); /* good ACK */
+ FPRINTF (stderr, "%s", "@"); /* good ACK */
#endif
GNUNET_FRAGMENT_context_destroy (frags[i]);
frags[i] = NULL;
if (ret == GNUNET_NO)
{
#if DETAILS
- fprintf (stderr, "@"); /* good ACK */
+ FPRINTF (stderr, "%s", "@"); /* good ACK */
#endif
acks++;
return;
}
}
#if DETAILS
- fprintf (stderr, "_"); /* BAD: ack that nobody feels responsible for... */
+ FPRINTF (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */
#endif
}
}
if (NULL == defrag)
{
- fprintf (stderr, "E"); /* Error: frag after shutdown!? */
+ FPRINTF (stderr, "%s", "E"); /* Error: frag after shutdown!? */
return;
}
ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr);
if (ret == GNUNET_NO)
{
#if DETAILS
- fprintf (stderr, "?"); /* duplicate fragment */
+ FPRINTF (stderr, "%s", "?"); /* duplicate fragment */
#endif
dups++;
}
else if (ret == GNUNET_OK)
{
#if DETAILS
- fprintf (stderr, "."); /* good fragment */
+ FPRINTF (stderr, "%s", "."); /* good fragment */
#endif
fragc++;
}
100);
GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options,
&run, NULL);
- fprintf (stderr,
+ FPRINTF (stderr,
"\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n",
fragc, dups, acks, ack_drops);
return ret;
if (NULL == args[0])
{
- fprintf (stderr, _("You must specify a filename to inspect."));
+ FPRINTF (stderr, "%s", _("You must specify a filename to inspect."));
ret = 1;
return;
}
{
case GNUNET_FS_STATUS_DOWNLOAD_START:
if (verbose > 1)
- fprintf (stderr, _("Starting download `%s'.\n"),
+ FPRINTF (stderr, _("Starting download `%s'.\n"),
info->value.download.filename);
break;
case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
1000LL /
(info->value.download.
duration.rel_value + 1));
- fprintf (stdout,
+ FPRINTF (stdout,
_("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"),
info->value.download.filename,
(unsigned long long) info->value.download.completed,
}
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- fprintf (stderr, _("Error downloading: %s.\n"),
+ FPRINTF (stderr, _("Error downloading: %s.\n"),
info->value.download.specifics.error.message);
GNUNET_SCHEDULER_shutdown ();
break;
s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 /
(info->value.download.
duration.rel_value + 1));
- fprintf (stdout, _("Downloading `%s' done (%s/s).\n"),
+ FPRINTF (stdout, _("Downloading `%s' done (%s/s).\n"),
info->value.download.filename, s);
GNUNET_free (s);
if (info->value.download.dc == dc)
case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
break;
default:
- fprintf (stderr, _("Unexpected status: %d\n"), info->status);
+ FPRINTF (stderr, _("Unexpected status: %d\n"), info->status);
break;
}
return NULL;
if (NULL == args[0])
{
- fprintf (stderr, _("You need to specify a URI argument.\n"));
+ FPRINTF (stderr, "%s", _("You need to specify a URI argument.\n"));
return;
}
uri = GNUNET_FS_uri_parse (args[0], &emsg);
if (NULL == uri)
{
- fprintf (stderr, _("Failed to parse URI: %s\n"), emsg);
+ FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg);
GNUNET_free (emsg);
ret = 1;
return;
}
if ((!GNUNET_FS_uri_test_chk (uri)) && (!GNUNET_FS_uri_test_loc (uri)))
{
- fprintf (stderr, _("Only CHK or LOC URIs supported.\n"));
+ FPRINTF (stderr, "%s", _("Only CHK or LOC URIs supported.\n"));
ret = 1;
GNUNET_FS_uri_destroy (uri);
return;
}
if (NULL == filename)
{
- fprintf (stderr, _("Target filename must be specified.\n"));
+ FPRINTF (stderr, "%s", _("Target filename must be specified.\n"));
ret = 1;
GNUNET_FS_uri_destroy (uri);
return;
request_parallelism, GNUNET_FS_OPTIONS_END);
if (NULL == ctx)
{
- fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
+ FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
GNUNET_FS_uri_destroy (uri);
ret = 1;
return;
print_indexed (void *cls, const char *filename, const GNUNET_HashCode * file_id)
{
if (verbose)
- fprintf (stdout, "%s: %s\n", GNUNET_h2s (file_id), filename);
+ FPRINTF (stdout, "%s: %s\n", GNUNET_h2s (file_id), filename);
else
- fprintf (stdout, "%s\n", filename);
+ FPRINTF (stdout, "%s\n", filename);
return GNUNET_OK;
}
struct GNUNET_CRYPTO_HashAsciiEncoded enc;
GNUNET_CRYPTO_hash_to_enc (id, &enc);
- fprintf (stdout, "%s (%s)\n", name, (const char *) &enc);
+ FPRINTF (stdout, "%s (%s)\n", name, (const char *) &enc);
}
GNUNET_break (0);
return GNUNET_OK;
}
- fprintf (stdout, "%s (%d):\n", id, rating);
+ FPRINTF (stdout, "%s (%d):\n", id, rating);
GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout);
- fprintf (stdout, "\n");
+ FPRINTF (stdout, "%s", "\n");
GNUNET_free (id);
return GNUNET_OK;
}
if (emsg != NULL)
{
- fprintf (stderr, "%s", emsg);
+ FPRINTF (stderr, "%s", emsg);
ret = 1;
}
if (ns != NULL)
else
{
if (ksk_uri != NULL)
- fprintf (stderr, _("Option `%s' ignored\n"), "-k");
+ FPRINTF (stderr, _("Option `%s' ignored\n"), "-k");
}
}
}
else
{
if (root_identifier != NULL)
- fprintf (stderr, _("Option `%s' ignored\n"), "-r");
+ FPRINTF (stderr, _("Option `%s' ignored\n"), "-r");
if (ksk_uri != NULL)
- fprintf (stderr, _("Option `%s' ignored\n"), "-k");
+ FPRINTF (stderr, _("Option `%s' ignored\n"), "-k");
}
post_advertising (NULL, NULL, NULL);
if (verbose)
{
s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.eta);
- fprintf (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"),
+ FPRINTF (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"),
info->value.publish.filename,
(unsigned long long) info->value.publish.completed,
(unsigned long long) info->value.publish.size, s);
}
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, _("Error publishing: %s.\n"),
+ FPRINTF (stderr, _("Error publishing: %s.\n"),
info->value.publish.specifics.error.message);
if (kill_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
- fprintf (stdout, _("Publishing `%s' done.\n"),
+ FPRINTF (stdout, _("Publishing `%s' done.\n"),
info->value.publish.filename);
s = GNUNET_FS_uri_to_string (info->value.publish.specifics.
completed.chk_uri);
- fprintf (stdout, _("URI is `%s'.\n"), s);
+ FPRINTF (stdout, _("URI is `%s'.\n"), s);
GNUNET_free (s);
if (info->value.publish.pctx == NULL)
{
case GNUNET_FS_STATUS_UNINDEX_PROGRESS:
return NULL;
case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
- fprintf (stderr, _("Cleanup after abort complete.\n"));
+ FPRINTF (stderr, "%s", _("Cleanup after abort complete.\n"));
return NULL;
default:
- fprintf (stderr, _("Unexpected status: %d\n"), info->status);
+ FPRINTF (stderr, _("Unexpected status: %d\n"), info->status);
return NULL;
}
return ""; /* non-null */
return 0;
if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME)
return 0;
- fprintf (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data);
+ FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data);
return 0;
}
static int
keyword_printer (void *cls, const char *keyword, int is_mandatory)
{
- fprintf (stdout, "\t%s\n", keyword);
+ FPRINTF (stdout, "\t%s\n", keyword);
return GNUNET_OK;
}
fn = GNUNET_CONTAINER_meta_data_get_by_type (m,
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME);
fs = GNUNET_STRINGS_byte_size_fancy (length);
- fprintf (stdout, _("Meta data for file `%s' (%s)\n"), fn, fs);
+ FPRINTF (stdout, _("Meta data for file `%s' (%s)\n"), fn, fs);
GNUNET_CONTAINER_meta_data_iterate (m, &meta_printer, NULL);
- fprintf (stdout, _("Keywords for file `%s' (%s)\n"), fn, fs);
+ FPRINTF (stdout, _("Keywords for file `%s' (%s)\n"), fn, fs);
GNUNET_free (fn);
GNUNET_free (fs);
if (NULL != *uri)
GNUNET_FS_uri_ksk_get_keywords (*uri, &keyword_printer, NULL);
- fprintf (stdout, "\n");
+ FPRINTF (stdout, "%s", "\n");
}
if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (m))
GNUNET_FS_file_information_inspect (fi, &publish_inspector, fi);
{
if (emsg != NULL)
{
- fprintf (stderr, "%s\n", emsg);
+ FPRINTF (stderr, "%s\n", emsg);
ret = 1;
}
GNUNET_FS_uri_destroy (uri);
if (emsg != NULL)
{
- fprintf (stderr, "%s\n", emsg);
+ FPRINTF (stderr, "%s\n", emsg);
ret = 1;
}
if (pseudonym != NULL)
ns = GNUNET_FS_namespace_create (ctx, pseudonym);
if (ns == NULL)
{
- fprintf (stderr, _("Failed to create namespace `%s'\n"), pseudonym);
+ FPRINTF (stderr, _("Failed to create namespace `%s'\n"), pseudonym);
ret = 1;
}
else
{
if (NULL == this_id)
{
- fprintf (stderr, _("Option `%s' is required when using option `%s'.\n"),
+ FPRINTF (stderr, _("Option `%s' is required when using option `%s'.\n"),
"-t", "-P");
ret = -1;
return;
{ /* ordinary insertion checks */
if (NULL != next_id)
{
- fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
+ FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
"-N", "-P");
ret = -1;
return;
}
if (NULL != this_id)
{
- fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
+ FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
"-t", "-P");
ret = -1;
return;
GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
if (NULL == ctx)
{
- fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
+ FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
ret = 1;
return;
}
namespace = GNUNET_FS_namespace_create (ctx, pseudonym);
if (NULL == namespace)
{
- fprintf (stderr, _("Could not create namespace `%s'\n"), pseudonym);
+ FPRINTF (stderr, _("Could not create namespace `%s'\n"), pseudonym);
GNUNET_FS_stop (ctx);
ret = 1;
return;
uri = GNUNET_FS_uri_parse (uri_string, &emsg);
if (uri == NULL)
{
- fprintf (stderr, _("Failed to parse URI: %s\n"), emsg);
+ FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg);
GNUNET_free (emsg);
if (namespace != NULL)
GNUNET_FS_namespace_delete (namespace, GNUNET_NO);
EXTRACTOR_plugin_remove_all (plugins);
if (fi == NULL)
{
- fprintf (stderr, _("Could not publish `%s': %s\n"), args[0], emsg);
+ FPRINTF (stderr, _("Could not publish `%s': %s\n"), args[0], emsg);
GNUNET_free (emsg);
if (namespace != NULL)
GNUNET_FS_namespace_delete (namespace, GNUNET_NO);
GNUNET_FS_PUBLISH_OPTION_NONE);
if (NULL == pc)
{
- fprintf (stderr, _("Could not start publishing.\n"));
+ FPRINTF (stderr, "%s", _("Could not start publishing.\n"));
GNUNET_FS_stop (ctx);
ret = 1;
return;
GNUNET_DISK_PERM_USER_READ |
GNUNET_DISK_PERM_USER_WRITE))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_("Failed to write directory with search results to `%s'\n"),
output_filename);
}
/* ignore */
break;
case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr, _("Error searching: %s.\n"),
+ FPRINTF (stderr, _("Error searching: %s.\n"),
info->value.search.specifics.error.message);
GNUNET_SCHEDULER_shutdown ();
break;
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
default:
- fprintf (stderr, _("Unexpected status: %d\n"), info->status);
+ FPRINTF (stderr, _("Unexpected status: %d\n"), info->status);
break;
}
return NULL;
uri = GNUNET_FS_uri_ksk_create_from_args (argc, (const char **) args);
if (NULL == uri)
{
- fprintf (stderr, _("Could not create keyword URI from arguments.\n"));
+ FPRINTF (stderr, "%s", _("Could not create keyword URI from arguments.\n"));
ret = 1;
return;
}
GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
if (NULL == ctx)
{
- fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
+ FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
GNUNET_FS_uri_destroy (uri);
ret = 1;
return;
GNUNET_FS_uri_destroy (uri);
if (NULL == sc)
{
- fprintf (stderr, _("Could not start searching.\n"));
+ FPRINTF (stderr, "%s", _("Could not start searching.\n"));
GNUNET_FS_stop (ctx);
ret = 1;
return;
if (verbose)
{
s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta);
- fprintf (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"),
+ FPRINTF (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"),
(unsigned long long) info->value.unindex.completed,
(unsigned long long) info->value.unindex.size, s);
GNUNET_free (s);
}
break;
case GNUNET_FS_STATUS_UNINDEX_ERROR:
- fprintf (stderr, _("Error unindexing: %s.\n"),
+ FPRINTF (stderr, _("Error unindexing: %s.\n"),
info->value.unindex.specifics.error.message);
GNUNET_SCHEDULER_shutdown ();
break;
case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
- fprintf (stdout, _("Unindexing done.\n"));
+ FPRINTF (stdout, "%s", _("Unindexing done.\n"));
GNUNET_SCHEDULER_shutdown ();
break;
case GNUNET_FS_STATUS_UNINDEX_STOPPED:
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
default:
- fprintf (stderr, _("Unexpected status: %d\n"), info->status);
+ FPRINTF (stderr, _("Unexpected status: %d\n"), info->status);
break;
}
return NULL;
GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
if (NULL == ctx)
{
- fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
+ FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS");
ret = 1;
return;
}
uc = GNUNET_FS_unindex_start (ctx, args[0], NULL);
if (NULL == uc)
{
- fprintf (stderr, _("Could not start unindex operation.\n"));
+ FPRINTF (stderr, "%s", _("Could not start unindex operation.\n"));
GNUNET_FS_stop (ctx);
return;
}
{
struct StatMaster *sm = cls;
- fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
+ FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
name, (unsigned long long) value);
return GNUNET_OK;
}
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stdout, "Download speed was %s/s\n", fancy);
+ FPRINTF (stdout, "Download speed was %s/s\n", fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
{
struct StatMaster *sm = cls;
- fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
+ FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem,
name, (unsigned long long) value);
return GNUNET_OK;
}
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stderr, "Download speed of type `%s' was %s/s\n", type, fancy);
+ FPRINTF (stderr, "Download speed of type `%s' was %s/s\n", type, fancy);
GNUNET_free (fancy);
if (NUM_DAEMONS != ++download_counter)
return; /* more downloads to come */
return;
}
}
- fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__);
+ FPRINTF (stderr, "Error at %s:%d\n", __FILE__, __LINE__);
}
static int
GNUNET_FS_directory_builder_finish (db, &dlen, (void **) &data);
s = GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration
(start));
- fprintf (stdout,
+ FPRINTF (stdout,
"Creating directory with %u entires and total size %llu took %s\n",
i, (unsigned long long) dlen, s);
GNUNET_free (s);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- fprintf (stderr, "Error downloading file: %s\n",
+ FPRINTF (stderr, "Error downloading file: %s\n",
event->value.download.specifics.error.message);
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- fprintf (stderr, "Error downloading file: %s\n",
+ FPRINTF (stderr, "Error downloading file: %s\n",
event->value.download.specifics.error.message);
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- fprintf (stderr, "Error downloading file: %s\n",
+ FPRINTF (stderr, "Error downloading file: %s\n",
event->value.download.specifics.error.message);
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
#endif
break;
case GNUNET_FSUI_unindex_error:
- fprintf (stderr, "Error unindexing: %s\n",
+ FPRINTF (stderr, "Error unindexing: %s\n",
event->data.UnindexError.message);
break;
case GNUNET_FSUI_upload_error:
- fprintf (stderr, "Error uploading: %s\n", event->data.UploadError.message);
+ FPRINTF (stderr, "Error uploading: %s\n", event->data.UploadError.message);
break;
case GNUNET_FSUI_download_error:
- fprintf (stderr, "Error downloading: %s\n",
+ FPRINTF (stderr, "Error downloading: %s\n",
event->data.DownloadError.message);
break;
case GNUNET_FSUI_download_aborted:
GNUNET_GC_free (cfg);
return -1;
}
- fprintf (stderr, "Setup...\n");
+ FPRINTF (stderr, "%s", "Setup...\n");
#if START_DAEMON
GNUNET_disk_directory_remove (NULL,
"/tmp/gnunet-fsui-recursive_download_test/");
kuri =
GNUNET_ECRS_keyword_command_line_to_uri (ectx, 2,
(const char **) keywords);
- fprintf (stderr, "Uploading...\n");
+ FPRINTF (stderr, "%s", "Uploading...\n");
waitForEvent = GNUNET_FSUI_upload_completed;
upload =
GNUNET_FSUI_upload_start (ctx, fn,
upload = NULL;
CHECK (upURI != NULL);
- fprintf (stderr, "Downloading...\n");
+ FPRINTF (stderr, "%s", "Downloading...\n");
waitForEvent = GNUNET_FSUI_download_completed;
fn43 = makeName (43);
download =
break;
}
FAILURE:
- fprintf (stderr, "Cleanup...\n");
+ FPRINTF (stderr, "%s", "Cleanup...\n");
if (meta != NULL)
GNUNET_meta_data_destroy (meta);
if (ctx != NULL)
EXTRACTOR_OPTION_DEFAULT_POLICY);
if (ex == NULL)
{
- fprintf (stderr,
- "Test incomplete, have no GTK thumbnail extractor available.\n");
+ FPRINTF (stderr,
+ "Test incomplete, have no GTK thumbnail extractor available.\n", NULL);
return 0; /* can not test, no thumbnailer */
}
ex = EXTRACTOR_plugin_add_config (ex, "mime",
"WARNING",
#endif
NULL);
- fprintf (stderr, "WARNING: testcase not yet written.\n");
+ FPRINTF (stderr, "%s", "WARNING: testcase not yet written.\n");
return 0; /* testcase passed */
}
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
ret = event->value.publish.cctx;
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
err = 1;
if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx))
static void
do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- fprintf (stderr, "Operation timed out\n");
+ FPRINTF (stderr, "%s", "Operation timed out\n");
kill_task = GNUNET_SCHEDULER_NO_TASK;
abort_sks_search_task (NULL, tc);
abort_ksk_search_task (NULL, tc);
if (!GNUNET_FS_uri_test_equal
(sks_expect_uri, event->value.search.specifics.result.uri))
{
- fprintf (stderr, "Wrong result for sks search!\n");
+ FPRINTF (stderr, "%s", "Wrong result for sks search!\n");
err = 1;
}
/* give system 1ms to initiate update search! */
if (!GNUNET_FS_uri_test_equal
(ksk_expect_uri, event->value.search.specifics.result.uri))
{
- fprintf (stderr, "Wrong result for ksk search!\n");
+ FPRINTF (stderr, "%s", "Wrong result for ksk search!\n");
err = 1;
}
GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL,
}
else
{
- fprintf (stderr, "Unexpected search result received!\n");
+ FPRINTF (stderr, "%s", "Unexpected search result received!\n");
GNUNET_break (0);
}
break;
case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr, "Error searching file: %s\n",
+ FPRINTF (stderr, "Error searching file: %s\n",
event->value.search.specifics.error.message);
if (sks_search == event->value.search.sc)
GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL,
case GNUNET_FS_STATUS_SEARCH_STOPPED:
return NULL;
default:
- fprintf (stderr, "Unexpected event: %d\n", event->status);
+ FPRINTF (stderr, "Unexpected event: %d\n", event->status);
break;
}
return event->value.search.cctx;
if (NULL != emsg)
{
- fprintf (stderr, "Error publishing: %s\n", emsg);
+ FPRINTF (stderr, "Error publishing: %s\n", emsg);
err = 1;
GNUNET_FS_stop (fs);
return;
sks_uri = GNUNET_FS_uri_parse (sbuf, &msg);
if (msg != NULL)
{
- fprintf (stderr, "failed to parse URI `%s': %s\n", sbuf, msg);
+ FPRINTF (stderr, "failed to parse URI `%s': %s\n", sbuf, msg);
err = 1;
GNUNET_FS_stop (fs);
GNUNET_free (msg);
if (NULL != emsg)
{
- fprintf (stderr, "Error publishing: %s\n", emsg);
+ FPRINTF (stderr, "Error publishing: %s\n", emsg);
err = 1;
GNUNET_FS_stop (fs);
return;
GNUNET_FS_namespace_list (fs, &ns_iterator, &ok);
if (GNUNET_NO == ok)
{
- fprintf (stderr, "namespace_list failed to find namespace!\n");
+ FPRINTF (stderr, "%s", "namespace_list failed to find namespace!\n");
GNUNET_FS_namespace_delete (ns, GNUNET_YES);
GNUNET_FS_stop (fs);
err = 1;
stop_arm (&p1);
if (GNUNET_YES != update_started)
{
- fprintf (stderr, "Update search never started!\n");
+ FPRINTF (stderr, "%s", "Update search never started!\n");
err = 1;
}
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-namespace/");
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
ret = event->value.publish.cctx;
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
err = 1;
if (0 == strcmp ("publish-context-dir", event->value.publish.cctx))
{
- fprintf (stderr, "Scheduling abort task for error on `%s'\n",
+ FPRINTF (stderr, "Scheduling abort task for error on `%s'\n",
(const char *) event->value.publish.cctx);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
ret = event->value.publish.cctx;
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
err = 1;
GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr, "Error searching file: %s\n",
+ FPRINTF (stderr, "Error searching file: %s\n",
event->value.search.specifics.error.message);
GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
default:
- fprintf (stderr, "Unexpected event: %d\n", event->status);
+ FPRINTF (stderr, "Unexpected event: %d\n", event->status);
break;
}
return NULL;
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr, "Error searching file: %s\n",
+ FPRINTF (stderr, "Error searching file: %s\n",
event->value.search.specifics.error.message);
GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
search = NULL;
break;
default:
- fprintf (stderr, "Unexpected event: %d\n", event->status);
+ FPRINTF (stderr, "Unexpected event: %d\n", event->status);
break;
}
return NULL;
prog++;
if (prog == 10000)
{
- fprintf (stderr, "Upload failed to complete -- last event: %u\n",
+ FPRINTF (stderr, "Upload failed to complete -- last event: %u\n",
lastEvent);
}
CHECK (prog < 10000);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_UNINDEX_ERROR:
- fprintf (stderr, "Error unindexing file: %s\n",
+ FPRINTF (stderr, "Error unindexing file: %s\n",
event->value.unindex.specifics.error.message);
GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
unindex = event->value.unindex.uc;
return "unindex";
case GNUNET_FS_STATUS_PUBLISH_ERROR:
- fprintf (stderr, "Error publishing file: %s\n",
+ FPRINTF (stderr, "Error publishing file: %s\n",
event->value.publish.specifics.error.message);
GNUNET_break (0);
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
case GNUNET_FS_STATUS_UNINDEX_ERROR:
- fprintf (stderr, "Error unindexing file: %s\n",
+ FPRINTF (stderr, "Error unindexing file: %s\n",
event->value.unindex.specifics.error.message);
GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, "test_fs_uri_data.conf"))
{
- fprintf (stderr, "Failed to parse configuration file\n");
+ FPRINTF (stderr, "%s", "Failed to parse configuration file\n");
GNUNET_FS_uri_destroy (baseURI);
GNUNET_CONFIGURATION_destroy (cfg);
return 1;
failureCount += testLocation ();
for (i = 0; i < 255; i++)
{
- /* fprintf (stderr, "."); */
+ /* FPRINTF (stderr, "%s", "."); */
failureCount += testNamespace (i);
failureCount += testFile (i);
}
- /* fprintf (stderr, "\n"); */
+ /* FPRINTF (stderr, "%s", "\n"); */
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-uri");
if (failureCount != 0)
return 1;
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stdout, "Download speed was %s/s\n", fancy);
+ FPRINTF (stdout, "Download speed was %s/s\n", fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
{
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
- fprintf (stderr, "Daemons failed to start!\n");
+ FPRINTF (stderr, "%s", "Daemons failed to start!\n");
GNUNET_break (0);
ok = 1;
return;
fancy =
GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) *
1000LL / del.rel_value);
- fprintf (stdout, "Download speed was %s/s\n", fancy);
+ FPRINTF (stdout, "Download speed was %s/s\n", fancy);
GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
(unsigned long long) FILESIZE);
struct GNUNET_HELLO_Address address;
#if DEBUG
- fprintf (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i);
+ FPRINTF (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i);
#endif
if (0 == *i)
return 0;
unsigned int *i = cls;
#if DEBUG
- fprintf (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n",
+ FPRINTF (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n",
*i, address->address_length);
#endif
GNUNET_assert (address->address_length > 0);
unsigned int *i = cls;
#if DEBUG
- fprintf (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n",
+ FPRINTF (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n",
*i, address->address_length);
#endif
GNUNET_assert (address->address_length > 0);
startup_time = GNUNET_TIME_absolute_get ();
memset (&publicKey, 42, sizeof (publicKey));
#if VERBOSE
- fprintf (stderr, "Testing HELLO creation (without addresses)...\n");
+ FPRINTF (stderr, "%s", "Testing HELLO creation (without addresses)...\n");
#endif
i = 0;
msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
GNUNET_assert (0 < GNUNET_HELLO_size (msg1));
#if VERBOSE
- fprintf (stderr, "Testing address iteration (empty set)...\n");
+ FPRINTF (stderr, "%s", "Testing address iteration (empty set)...\n");
#endif
GNUNET_assert (NULL ==
GNUNET_HELLO_iterate_addresses (msg1, GNUNET_NO, &check_addr,
&i));
#if VERBOSE
- fprintf (stderr, "Testing HELLO creation (with one address)...\n");
+ FPRINTF (stderr, "%s", "Testing HELLO creation (with one address)...\n");
#endif
i = 1;
msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2));
#if VERBOSE
- fprintf (stderr, "Testing address iteration (one address)...\n");
+ FPRINTF (stderr, "%s", "Testing address iteration (one address)...\n");
#endif
i = 1;
GNUNET_assert (NULL ==
GNUNET_assert (i == 0);
#if VERBOSE
- fprintf (stderr, "Testing get_key from HELLO...\n");
+ FPRINTF (stderr, "%s", "Testing get_key from HELLO...\n");
#endif
GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk));
GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk)));
GNUNET_free (msg1);
#if VERBOSE
- fprintf (stderr, "Testing HELLO creation (with two addresses)...\n");
+ FPRINTF (stderr, "%s", "Testing HELLO creation (with two addresses)...\n");
#endif
i = 2;
msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i);
GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3));
#if VERBOSE
- fprintf (stderr, "Testing address iteration (two addresses)...\n");
+ FPRINTF (stderr, "%s", "Testing address iteration (two addresses)...\n");
#endif
i = 3;
GNUNET_assert (NULL ==
GNUNET_assert (i == 0);
#if VERBOSE
- fprintf (stderr, "Testing HELLO merge...\n");
+ FPRINTF (stderr, "%s", "Testing HELLO merge...\n");
#endif
msg1 = GNUNET_HELLO_merge (msg2, msg3);
GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3));
GNUNET_free (msg1);
#if VERBOSE
- fprintf (stderr, "Testing address iteration to copy HELLO...\n");
+ FPRINTF (stderr, "%s", "Testing address iteration to copy HELLO...\n");
#endif
i = 2;
msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i);
GNUNET_free (msg1);
#if VERBOSE
- fprintf (stderr, "Testing delta address iteration...\n");
+ FPRINTF (stderr, "%s", "Testing delta address iteration...\n");
#endif
i = 2;
GNUNET_HELLO_iterate_new_addresses (msg3, msg2, startup_time, &check_addr,
if (peer == NULL)
return;
#if VERBOSE
- fprintf (stderr, "Peer %s connected\n", GNUNET_i2s (peer));
+ FPRINTF (stderr, "Peer %s connected\n", GNUNET_i2s (peer));
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n");
ok = 0;
ret = check ();
if (ret == 0)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
/* now do it again */
ret = check ();
- fprintf (stderr, ".\n");
+ FPRINTF (stderr, "%s", ".\n");
}
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
uint16_t i;
for (i = 0; i < level; i++)
- fprintf (stderr, " ");
+ FPRINTF (stderr, "%s", " ");
if (n->status == MESH_PEER_READY)
- fprintf (stderr, "#");
+ FPRINTF (stderr, "%s", "#");
if (n->status == MESH_PEER_SEARCHING)
- fprintf (stderr, "+");
+ FPRINTF (stderr, "%s", "+");
if (n->status == MESH_PEER_RELAY)
- fprintf (stderr, "-");
+ FPRINTF (stderr, "%s", "-");
if (n->status == MESH_PEER_RECONNECTING)
- fprintf (stderr, "*");
+ FPRINTF (stderr, "%s", "*");
GNUNET_PEER_resolve (n->peer, &id);
- fprintf (stderr, "%s, [%u, %p] ", GNUNET_i2s (&id), n->peer, n);
+ FPRINTF (stderr, "%s, [%u, %p] ", GNUNET_i2s (&id), n->peer, n);
if (NULL != n->parent)
{
GNUNET_PEER_resolve (n->parent->peer, &id);
- fprintf (stderr, "(-> %s [%u])\n", GNUNET_i2s (&id), n->parent->peer);
+ FPRINTF (stderr, "(-> %s [%u])\n", GNUNET_i2s (&id), n->parent->peer);
}
else
- fprintf (stderr, "(root)\n");
+ FPRINTF (stderr, "%s", "(root)\n");
for (c = n->children_head; NULL != c; c = c->next)
tree_node_debug (c, level + 1);
}
if ((args[0] == NULL) || (1 != SSCANF (args[0], "%u", &port)) || (0 == port)
|| (65536 <= port))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_
("Please pass valid port number as the first argument! (got `%s')\n"),
args[0]);
struct NSEPeer *pos;
#if VERBOSE
- fprintf (stderr, "Ending test.\n");
+ FPRINTF (stderr, "%s", "Ending test.\n");
#endif
if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_free (output_buffer);
}
else
- fprintf (stderr,
+ FPRINTF (stderr,
"Received network size estimate from peer %s. Size: %f std.dev. %f\n",
GNUNET_i2s (&peer->daemon->id), estimate, std_dev);
{
int *ok = cls;
- fprintf (stderr,
+ FPRINTF (stderr,
"Received NSE message, estimate %f, standard deviation %f.\n",
estimate, std_dev);
/* Fantastic check below. Expect NaN, the only thing not equal to itself. */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping arm.\n");
stop_arm (&p1);
if (0 != ok)
- fprintf (stderr, "No information received from NSE service!\n");
+ FPRINTF (stderr, "%s", "No information received from NSE service!\n");
return ok;
}
struct NSEPeer *pos;
#if VERBOSE
- fprintf (stderr, "Ending test.\n");
+ FPRINTF (stderr, "%s", "Ending test.\n");
#endif
while (NULL != (pos = peer_head))
{
struct NSEPeer *peer = cls;
- fprintf (stderr,
+ FPRINTF (stderr,
"Received network size estimate from peer %s. logSize: %f std.dev. %f (%f/%u)\n",
GNUNET_i2s (&peer->daemon->id), estimate, std_dev,
GNUNET_NSE_log_estimate_to_n (estimate), num_peers);
unsigned int i;
#if VERBOSE
- fprintf (stderr, "TEST_NSE_MULTIPEER: connecting to nse service of peers\n");
+ FPRINTF (stderr, "%s", "TEST_NSE_MULTIPEER: connecting to nse service of peers\n");
#endif
for (i = 0; i < num_peers; i++)
{
if (peer == NULL)
{
if (err_msg != NULL)
- fprintf (stderr, _("Error in communication with PEERINFO service\n"));
+ FPRINTF (stderr, "%s", _("Error in communication with PEERINFO service\n"));
GNUNET_PEERINFO_disconnect (peerinfo);
return;
}
cfg = c;
if (args[0] != NULL)
{
- fprintf (stderr, _("Invalid command line argument `%s'\n"), args[0]);
+ FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]);
return;
}
if (get_self != GNUNET_YES)
peerinfo = GNUNET_PEERINFO_connect (cfg);
if (peerinfo == NULL)
{
- fprintf (stderr, _("Could not access PEERINFO service. Exiting.\n"));
+ FPRINTF (stderr, "%s", _("Could not access PEERINFO service. Exiting.\n"));
return;
}
GNUNET_PEERINFO_iterate (peerinfo, NULL,
GNUNET_CONFIGURATION_get_value_filename (cfg, "GNUNETD", "HOSTKEY",
&fn))
{
- fprintf (stderr, _("Could not find option `%s:%s' in configuration.\n"),
+ FPRINTF (stderr, _("Could not find option `%s:%s' in configuration.\n"),
"GNUNETD", "HOSTKEYFILE");
return;
}
priv = GNUNET_CRYPTO_rsa_key_create_from_file (fn);
if (priv == NULL)
{
- fprintf (stderr, _("Loading hostkey from `%s' failed.\n"), fn);
+ FPRINTF (stderr, _("Loading hostkey from `%s' failed.\n"), fn);
GNUNET_free (fn);
return;
}
#if DEBUG
if (addrlen > 0)
{
- fprintf (stderr, "name: %s, addr: %s\n", tname, (const char *) addr);
+ FPRINTF (stderr, "name: %s, addr: %s\n", tname, (const char *) addr);
}
#endif
return GNUNET_OK;
if (peer == NULL)
{
#if DEBUG
- fprintf (stderr, "Process received NULL response\n");
+ FPRINTF (stderr, "Process received NULL response\n");
#endif
}
else
{
#if DEBUG
- fprintf (stderr, "Processed a peer\n");
+ FPRINTF (stderr, "Processed a peer\n");
#endif
numpeers++;
if (0 && (hello != NULL))
GNUNET_assert (NULL != proc);
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
"perf-peerinfo-api", "nohelp", options, &run, &ok);
- fprintf (stderr, "Received %u/%u calls before timeout\n", numpeers,
+ FPRINTF (stderr, "Received %u/%u calls before timeout\n", numpeers,
NUM_REQUESTS * NUM_REQUESTS / 2);
GAUGER ("PEERINFO", "Peerinfo lookups", numpeers / 30, "peers/s");
#if START_SERVICE
if (success != GNUNET_OK)
{
- fprintf (stderr, _("Failed to obtain statistics.\n"));
+ FPRINTF (stderr, _("Failed to obtain statistics.\n"),NULL);
ret = 1;
}
if (h != NULL)
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
{
if (outfile != NULL)
{
- fprintf (outfile, "\t\"%s\" -- ", GNUNET_i2s (first));
- fprintf (outfile, "\"%s\";\n", GNUNET_i2s (second));
+ FPRINTF (outfile, "\t\"%s\" -- ", GNUNET_i2s (first));
+ FPRINTF (outfile, "\"%s\";\n", GNUNET_i2s (second));
}
topology_connections++;
}
else
{
- fprintf (stderr,
+ FPRINTF (stderr,
"Finished iterating over topology, %d total connections!\n",
topology_connections);
if (outfile != NULL)
{
- fprintf (outfile, "}\n");
+ FPRINTF (outfile, "%s", "}\n");
fclose (outfile);
GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
}
if ((total_messages_received) % modnum == 0)
{
if (total_messages_received == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) total_messages_received / expected_messages) *
100));
}
else if (total_messages_received % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (total_messages_received == expected_messages)
{
#if VERBOSE
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
GNUNET_SCHEDULER_cancel (die_task);
GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
GNUNET_free (dotOutFileNameFinished);
if (dotOutFileFinished != NULL)
{
- fprintf (dotOutFileFinished, "strict graph G {\n");
+ FPRINTF (dotOutFileFinished, "%s", "strict graph G {\n");
}
topology_connections = 0;
GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished);
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
}
if ((total_connections) % modnum == 0)
{
if (total_connections == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) total_connections / expected_connections) *
100));
}
else if (total_connections % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
expected_messages++;
if (dotOutFile != NULL)
- fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
second_daemon->shortname);
}
#if VERBOSE
if (total_connections == expected_connections)
{
#if VERBOSE
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_NO_TASK;
#if DELAY_FOR_LOGGING
- fprintf (stdout, "Sending test messages in 10 seconds.\n");
+ FPRINTF (stdout, "%s", "Sending test messages in 10 seconds.\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 10),
&send_test_messages, test_messages);
test_messages);
#endif
#if VERBOSE
- fprintf (stdout, "Test message progress: [");
+ FPRINTF (stdout, "%s", "Test message progress: [");
#endif
}
modnum = expected_connections / 4;
dotnum = (expected_connections / 50) + 1;
#if VERBOSE
- fprintf (stdout, "Peer connection progress: [");
+ FPRINTF (stdout, "%s", "Peer connection progress: [");
#endif
}
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Topology set up, now starting peers!\n");
- fprintf (stdout, "Daemon start progress [");
+ FPRINTF (stdout, "%s", "Daemon start progress [");
#endif
GNUNET_TESTING_daemons_continue_startup (pg);
}
if ((num_peers - peers_left) % modnum == 0)
{
if (num_peers - peers_left == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) (num_peers - peers_left) / num_peers) * 100));
}
else if ((num_peers - peers_left) % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (peers_left == 0)
{
#if VERBOSE
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_SCHEDULER_add_delayed (timeout, &end_badly,
"from peers_started_callback");
#if DELAY_FOR_LOGGING
- fprintf (stdout, "Connecting topology in 10 seconds\n");
+ FPRINTF (stdout, "%s", "Connecting topology in 10 seconds\n");
gather_log_data ();
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 10),
if ((num_peers - peers_left) % modnum == 0)
{
if (num_peers - peers_left == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) (num_peers - peers_left) / num_peers) * 100));
}
else if ((num_peers - peers_left) % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (peers_left == 0)
{
#if VERBOSE
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"All %d hostkeys created, now creating topology!\n", num_peers);
#endif
dotOutFile = fopen (dotOutFileName, "w");
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "strict graph G {\n");
+ FPRINTF (dotOutFile, "%s", "strict graph G {\n");
}
#if VERBOSE
modnum = num_peers / 4;
dotnum = (num_peers / 50) + 1;
#if VERBOSE
- fprintf (stdout, "Hostkey generation progress: [");
+ FPRINTF (stdout, "%s", "Hostkey generation progress: [");
#endif
/* Set up a task to end testing if peer start fails */
die_task =
{
if (phase < NUM_PHASES)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
run_phase ();
return;
}
- fprintf (stderr, ".\n");
+ FPRINTF (stderr, "%s", ".\n");
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Both daemons terminated, will now exit.\n");
{
cc = NULL;
#if VERBOSE
- fprintf (stderr, "Peer %s ", GNUNET_i2s (first));
- fprintf (stderr, "connected to %s\n", GNUNET_i2s (second));
+ FPRINTF (stderr, "Peer %s ", GNUNET_i2s (first));
+ FPRINTF (stderr, "connected to %s\n", GNUNET_i2s (second));
#endif
GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
}
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
- fclose (dotOutFile);
+ FPRINTF (dotOutFile, "%s", "}");
+ FCLOSE (dotOutFile);
}
ok = 0;
{
if (outfile != NULL)
{
- fprintf (outfile, "\t\"%s\" -- ", GNUNET_i2s (first));
- fprintf (outfile, "\"%s\";\n", GNUNET_i2s (second));
+ FPRINTF (outfile, "\t\"%s\" -- ", GNUNET_i2s (first));
+ FPRINTF (outfile, "\"%s\";\n", GNUNET_i2s (second));
}
topology_connections++;
}
else
{
- fprintf (stderr,
+ FPRINTF (stderr,
"Finished iterating over topology, %d total connections!\n",
topology_connections);
if (outfile != NULL)
{
- fprintf (outfile, "}\n");
+ FPRINTF (outfile, "%s", "}\n");
fclose (outfile);
#if DO_STATS
GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, NULL);
if ((total_messages_received) % modnum == 0)
{
if (total_messages_received == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) total_messages_received / expected_messages) *
100));
}
else if (total_messages_received % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (total_messages_received == expected_messages)
{
#if PROGRESS_BARS
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
GNUNET_SCHEDULER_cancel (die_task);
GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
GNUNET_free (dotOutFileNameFinished);
if (dotOutFileFinished != NULL)
{
- fprintf (dotOutFileFinished, "strict graph G {\n");
+ FPRINTF (dotOutFileFinished, "%s", "strict graph G {\n");
}
topology_connections = 0;
GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished);
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
}
if ((total_connections) % modnum == 0)
{
if (total_connections == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) total_connections / expected_connections) *
100));
}
else if (total_connections % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
expected_messages++;
if (dotOutFile != NULL)
- fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
second_daemon->shortname);
}
#if VERBOSE
if (total_connections == expected_connections)
{
#if PROGRESS_BARS
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_NO_TASK;
#if DELAY_FOR_LOGGING
- fprintf (stdout, "Sending test messages in 10 seconds.\n");
+ FPRINTF (stdout, "%s", "Sending test messages in 10 seconds.\n");
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 10),
&send_test_messages, test_messages);
test_messages);
#endif
#if PROGRESS_BARS
- fprintf (stdout, "Test message progress: [");
+ FPRINTF (stdout, "%s", "Test message progress: [");
#endif
}
if (dotnum == 0)
dotnum = 1;
#if PROGRESS_BARS
- fprintf (stdout, "Peer connection progress: [");
+ FPRINTF (stdout, "%s", "Peer connection progress: [");
#endif
}
#if PROGRESS_BARS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Topology set up, now starting peers!\n");
- fprintf (stdout, "Daemon start progress [");
+ FPRINTF (stdout, "%s", "Daemon start progress [");
#endif
GNUNET_TESTING_daemons_continue_startup (pg);
}
if ((num_peers - peers_left) % modnum == 0)
{
if (num_peers - peers_left == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) (num_peers - peers_left) / num_peers) * 100));
}
else if ((num_peers - peers_left) % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (peers_left == 0)
{
#if PROGRESS_BARS
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
#endif
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
(GNUNET_TIME_UNIT_MINUTES, 8), &end_badly,
"from peers_started_callback");
#if DELAY_FOR_LOGGING
- fprintf (stdout, "Connecting topology in 10 seconds\n");
+ FPRINTF (stdout, "%s", "Connecting topology in 10 seconds\n");
gather_log_data ();
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 10),
if ((num_peers - peers_left) % modnum == 0)
{
if (num_peers - peers_left == 0)
- fprintf (stdout, "0%%");
+ FPRINTF (stdout, "%s", "0%%");
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) (num_peers - peers_left) / num_peers) * 100));
}
else if ((num_peers - peers_left) % dotnum == 0)
{
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
}
fflush (stdout);
#endif
if (peers_left == 0)
{
#if PROGRESS_BARS
- fprintf (stdout, "100%%]\n");
+ FPRINTF (stdout, "%s", "100%%]\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"All %d hostkeys created, now creating topology!\n", num_peers);
#endif
dotOutFile = fopen (dotOutFileName, "w");
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "strict graph G {\n");
+ FPRINTF (dotOutFile, "%s", "strict graph G {\n");
}
#if VERBOSE
if (dotnum == 0)
dotnum = 1;
#if PROGRESS_BARS
- fprintf (stdout, "Hostkey generation progress: [");
+ FPRINTF (stdout, "%s", "Hostkey generation progress: [");
#endif
/* Set up a task to end testing if peer start fails */
die_task =
#endif
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "}");
+ FPRINTF (dotOutFile, "%s", "}");
fclose (dotOutFile);
}
}
first_daemon->shortname, second_daemon->shortname);
#endif
if (dotOutFile != NULL)
- fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
+ FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname,
second_daemon->shortname);
}
dotOutFile = fopen (dotOutFileName, "w");
if (dotOutFile != NULL)
{
- fprintf (dotOutFile, "strict graph G {\n");
+ FPRINTF (dotOutFile, "%s", "strict graph G {\n");
}
#if VERBOSE
{
if (meter->completed == 0)
{
- fprintf (stdout, "%sProgress: [0%%", meter->startup_string);
+ FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string);
}
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) meter->completed / meter->total) * 100));
}
else if (meter->completed % meter->dotnum == 0)
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
if (meter->completed + 1 == meter->total)
- fprintf (stdout, "%d%%]\n", 100);
+ FPRINTF (stdout, "%d%%]\n", 100);
fflush (stdout);
}
meter->completed++;
temppeer = &peer->id;
GNUNET_CRYPTO_hash_to_enc (&temppeer->hashPubKey, &peer_enc);
- fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc);
+ FPRINTF (temp_friend_handle, "%s\n", (char *) &peer_enc);
return GNUNET_YES;
}
GNUNET_CRYPTO_hash_to_enc (&temppeer->hashPubKey, &peer_enc);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Writing entry %s:%s to file\n",
blacklist_ctx->transport, (char *) &peer_enc);
- fprintf (blacklist_ctx->temp_file_handle, "%s:%s\n", blacklist_ctx->transport,
+ FPRINTF (blacklist_ctx->temp_file_handle, "%s:%s\n", blacklist_ctx->transport,
(char *) &peer_enc);
return GNUNET_YES;
{
GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->
id.hashPubKey, &peer_enc);
- fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc);
+ FPRINTF (temp_friend_handle, "%s\n", (char *) &peer_enc);
conn_iter = conn_iter->next;
}
#else
{
GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->
id.hashPubKey, &peer_enc);
- fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc);
+ FPRINTF (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc);
conn_iter = conn_iter->next;
}
#else
{
if (meter->completed == 0)
{
- fprintf (stdout, "%sProgress: [0%%", meter->startup_string);
+ FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string);
}
else
- fprintf (stdout, "%d%%",
+ FPRINTF (stdout, "%d%%",
(int) (((float) meter->completed / meter->total) * 100));
}
else if (meter->completed % meter->dotnum == 0)
- fprintf (stdout, ".");
+ FPRINTF (stdout, "%s", ".");
if (meter->completed + 1 == meter->total)
- fprintf (stdout, "%d%%]\n", 100);
+ FPRINTF (stdout, "%d%%]\n", 100);
fflush (stdout);
}
meter->completed++;
*cc = NULL;
if (NULL != emsg)
{
- fprintf (stderr, "Failed to connect two peers: %s\n", emsg);
+ FPRINTF (stderr, "Failed to connect two peers: %s\n", emsg);
for (i = 0; i < NUM_PEERS; i++)
if (NULL != cc[i])
{
char *cfg_file_p2;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
if (argc < 3)
{
- fprintf (stderr,
+ FPRINTF (stderr,
"usage gnunet-transport-connect-running-peers <cfg_peer1> <cfg_peer2>\n");
return -1;
}
{
if (GNUNET_YES != result)
{
- fprintf (stderr, "Configuration for plugin `%s' did not work!\n", tc->name);
+ FPRINTF (stderr, "Configuration for plugin `%s' did not work!\n", tc->name);
}
else
{
- fprintf (stderr, "Configuration for plugin `%s' is working!\n", tc->name);
+ FPRINTF (stderr, "Configuration for plugin `%s' is working!\n", tc->name);
}
if (GNUNET_SCHEDULER_NO_TASK != tc->tsk)
{
GNUNET_CONFIGURATION_get_value_string (cfg, "transport", "plugins",
&plugins))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_
- ("No transport plugins configured, peer will never communicate\n"));
+ ("No transport plugins configured, peer will never communicate\n"), NULL);
ret = 4;
return;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg, section, "PORT", &bnd_port))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_("No port configured for plugin `%s', cannot test it\n"), tok);
continue;
}
if (benchmark_receive)
{
duration = GNUNET_TIME_absolute_get_duration (start_time);
- fprintf (stdout, _("Received %llu bytes/s (%llu bytes in %llu ms)\n"),
+ FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %llu ms)\n"),
1000 * traffic_received / (1 + duration.rel_value),
traffic_received, (unsigned long long) duration.rel_value);
}
if (benchmark_send)
{
duration = GNUNET_TIME_absolute_get_duration (start_time);
- fprintf (stdout, _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"),
+ FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"),
1000 * traffic_sent / (1 + duration.rel_value), traffic_sent,
(unsigned long long) duration.rel_value);
}
GNUNET_TIME_UNIT_FOREVER_REL,
&transmit_data, NULL);
if (verbosity > 0)
- fprintf (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size,
+ FPRINTF (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size,
GNUNET_i2s (&pid));
return size;
}
const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
{
if (verbosity > 0)
- fprintf (stdout, _("Connected to %s\n"), GNUNET_i2s (peer));
+ FPRINTF (stdout, _("Connected to %s\n"), GNUNET_i2s (peer));
if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity)))
return;
ret = 0;
notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
if (verbosity > 0)
- fprintf (stdout, _("Disconnected from %s\n"), GNUNET_i2s (peer));
+ FPRINTF (stdout, _("Disconnected from %s\n"), GNUNET_i2s (peer));
if ((0 == memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) &&
(NULL != th))
{
if (!benchmark_receive)
return;
if (verbosity > 0)
- fprintf (stdout, _("Received %u bytes from %s\n"),
+ FPRINTF (stdout, _("Received %u bytes from %s\n"),
(unsigned int) ntohs (message->size), GNUNET_i2s (peer));
if (traffic_received == 0)
start_time = GNUNET_TIME_absolute_get ();
if ((address != NULL))
{
- fprintf (stdout, _("Peer `%s': %s %s\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name, address);
+ FPRINTF (stdout, _("Peer `%s': %s %s\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name, address);
}
else
{
}
if (benchmark_send && (NULL == cpid))
{
- fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
+ FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"),
"-s", "-C");
return;
}
ret = 1;
if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (cpid, &pid.hashPubKey))
{
- fprintf (stderr, _("Failed to parse peer identity `%s'\n"), cpid);
+ FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid);
return;
}
handle =
*/
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
datarate = (total_bytes_sent * 1000) / delta;
- fprintf (stderr, "Throughput was %llu b/s\n", datarate);
+ FPRINTF (stderr, "Throughput was %llu b/s\n", datarate);
test_failed = GNUNET_NO;
if (datarate > quota_in_p2)
total_bytes_sent += ret;
if (n == TOTAL_MSGS)
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages sent\n");
}
return ret;
counter++;
if ((DURATION.rel_value / 1000) < counter)
{
- fprintf (stderr, ".\n");
+ FPRINTF (stderr, "%s", ".\n");
GNUNET_SCHEDULER_add_now (&end, NULL);
}
else
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
measure_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &measure, NULL);
}
char *cfg_file_p2;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
char *cfg_file_p2;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
char *cfg_file_p2;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
char *cfg_file_p2;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
*/
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
- fprintf (stderr, "\nThroughput was %llu kb/s\n",
+ FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
total_bytes * 1000 / 1024 / delta);
GNUNET_asprintf (&value_name, "reliable_%s", test_plugin);
GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta),
n++;
if (0 == (n % (TOTAL_MSGS / 100)))
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (die_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
total_bytes += ret;
if (n == TOTAL_MSGS)
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages sent\n");
}
return ret;
static int restarted;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
static int restarted;
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
if (time_running.rel_value ==
GNUNET_TIME_relative_max (time_running, WAIT).rel_value)
{
- fprintf (stderr, "100%%\n");
+ FPRINTF (stderr, "%s", "100%%\n");
shutdown_flag = GNUNET_YES;
GNUNET_SCHEDULER_add_now (&end, NULL);
}
else
{
- fprintf (stderr, "%u%%..", percentage);
+ FPRINTF (stderr, "%u%%..", percentage);
timer_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide (WAIT, 10),
&timer, NULL);
*/
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
- fprintf (stderr, "\nThroughput was %llu kb/s\n",
+ FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
total_bytes * 1000 / 1024 / delta);
GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin);
GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta),
test_sending = GNUNET_YES;
if (0 == (n % (TOTAL_MSGS / 100)))
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
}
else
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent\n");
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
*/
#if VERBOSE
-#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
+#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
#else
#define OKPP do { ok++; } while (0)
#endif
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
- fprintf (stderr, "\nThroughput was %llu kb/s\n",
+ FPRINTF (stderr, "\nThroughput was %llu kb/s\n",
total_bytes * 1000 / 1024 / delta);
GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin);
GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta),
n++;
if (0 == (n % (TOTAL_MSGS / 100)))
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SCHEDULER_NO_TASK != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_failed = GNUNET_YES;
{
/* because of starting with 0 */
msg_recv++;
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
end ();
}
}
}
else
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"All messages scheduled to be sent!!\n");
if (GNUNET_SCHEDULER_NO_TASK != die_task)
timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
i = 1;
- fprintf (stderr, "%i", i);
+ FPRINTF (stderr, "%i", i);
while (i <= ITERATIONS)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n");
i++;
if (i <= ITERATIONS)
- fprintf (stderr, "..%i", i);
+ FPRINTF (stderr, "..%i", i);
}
tth = GNUNET_TRANSPORT_TESTING_init ();
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
end ();
}
if (GNUNET_stderr != NULL)
{
- fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp,
+ FPRINTF (GNUNET_stderr, "%s %s %s %s", datestr, comp,
GNUNET_error_type_to_string (kind), msg);
fflush (GNUNET_stderr);
}
sec = cfg->sections;
while (sec != NULL)
{
- if (0 > fprintf (fp, "[%s]\n", sec->name))
+ if (0 > FPRINTF (fp, "[%s]\n", sec->name))
{
error = 1;
break;
pos[0] = '\\';
pos[1] = 'n';
}
- if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
+ if (0 > FPRINTF (fp, "%s = %s\n", ent->key, val))
{
error = 1;
GNUNET_free (val);
}
if (error != 0)
break;
- if (0 > fprintf (fp, "\n"))
+ if (0 > FPRINTF (fp, "%s\n", ""))
{
error = 1;
break;
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
if (!gcry_check_version (GCRYPT_VERSION))
{
- fprintf (stderr,
+ FPRINTF (stderr,
_
("libgcrypt has not the expected version (version %s is required).\n"),
GCRYPT_VERSION);
if (ambig && !exact)
{
if (GNopterr)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
+ FPRINTF (stderr, _("%s: option `%s' is ambiguous\n"), argv[0],
argv[GNoptind]);
nextchar += strlen (nextchar);
GNoptind++;
{
if (argv[GNoptind - 1][1] == '-')
/* --option */
- fprintf (stderr,
+ FPRINTF (stderr,
_("%s: option `--%s' does not allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
- fprintf (stderr,
+ FPRINTF (stderr,
_("%s: option `%c%s' does not allow an argument\n"),
argv[0], argv[GNoptind - 1][0], pfound->name);
}
{
if (GNopterr)
{
- fprintf (stderr, _("%s: option `%s' requires an argument\n"),
+ FPRINTF (stderr, _("%s: option `%s' requires an argument\n"),
argv[0], argv[GNoptind - 1]);
}
nextchar += strlen (nextchar);
{
if (argv[GNoptind][1] == '-')
/* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0],
+ FPRINTF (stderr, _("%s: unrecognized option `--%s'\n"), argv[0],
nextchar);
else
/* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0],
+ FPRINTF (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0],
argv[GNoptind][0], nextchar);
}
nextchar = (char *) "";
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
+ FPRINTF (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
else
- fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
+ FPRINTF (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
}
return '?';
}
if (GNopterr)
{
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ FPRINTF (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
if (optstring[0] == ':')
if (ambig && !exact)
{
if (GNopterr)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0],
+ FPRINTF (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0],
argv[GNoptind]);
nextchar += strlen (nextchar);
GNoptind++;
else
{
if (GNopterr)
- fprintf (stderr, _("\
+ FPRINTF (stderr, _("\
%s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name);
nextchar += strlen (nextchar);
else
{
if (GNopterr)
- fprintf (stderr, _("%s: option `%s' requires an argument\n"),
+ FPRINTF (stderr, _("%s: option `%s' requires an argument\n"),
argv[0], argv[GNoptind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
if (GNopterr)
{
/* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ FPRINTF (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
if (optstring[0] == ':')
}
if (i == count)
{
- fprintf (stderr, _("Use --help to get a list of options.\n"));
+ FPRINTF (stderr, _("Use %s to get a list of options.\n"), "--help");
cont = GNUNET_SYSERR;
}
}
if (1 != SSCANF (value, "%llu", val))
{
- fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option);
+ FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option);
return GNUNET_SYSERR;
}
return GNUNET_OK;
if (1 != SSCANF (value, "%u", val))
{
- fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option);
+ FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option);
return GNUNET_SYSERR;
}
return GNUNET_OK;
err = lt_dlinit ();
if (err > 0)
{
- fprintf (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
+ FPRINTF (stderr, _("Initialization of plugin mechanism failed: %s!\n"),
lt_dlerror ());
return;
}
GNUNET_log_setup ("test-common-allocation", "WARNING", NULL);
ret = check ();
if (ret != 0)
- fprintf (stderr, "ERROR %d.\n", ret);
+ FPRINTF (stderr, "ERROR %d.\n", ret);
return ret;
}
unsigned int logs = 0;
if (0 != putenv ("GNUNET_FORCE_LOG="))
- fprintf (stderr, "Failed to putenv: %s\n", strerror (errno));
+ FPRINTF (stderr, "Failed to putenv: %s\n", strerror (errno));
GNUNET_log_setup ("test-common-logging", "DEBUG", "/dev/null");
GNUNET_logger_add (&my_log, &logs);
GNUNET_logger_add (&my_log, &logs);
GNUNET_logger_remove (&my_log, &logs);
if (logs != 4)
{
- fprintf (stdout, "Expected 4 log calls, got %u\n", logs);
+ FPRINTF (stdout, "Expected 4 log calls, got %u\n", logs);
failureCount++;
}
GNUNET_break (0 ==
GNUNET_logger_remove (&my_log, &logs);
if (logs != 1)
{
- fprintf (stdout, "Expected 1 log call, got %u\n", logs);
+ FPRINTF (stdout, "Expected 1 log call, got %u\n", logs);
failureCount++;
}
if (failureCount != 0)
{
- fprintf (stdout, "%u TESTS FAILED!\n", failureCount);
+ FPRINTF (stdout, "%u TESTS FAILED!\n", failureCount);
return -1;
}
return 0;
{
if (strncmp ("test-common-logging-dummy", component, 25) != 0)
return;
- fprintf (stdout, "%s", msg);
+ FPRINTF (stdout, "%s", msg);
fflush (stdout);
}
buf_ptr += rd;
bytes += rd;
#if VERBOSE
- fprintf (stderr, "got %d bytes, reading more\n", rd);
+ FPRINTF (stderr, "got %d bytes, reading more\n", rd);
#endif
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
stdout_read_handle, &read_call,
}
#if VERBOSE
- fprintf (stderr, "bytes is %d:%s\n", bytes, buf);
+ FPRINTF (stderr, "bytes is %d:%s\n", bytes, buf);
#endif
/* +------CHILD OUTPUT--
&delays[7], level)))
{
if (bytes == 20 * 16)
- fprintf (stderr, "Ran out of buffer space!\n");
+ FPRINTF (stderr, "%s", "Ran out of buffer space!\n");
GNUNET_break (0);
ok = 2;
GNUNET_SCHEDULER_cancel (die_task);
GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData);
if (1 == (ret = cbData.status))
{
- fprintf (stderr,
+ FPRINTF (stderr, "%s",
"Incorrect Configuration Diffs: Diffs may contain data not actually edited\n");
goto housekeeping;
}
cbData.cfgDiffs = cfg;
GNUNET_CONFIGURATION_iterate (cfgDiffs, diffsCallBack, &cbData);
if ((ret = cbData.status) == 1)
- fprintf (stderr,
+ FPRINTF (stderr, "%s",
"Incorrect Configuration Diffs: Data may be missing in diffs\n");
housekeeping:
return 1;
if (0 != strcmp ("b", c))
{
- fprintf (stderr, "Got `%s'\n", c);
+ FPRINTF (stderr, "Got `%s'\n", c);
GNUNET_free (c);
return 2;
}
if (GNUNET_OK !=
GNUNET_CONFIGURATION_parse (cfg, "test_configuration_data.conf"))
{
- fprintf (stderr, "Failed to parse configuration file\n");
+ FPRINTF (stderr, "%s", "Failed to parse configuration file\n");
GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, "/tmp/gnunet-test.conf"))
{
- fprintf (stderr, "Failed to write configuration file\n");
+ FPRINTF (stderr, "%s", "Failed to write configuration file\n");
GNUNET_CONFIGURATION_destroy (cfg);
return 1;
}
error:
if (failureCount != 0)
{
- fprintf (stderr, "Test failed: %u\n", failureCount);
+ FPRINTF (stderr, "Test failed: %u\n", failureCount);
return 1;
}
return 0;
{
if (number_of_runs % 1000 == 0)
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
/*printf("Got to run number %d.\n", number_of_runs); */
GNUNET_CRYPTO_aes_create_session_key (&sessionkey);
int i;
char out[3];
- fprintf (stderr, "Testing KBlock key correctness");
+ FPRINTF (stderr, "%s", "Testing KBlock key correctness");
GNUNET_CRYPTO_hash ("X", strlen ("X"), &in);
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
snprintf (out, sizeof (out), "%02x", ((unsigned char *) &pkey)[i]);
if (0 != strncmp (out, &want[i * 2], 2))
{
- fprintf (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2],
+ FPRINTF (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2],
out, i);
return GNUNET_SYSERR;
}
}
- fprintf (stderr, " OK\n");
+ FPRINTF (stderr, "%s", " OK\n");
return GNUNET_OK;
}
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey1;
int i;
- fprintf (stderr, "Testing KBlock key uniqueness (%s) ", word);
+ FPRINTF (stderr, "Testing KBlock key uniqueness (%s) ", word);
GNUNET_CRYPTO_hash (word, strlen (word), &in);
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
GNUNET_CRYPTO_rsa_key_free (hostkey);
for (i = 0; i < UNIQUE_ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in);
if (hostkey == NULL)
{
GNUNET_break (0);
- fprintf (stderr, " ERROR\n");
+ FPRINTF (stderr, "%s", " ERROR\n");
return GNUNET_SYSERR;
}
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey1);
sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded)))
{
GNUNET_break (0);
- fprintf (stderr, " ERROR\n");
+ FPRINTF (stderr, "%s", " ERROR\n");
return GNUNET_SYSERR;
}
}
- fprintf (stderr, " OK\n");
+ FPRINTF (stderr, "%s", " OK\n");
return GNUNET_OK;
}
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
ok = 0;
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
}
struct GNUNET_TIME_Absolute start;
int ok = GNUNET_OK;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose));
purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
b2 = GNUNET_CRYPTO_random_permute (mode, 1024);
if (0 == memcmp (b2, buf, sizeof (buf)))
{
- fprintf (stderr, "!");
+ FPRINTF (stderr, "%s", "!");
GNUNET_free (b2);
continue;
}
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result,
strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey,
&target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
struct GNUNET_TIME_Absolute start;
int ok;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
GNUNET_CRYPTO_aes_create_session_key (&insk);
if (GNUNET_SYSERR ==
GNUNET_CRYPTO_rsa_encrypt (&insk,
sizeof (struct GNUNET_CRYPTO_AesSessionKey),
&pkey, &target))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n");
ok++;
continue;
}
GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, &outsk,
sizeof (struct GNUNET_CRYPTO_AesSessionKey)))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n");
ok++;
continue;
}
struct GNUNET_TIME_Absolute start;
int ok = GNUNET_OK;
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose));
purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
- fprintf (stderr, "W");
+ FPRINTF (stderr, "%s", "W");
hostkey = GNUNET_CRYPTO_rsa_key_create ();
GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey);
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < ITER; i++)
{
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig))
{
- fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
+ FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n");
ok = GNUNET_SYSERR;
continue;
}
ret = GNUNET_DISK_fn_read (".testfile", tmp, sizeof (tmp) - 1);
if (ret < 0)
{
- fprintf (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile");
+ FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile");
return 1;
}
tmp[ret] = '\0';
if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
+ FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
TESTSTRING, ".testfile");
return 1;
}
ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1);
if (ret < 0)
{
- fprintf (stderr, "Error reading file `%s' in testReadWrite\n",
+ FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n",
".testfile2");
return 1;
}
tmp[ret] = '\0';
if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1))
{
- fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
+ FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp,
TESTSTRING, ".testfile2");
return 1;
}
failureCount += testDirMani ();
if (failureCount != 0)
{
- fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount);
+ FPRINTF (stderr, "\n%u TESTS FAILED!\n", failureCount);
return -1;
}
return 0;
bytes = GNUNET_DISK_file_read (stdout_read_handle, &buf, sizeof (buf));
#if VERBOSE
- fprintf (stderr, "bytes is %d\n", bytes);
+ FPRINTF (stderr, "bytes is %d\n", bytes);
#endif
if (bytes < 1)
ok = strncmp (&buf[0], test_phrase, strlen (test_phrase));
#if VERBOSE
- fprintf (stderr, "read %s\n", &buf[0]);
+ FPRINTF (stderr, "read %s\n", &buf[0]);
#endif
if (ok == 0)
{
pid = GNUNET_PEER_intern (&pidArr[i]);
if (pid != (i + 1))
{
- fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
+ FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n");
return 1;
}
}
pid = GNUNET_PEER_intern (&pidArr[i]);
if (pid != (i + 1))
{
- fprintf (stderr, "Unexpected Peer ID returned by intern function\n");
+ FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n");
return 1;
}
}
_("gethostbyname() could not lookup IP address: %s\n"),
hstrerror (h_errno));
#endif
- fprintf (stderr,
- "System seems to be off-line, will not run all DNS tests\n");
+ FPRINTF (stderr,
+ "System seems to be off-line, will not run all DNS tests\n", NULL);
*ok = 0; /* mark test as passing anyway */
return;
}
GNUNET_OS_process_close (proc);
proc = NULL;
if (ok != 0)
- fprintf (stderr, "Missed some resolutions: %u\n", ok);
+ FPRINTF (stderr, "Missed some resolutions: %u\n", ok);
return ok;
}
target =
GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MILLISECONDS, i));
- fprintf (stderr, ".");
+ FPRINTF (stderr, "%s", ".");
if (i > MAXV)
{
- fprintf (stderr, "\n");
+ FPRINTF (stderr, "%s", "\n");
return;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
FPRINTF (stdout, "Sleep precision: %llu ms. ",
cumDelta / 1000 / (MAXV / INCR));
if (cumDelta <= 10 * MAXV / INCR)
- fprintf (stdout, "Timer precision is excellent.\n");
+ FPRINTF (stdout, "%s", "Timer precision is excellent.\n");
else if (cumDelta <= 50 * MAXV / INCR) /* 50 ms average deviation */
- fprintf (stdout, "Timer precision is good.\n");
+ FPRINTF (stdout, "%s", "Timer precision is good.\n");
else if (cumDelta > 250 * MAXV / INCR)
- fprintf (stdout, "Timer precision is awful.\n");
+ FPRINTF (stdout, "%s", "Timer precision is awful.\n");
else
- fprintf (stdout, "Timer precision is acceptable.\n");
+ FPRINTF (stdout, "%s", "Timer precision is acceptable.\n");
return 0;
}
GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket");
return 1;
}
- fprintf (stderr,
+ FPRINTF (stderr,
"IPv6 support seems to not be available (%s), not testing it!\n",
strerror (errno));
}
* however, the "0:05 19" should always be there; hence: */
if (NULL == strstr (r, "0:05 19"))
{
- fprintf (stderr, "Got %s\n", r);
+ FPRINTF (stderr, "Got %s\n", r);
GNUNET_break (0);
GNUNET_free (r);
return 1;