[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: TRANSPORT: Fix more warnings
From: |
gnunet |
Subject: |
[gnunet] branch master updated: TRANSPORT: Fix more warnings |
Date: |
Sun, 22 Oct 2023 08:55:19 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new abfc85abc TRANSPORT: Fix more warnings
new aac61845f Merge branch 'master' of git+ssh://git.gnunet.org/gnunet
abfc85abc is described below
commit abfc85abc441d974c47bd18d2d1d5e3f14999f88
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Oct 22 08:53:18 2023 +0200
TRANSPORT: Fix more warnings
---
src/service/transport/gnunet-service-transport.c | 127 +++++++++++++----------
1 file changed, 72 insertions(+), 55 deletions(-)
diff --git a/src/service/transport/gnunet-service-transport.c
b/src/service/transport/gnunet-service-transport.c
index ec3019161..baed9989a 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -187,20 +187,20 @@
* the value chosen here might be too aggressively low!
*/
#define DELAY_WARN_THRESHOLD \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
/**
* If a DVBox could not be forwarded after this number of
* seconds we drop it.
*/
#define DV_FORWARD_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
/**
* Default value for how long we wait for reliability ack.
*/
#define DEFAULT_ACK_WAIT_DURATION \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
/**
* We only consider queues as "quality" connections when
@@ -208,53 +208,53 @@
* the latency of the queue is below this threshold.
*/
#define DV_QUALITY_RTT_THRESHOLD \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
/**
* How long do we consider a DV path valid if we see no
* further updates on it? Note: the value chosen here might be too low!
*/
#define DV_PATH_VALIDITY_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
/**
* How long do we cache backchannel (struct Backtalker) information
* after a backchannel goes inactive?
*/
#define BACKCHANNEL_INACTIVITY_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
/**
* How long before paths expire would we like to (re)discover DV paths? Should
* be below #DV_PATH_VALIDITY_TIMEOUT.
*/
#define DV_PATH_DISCOVERY_FREQUENCY \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
/**
* How long are ephemeral keys valid?
*/
#define EPHEMERAL_VALIDITY \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
/**
* How long do we keep partially reassembled messages around before giving up?
*/
#define REASSEMBLY_EXPIRATION \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 4)
/**
* What is the fastest rate at which we send challenges *if* we keep learning
* an address (gossip, DHT, etc.)?
*/
#define FAST_VALIDATION_CHALLENGE_FREQ \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 1)
/**
* What is the slowest rate at which we send challenges?
*/
#define MAX_VALIDATION_CHALLENGE_FREQ \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_DAYS, 1)
/**
* How long until we forget about historic accumulators and thus
@@ -262,7 +262,7 @@
* active connection experiences without an ACK.
*/
#define ACK_CUMMULATOR_TIMEOUT \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
/**
* What is the non-randomized base frequency at which we
@@ -280,13 +280,13 @@
* When do we forget an invalid address for sure?
*/
#define MAX_ADDRESS_VALID_UNTIL \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MONTHS, 1)
/**
* How long do we consider an address valid if we just checked?
*/
#define ADDRESS_VALIDATION_LIFETIME \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
+ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4)
/**
* What is the maximum frequency at which we do address validation?
@@ -2250,7 +2250,7 @@ struct PendingMessage
* UUID we use to identify this message in our logs.
* Generated by incrementing the "logging_uuid_gen".
*/
- unsigned long long logging_uuid;
+ uint64_t logging_uuid;
/**
* Type of the pending message.
@@ -2281,7 +2281,7 @@ struct PendingMessage
/**
* Are we sending fragments at the moment?
*/
- unsigned int frags_in_flight;
+ uint32_t frags_in_flight;
/**
* How many fragments do we have?
@@ -2950,7 +2950,7 @@ free_pending_acknowledgement (struct
PendingAcknowledgement *pa)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"remove pa from message\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "remove pa from message %llu\n",
+ "remove pa from message %" PRIu64 "\n",
pm->logging_uuid);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"remove pa from message %u\n",
@@ -3038,7 +3038,7 @@ free_pending_message (struct PendingMessage *pm)
if ((NULL != vl) && (NULL == pm->frag_parent))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Removing pm %llu\n",
+ "Removing pm %" PRIu64 "\n",
pm->logging_uuid);
GNUNET_CONTAINER_MDLL_remove (vl,
vl->pending_msg_head,
@@ -4128,7 +4128,7 @@ client_send_response (struct PendingMessage *pm)
env = GNUNET_MQ_msg (so_msg, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK);
so_msg->peer = vl->target;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Confirming transmission of <%llu> to %s\n",
+ "Confirming transmission of <%" PRIu64 "> to %s\n",
pm->logging_uuid,
GNUNET_i2s (&vl->target));
GNUNET_MQ_send (tc->mq, env);
@@ -4452,7 +4452,8 @@ queue_send_msg (struct Queue *queue,
GNUNET_log (
GNUNET_ERROR_TYPE_DEBUG,
- "Queueing %u bytes of payload for transmission <%llu> on queue %llu to
%s\n",
+ "Queueing %u bytes of payload for transmission <%" PRIu64
+ "> on queue %llu to %s\n",
(unsigned int) payload_size,
(NULL == pm) ? 0 : pm->logging_uuid,
(unsigned long long) queue->qid,
@@ -4486,7 +4487,8 @@ queue_send_msg (struct Queue *queue,
if (NULL != pm->qe)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Retransmitting message <%llu> remove pm from qe with MID:
%llu \n",
+ "Retransmitting message <%" PRIu64
+ "> remove pm from qe with MID: %llu \n",
pm->logging_uuid,
(unsigned long long) pm->qe->mid);
pm->qe->pm = NULL;
@@ -4500,7 +4502,8 @@ queue_send_msg (struct Queue *queue,
// Messages without FC or fragments can get here.
if (NULL != pm)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Message %llu (pm type %u) was not send because queue has
no capacity.\n",
+ "Message %" PRIu64
+ " (pm type %u) was not send because queue has no
capacity.\n",
pm->logging_uuid,
pm->pmt);
GNUNET_free (env);
@@ -5170,7 +5173,8 @@ check_vl_transmission (struct VirtualLink *vl)
vl->outbound_fc_window_size)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Stalled message %llu transmission on VL %s due to flow
control: %llu < %llu\n",
+ "Stalled message %" PRIu64
+ " transmission on VL %s due to flow control: %llu < %llu\n",
pm->logging_uuid,
GNUNET_i2s (&vl->target),
(unsigned long long) vl->outbound_fc_window_size,
@@ -5228,7 +5232,8 @@ check_vl_transmission (struct VirtualLink *vl)
vl_next_hop->outbound_fc_window_size)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Stalled message %llu transmission on next hop %s due
to flow control: %llu < %llu\n",
+ "Stalled message %" PRIu64
+ " transmission on next hop %s due to flow control:
%llu < %llu\n",
pm->logging_uuid,
GNUNET_i2s (&vl_next_hop->target),
(unsigned long
@@ -5262,7 +5267,7 @@ check_vl_transmission (struct VirtualLink *vl)
}
if (GNUNET_YES == elig)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Eligible message %llu of size %u to %s: %llu/%llu\n",
+ "Eligible message %" PRIu64 " of size %u to %s: %llu/%llu\n",
pm->logging_uuid,
pm->bytes_msg,
GNUNET_i2s (&vl->target),
@@ -5324,7 +5329,8 @@ handle_client_send (void *cls, const struct
OutboundMessage *obm)
pm->bytes_msg = bytes_msg;
memcpy (&pm[1], obmm, bytes_msg);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending message of type %u with %u bytes as <%llu> to %s\n",
+ "Sending message of type %u with %u bytes as <%" PRIu64
+ "> to %s\n",
ntohs (obmm->type),
bytes_msg,
pm->logging_uuid,
@@ -5500,9 +5506,9 @@ store_pi (void *cls)
dash = strchr (ale->address, '-');
dash++;
GNUNET_asprintf (&address_uri,
- "%s://%s",
- prefix,
- dash);
+ "%s://%s",
+ prefix,
+ dash);
ale->st = NULL;
expiration = GNUNET_TIME_relative_to_absolute (ale->expiration);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -6403,7 +6409,7 @@ completed_pending_message (struct PendingMessage *pm)
struct PendingMessage *pos;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Complete transmission of message %llu %u\n",
+ "Complete transmission of message %" PRIu64 " %u\n",
pm->logging_uuid,
pm->pmt);
switch (pm->pmt)
@@ -6450,7 +6456,7 @@ completed_pending_message (struct PendingMessage *pm)
case PMT_DV_BOX:
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Completed transmission of message %llu (DV Box)\n",
+ "Completed transmission of message %" PRIu64 " (DV Box)\n",
pm->logging_uuid);
if (NULL != pm->frag_parent)
{
@@ -7920,7 +7926,8 @@ forward_dv_box (struct Neighbour *next_hop,
memcpy (buf, msg_buf, msg_size);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Created pending message %llu for DV Box with next hop %s
(%u/%u)\n",
+ "Created pending message %" PRIu64
+ " for DV Box with next hop %s (%u/%u)\n",
pm->logging_uuid,
GNUNET_i2s (&next_hop->pid),
(unsigned int) num_hops,
@@ -8640,7 +8647,6 @@ handle_hello_for_incoming (void *cls,
const struct GNUNET_MessageHeader *hello,
const char *emsg)
{
- struct IncomingRequest *ir = cls;
struct GNUNET_HELLO_Builder *builder;
if (NULL != emsg)
@@ -8879,7 +8885,8 @@ handle_validation_response (
struct Queue *q;
struct Neighbour *n;
struct VirtualLink *vl;
- const struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get_monotonic
(GST_cfg);
+ const struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get_monotonic (
+ GST_cfg);
/* check this is one of our challenges */
(void) GNUNET_CONTAINER_multipeermap_get_multiple (validation_map,
@@ -9353,7 +9360,7 @@ prepare_pending_acknowledgement (struct Queue *queue,
pa->transmission_time = GNUNET_TIME_absolute_get ();
pa->message_size = pm->bytes_msg;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Waiting for ACKnowledgment `%s' for <%llu>\n",
+ "Waiting for ACKnowledgment `%s' for <%" PRIu64 ">\n",
GNUNET_uuid2s (&pa->ack_uuid.value),
pm->logging_uuid);
return pa;
@@ -9385,15 +9392,17 @@ fragment_message (struct Queue *queue,
? UINT16_MAX - sizeof(struct GNUNET_TRANSPORT_SendMessageTo)
: queue->mtu;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Fragmenting message <%llu> with size %u to %s for MTU %u\n",
+ "Fragmenting message <%" PRIu64
+ "> with size %u to %s for MTU %u\n",
pm->logging_uuid,
pm->bytes_msg,
GNUNET_i2s (&pm->vl->target),
(unsigned int) mtu);
set_pending_message_uuid (pm);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Fragmenting message %llu <%llu> with size %u to %s for MTU
%u\n",
- (unsigned long long) pm->msg_uuid.uuid,
+ "Fragmenting message %" PRIu64 " <%" PRIu64
+ "> with size %u to %s for MTU %u\n",
+ pm->msg_uuid.uuid,
pm->logging_uuid,
pm->bytes_msg,
GNUNET_i2s (&pm->vl->target),
@@ -9555,7 +9564,8 @@ reliability_box_message (struct Queue *queue,
memcpy (&msg[sizeof(rbox)], &pm[1], pm->bytes_msg);
pm->bpm = bpm;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Preparing reliability box for message <%llu> of size %d (%d) to
%s on queue %s\n",
+ "Preparing reliability box for message <%" PRIu64
+ "> of size %d (%d) to %s on queue %s\n",
pm->logging_uuid,
pm->bytes_msg,
ntohs (((const struct GNUNET_MessageHeader *) &pm[1])->size),
@@ -9681,7 +9691,8 @@ update_pm_next_attempt (struct PendingMessage *pm,
}
else
{
- double factor = (root->frag_count - 1) / root->frag_count;
+ double factor = ((double) root->frag_count - 1)
+ / (double) root->frag_count;
struct GNUNET_TIME_Relative s1;
struct GNUNET_TIME_Relative s2;
struct GNUNET_TIME_Relative plus_mean =
@@ -9799,13 +9810,14 @@ select_best_pending_from_link (struct
PendingMessageScoreContext *sc,
{
sc->frags_in_flight = GNUNET_YES;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Fragments in flight for message %llu\n",
+ "Fragments in flight for message %" PRIu64 "\n",
pos->logging_uuid);
}
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Maybe too early, because message are sorted by
next_attempt, if there are no fragments in flight.Checked message %llu\n",
+ "Maybe too early, because message are sorted by
next_attempt, if there are no fragments in flight.Checked message %"
+ PRIu64 "\n",
pos->logging_uuid);
sc->to_early = GNUNET_YES;
sc->to_early_retry_delay = GNUNET_TIME_absolute_get_remaining (
@@ -9824,7 +9836,7 @@ select_best_pending_from_link (struct
PendingMessageScoreContext *sc,
/* determine if we have to fragment, if so add fragmentation
overhead! */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "check %llu for sc->best\n",
+ "check %" PRIu64 " for sc->best\n",
pos->logging_uuid);
frag = GNUNET_NO;
if (((0 != queue->mtu) &&
@@ -9917,7 +9929,8 @@ select_best_pending_from_link (struct
PendingMessageScoreContext *sc,
if (sc_score + time_delta > pm_score)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "sc_score of %llu larger, keep sc->best %llu\n",
+ "sc_score of %" PRIu64 " larger, keep sc->best %" PRIu64
+ "\n",
pos->logging_uuid,
sc->best->logging_uuid);
continue; /* sc_score larger, keep sc->best */
@@ -9968,7 +9981,8 @@ extract_box_cb (void *cls,
bpm->frag_parent = pm;
set_pending_message_uuid (bpm);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Creating DV Box %llu for original message %llu (next hop is
%s)\n",
+ "Creating DV Box %" PRIu64 " for original message %" PRIu64
+ " (next hop is %s)\n",
bpm->logging_uuid,
pm->logging_uuid,
GNUNET_i2s (&next_hop->pid));
@@ -10048,7 +10062,7 @@ transmit_on_queue (void *cls)
/* Given selection in `sc`, do transmission */
pm = sc.best;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Selected message <%llu>\n",
+ "Selected message <%" PRIu64 ">\n",
pm->logging_uuid);
if (NULL != sc.dvh)
{
@@ -10094,7 +10108,8 @@ transmit_on_queue (void *cls)
if (NULL == pm)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Fragmentation failed queue %s to %s for <%llu>, trying
again\n",
+ "Fragmentation failed queue %s to %s for <%" PRIu64
+ ">, trying again\n",
queue->address,
GNUNET_i2s (&n->pid),
sc.best->logging_uuid);
@@ -10112,7 +10127,8 @@ transmit_on_queue (void *cls)
/* Reliability boxing failed, try next message... */
GNUNET_log (
GNUNET_ERROR_TYPE_DEBUG,
- "Reliability boxing failed queue %s to %s for <%llu>, trying again\n",
+ "Reliability boxing failed queue %s to %s for <%" PRIu64
+ ">, trying again\n",
queue->address,
GNUNET_i2s (&n->pid),
sc.best->logging_uuid);
@@ -10126,7 +10142,8 @@ transmit_on_queue (void *cls)
/* Pass 'pm' for transission to the communicator */
GNUNET_log (
GNUNET_ERROR_TYPE_DEBUG,
- "Passing message <%llu> to queue %s for peer %s (considered %u others)\n",
+ "Passing message <%" PRIu64
+ "> to queue %s for peer %s (considered %u others)\n",
pm->logging_uuid,
queue->address,
GNUNET_i2s (&n->pid),
@@ -10179,9 +10196,10 @@ transmit_on_queue (void *cls)
root = root->frag_parent;
root->frag_count++;
- wait_multiplier = (unsigned int) ceil (root->bytes_msg
- / (root->frag_off
- / root->frag_count)) * 4;
+ wait_multiplier = (unsigned int) ceil ((double) root->bytes_msg
+ / ((double) root->frag_off
+ / (double) root->frag_count))
+ * 4;
}
else
{
@@ -10345,7 +10363,7 @@ handle_send_message_ack (void *cls,
// Update: Maybe QueueEntry was accidentally freed during freeing
PendingMessage.
/* this should never happen */
GNUNET_break (0);
- //GNUNET_SERVICE_client_drop (tc->client);
+ // GNUNET_SERVICE_client_drop (tc->client);
GNUNET_SERVICE_client_continue (tc->client);
return;
}
@@ -11223,7 +11241,7 @@ handle_suggest_cancel (void *cls, const struct
ExpressPreferenceMessage *msg)
static void
hello_for_client_cb (void *cls,
- const char *uri)
+ const char *uri)
{
const struct GNUNET_PeerIdentity *peer = cls;
int pfx_len;
@@ -11263,7 +11281,6 @@ handle_hello_for_client (void *cls,
const char *emsg)
{
(void) cls;
- const char *val;
struct GNUNET_HELLO_Builder *builder;
if (NULL != emsg)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: TRANSPORT: Fix more warnings,
gnunet <=