- if ((total_bytes_sent/(duration.rel_value / 1000)) < 100)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota compliance failed: \n"\
- "Hard quota limit allowed: %10llu kB/s (%llu B/s)\n"\
- "Soft quota limit allowed: %10llu kB/s (%llu B/s)\n"\
- "Throughput : %10llu kB/s (%llu B/s)\n",
- (quota_allowed / (1024)), quota_allowed,
- ((quota_allowed+delta) / (1024)), quota_allowed+delta,
- (total_bytes_sent/(duration.rel_value / 1000)/1024),
- total_bytes_sent/(duration.rel_value / 1000));
- ok = 1;
- failed_measurement_counter--;
- if (failed_measurement_counter < 0)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota measurement failed and no free strike: %i\n",failed_measurement_counter);
- end();
- return;
- }
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota measurement failed and %i free strikes\n",failed_measurement_counter);
- }
-
- /* Throughput is bigger than allowed quota + some extra*/
- if ((total_bytes_sent/(duration.rel_value / 1000)) > (quota_allowed + delta))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota compliance failed: \n"\
- "Hard quota limit allowed: %10llu kB/s (%llu B/s)\n"\
- "Soft quota limit allowed: %10llu kB/s (%llu B/s)\n"\
- "Throughput : %10llu kB/s (%llu B/s)\n",
- (quota_allowed / (1024)), quota_allowed,
- ((quota_allowed+delta) / (1024)), quota_allowed+delta,
- (total_bytes_sent/(duration.rel_value / 1000)/1024),
- total_bytes_sent/(duration.rel_value / 1000));
- ok = 1;
- failed_measurement_counter--;
- if (failed_measurement_counter < 0)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota measurement failed and no free strike: %i\n",failed_measurement_counter);
- end();
- return;
- }
- else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "\nQuota measurement failed and %i free strikes\n",failed_measurement_counter);
+ if ((total_bytes_sent / (duration.rel_value / 1000)) < 100)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota compliance failed: \n"
+ "Hard quota limit allowed: %10llu kB/s (%llu B/s)\n"
+ "Soft quota limit allowed: %10llu kB/s (%llu B/s)\n"
+ "Throughput : %10llu kB/s (%llu B/s)\n",
+ (quota_allowed / (1024)), quota_allowed,
+ ((quota_allowed + delta) / (1024)), quota_allowed + delta,
+ (total_bytes_sent / (duration.rel_value / 1000) / 1024),
+ total_bytes_sent / (duration.rel_value / 1000));
+ ok = 1;
+ failed_measurement_counter--;
+ if (failed_measurement_counter < 0)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota measurement failed and no free strike: %i\n",
+ failed_measurement_counter);
+ end ();
+ return;
+ }
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota measurement failed and %i free strikes\n",
+ failed_measurement_counter);
+ }
+
+ /* Throughput is bigger than allowed quota + some extra */
+ if ((total_bytes_sent / (duration.rel_value / 1000)) >
+ (quota_allowed + delta))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota compliance failed: \n"
+ "Hard quota limit allowed: %10llu kB/s (%llu B/s)\n"
+ "Soft quota limit allowed: %10llu kB/s (%llu B/s)\n"
+ "Throughput : %10llu kB/s (%llu B/s)\n",
+ (quota_allowed / (1024)), quota_allowed,
+ ((quota_allowed + delta) / (1024)), quota_allowed + delta,
+ (total_bytes_sent / (duration.rel_value / 1000) / 1024),
+ total_bytes_sent / (duration.rel_value / 1000));
+ ok = 1;
+ failed_measurement_counter--;
+ if (failed_measurement_counter < 0)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota measurement failed and no free strike: %i\n",
+ failed_measurement_counter);
+ end ();
+ return;
+ }
+ else
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "\nQuota measurement failed and %i free strikes\n",
+ failed_measurement_counter);