diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-05-05 14:02:24 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-05-05 14:02:24 +0200 |
commit | e94c5914935ca0842ca762d343cb167c68b8a79a (patch) | |
tree | 4719d48bbcd9be334854d0ed88ba76f5b259b296 /src/transport/gnunet-service-tng.c | |
parent | b84057d7593651e16a161de9f2ec51f93c98589d (diff) | |
download | gnunet-e94c5914935ca0842ca762d343cb167c68b8a79a.tar.gz gnunet-e94c5914935ca0842ca762d343cb167c68b8a79a.zip |
use new PriorityPreferences consistently, note on deprecation
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r-- | src/transport/gnunet-service-tng.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index 443c7f245..ab9159963 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -1757,8 +1757,10 @@ struct PeerRequest | |||
1757 | 1757 | ||
1758 | /** | 1758 | /** |
1759 | * What kind of performance preference does this @e tc have? | 1759 | * What kind of performance preference does this @e tc have? |
1760 | * | ||
1761 | * TODO: use this! | ||
1760 | */ | 1762 | */ |
1761 | enum GNUNET_MQ_PreferenceKind pk; | 1763 | enum GNUNET_MQ_PriorityPreferences pk; |
1762 | 1764 | ||
1763 | /** | 1765 | /** |
1764 | * How much bandwidth would this @e tc like to see? | 1766 | * How much bandwidth would this @e tc like to see? |
@@ -1953,6 +1955,12 @@ struct PendingMessage | |||
1953 | enum PendingMessageType pmt; | 1955 | enum PendingMessageType pmt; |
1954 | 1956 | ||
1955 | /** | 1957 | /** |
1958 | * Preferences for this message. | ||
1959 | * TODO: actually use this! | ||
1960 | */ | ||
1961 | enum GNUNET_MQ_PriorityPreferences prefs; | ||
1962 | |||
1963 | /** | ||
1956 | * Size of the original message. | 1964 | * Size of the original message. |
1957 | */ | 1965 | */ |
1958 | uint16_t bytes_msg; | 1966 | uint16_t bytes_msg; |
@@ -3736,7 +3744,6 @@ handle_client_send (void *cls, const struct OutboundMessage *obm) | |||
3736 | obmm = (const struct GNUNET_MessageHeader *) &obm[1]; | 3744 | obmm = (const struct GNUNET_MessageHeader *) &obm[1]; |
3737 | bytes_msg = ntohs (obmm->size); | 3745 | bytes_msg = ntohs (obmm->size); |
3738 | pp = (enum GNUNET_MQ_PriorityPreferences) ntohl (obm->priority); | 3746 | pp = (enum GNUNET_MQ_PriorityPreferences) ntohl (obm->priority); |
3739 | /* FIXME: actually make use of pp */ (void) pp; | ||
3740 | vl = GNUNET_CONTAINER_multipeermap_get (links, &obm->peer); | 3747 | vl = GNUNET_CONTAINER_multipeermap_get (links, &obm->peer); |
3741 | if (NULL == vl) | 3748 | if (NULL == vl) |
3742 | { | 3749 | { |
@@ -3790,6 +3797,7 @@ handle_client_send (void *cls, const struct OutboundMessage *obm) | |||
3790 | 3797 | ||
3791 | was_empty = (NULL == target->pending_msg_head); | 3798 | was_empty = (NULL == target->pending_msg_head); |
3792 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + payload_size); | 3799 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + payload_size); |
3800 | pm->prefs = pp; | ||
3793 | pm->client = tc; | 3801 | pm->client = tc; |
3794 | pm->target = target; | 3802 | pm->target = target; |
3795 | pm->bytes_msg = payload_size; | 3803 | pm->bytes_msg = payload_size; |
@@ -8559,7 +8567,7 @@ handle_suggest (void *cls, const struct ExpressPreferenceMessage *msg) | |||
8559 | pr->tc = tc; | 8567 | pr->tc = tc; |
8560 | pr->pid = msg->peer; | 8568 | pr->pid = msg->peer; |
8561 | pr->bw = msg->bw; | 8569 | pr->bw = msg->bw; |
8562 | pr->pk = (enum GNUNET_MQ_PreferenceKind) ntohl (msg->pk); | 8570 | pr->pk = (enum GNUNET_MQ_PriorityPreferences) ntohl (msg->pk); |
8563 | if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_put ( | 8571 | if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_put ( |
8564 | tc->details.application.requests, | 8572 | tc->details.application.requests, |
8565 | &pr->pid, | 8573 | &pr->pid, |