diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-07 14:15:38 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-07 14:15:38 +0000 |
commit | e5bd8fb4aa72717b8707a4652f14c0735acb52c4 (patch) | |
tree | 08398e22b9408cc24b6b9e6cb360fe04b9eeae05 /src/ats | |
parent | 572bab1ace57fb9d7acbd218d6940cb1e9a0797b (diff) | |
download | gnunet-e5bd8fb4aa72717b8707a4652f14c0735acb52c4.tar.gz gnunet-e5bd8fb4aa72717b8707a4652f14c0735acb52c4.zip |
determine network scope for ATS even if we do not yet have a session and only have an address
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats_api_scheduling.c | 3 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 3 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_performance.c | 3 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_scheduling.c | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 838de6623..355a279ba 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -494,6 +494,7 @@ send_add_address_message (struct GNUNET_ATS_SchedulingHandle *sh, | |||
494 | 494 | ||
495 | if (NULL == sh->mq) | 495 | if (NULL == sh->mq) |
496 | return; /* disconnected, skip for now */ | 496 | return; /* disconnected, skip for now */ |
497 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ar->properties.scope); | ||
497 | namelen = strlen (ar->address->transport_name) + 1; | 498 | namelen = strlen (ar->address->transport_name) + 1; |
498 | msize = ar->address->address_length + namelen; | 499 | msize = ar->address->address_length + namelen; |
499 | ev = GNUNET_MQ_msg_extra (m, msize, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD); | 500 | ev = GNUNET_MQ_msg_extra (m, msize, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_ADD); |
@@ -672,6 +673,7 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, | |||
672 | GNUNET_break (0); | 673 | GNUNET_break (0); |
673 | return NULL; | 674 | return NULL; |
674 | } | 675 | } |
676 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
675 | namelen = strlen (address->transport_name) + 1; | 677 | namelen = strlen (address->transport_name) + 1; |
676 | msize = address->address_length + namelen; | 678 | msize = address->address_length + namelen; |
677 | if ((msize + sizeof (struct AddressUpdateMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) || | 679 | if ((msize + sizeof (struct AddressUpdateMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) || |
@@ -774,6 +776,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, | |||
774 | ar->address->transport_name, | 776 | ar->address->transport_name, |
775 | ar->session, | 777 | ar->session, |
776 | ar->slot); | 778 | ar->slot); |
779 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
777 | GNUNET_ATS_properties_hton (&ar->properties, | 780 | GNUNET_ATS_properties_hton (&ar->properties, |
778 | prop); | 781 | prop); |
779 | if (NULL == sh->mq) | 782 | if (NULL == sh->mq) |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index d587d832b..aa0e67ff8 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -225,6 +225,7 @@ GAS_addresses_add (const struct GNUNET_PeerIdentity *peer, | |||
225 | GNUNET_break (0); | 225 | GNUNET_break (0); |
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
228 | new_address = create_address (peer, | 229 | new_address = create_address (peer, |
229 | plugin_name, | 230 | plugin_name, |
230 | plugin_addr, | 231 | plugin_addr, |
@@ -294,7 +295,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer, | |||
294 | "Received ADDRESS_UPDATE for peer `%s' slot %u\n", | 295 | "Received ADDRESS_UPDATE for peer `%s' slot %u\n", |
295 | GNUNET_i2s (peer), | 296 | GNUNET_i2s (peer), |
296 | (unsigned int) session_id); | 297 | (unsigned int) session_id); |
297 | 298 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | |
298 | /* Update address */ | 299 | /* Update address */ |
299 | aa->t_last_activity = GNUNET_TIME_absolute_get(); | 300 | aa->t_last_activity = GNUNET_TIME_absolute_get(); |
300 | aa->properties = *prop; | 301 | aa->properties = *prop; |
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c index f0fe1927c..831afb418 100644 --- a/src/ats/gnunet-service-ats_performance.c +++ b/src/ats/gnunet-service-ats_performance.c | |||
@@ -85,6 +85,7 @@ notify_client (struct GNUNET_SERVER_Client *client, | |||
85 | struct GNUNET_SERVER_NotificationContext *nc; | 85 | struct GNUNET_SERVER_NotificationContext *nc; |
86 | char *addrp; | 86 | char *addrp; |
87 | 87 | ||
88 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
88 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); | 89 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); |
89 | msg = (struct PeerInformationMessage *) buf; | 90 | msg = (struct PeerInformationMessage *) buf; |
90 | msg->header.size = htons (msize); | 91 | msg->header.size = htons (msize); |
@@ -159,6 +160,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer, | |||
159 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 160 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
160 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) | 161 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) |
161 | { | 162 | { |
163 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
162 | notify_client (NULL, | 164 | notify_client (NULL, |
163 | peer, | 165 | peer, |
164 | plugin_name, | 166 | plugin_name, |
@@ -212,6 +214,7 @@ peerinfo_it (void *cls, | |||
212 | plugin_name, | 214 | plugin_name, |
213 | (unsigned int) ntohl (bandwidth_out.value__), | 215 | (unsigned int) ntohl (bandwidth_out.value__), |
214 | (unsigned int) ntohl (bandwidth_in.value__)); | 216 | (unsigned int) ntohl (bandwidth_in.value__)); |
217 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope); | ||
215 | notify_client (client, | 218 | notify_client (client, |
216 | id, | 219 | id, |
217 | plugin_name, | 220 | plugin_name, |
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c index 1bd243aae..1aa96b861 100644 --- a/src/ats/gnunet-service-ats_scheduling.c +++ b/src/ats/gnunet-service-ats_scheduling.c | |||
@@ -176,6 +176,7 @@ GAS_handle_address_add (void *cls, | |||
176 | GNUNET_NO); | 176 | GNUNET_NO); |
177 | GNUNET_ATS_properties_ntoh (&prop, | 177 | GNUNET_ATS_properties_ntoh (&prop, |
178 | &m->properties); | 178 | &m->properties); |
179 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop.scope); | ||
179 | GAS_addresses_add (&m->peer, | 180 | GAS_addresses_add (&m->peer, |
180 | plugin_name, | 181 | plugin_name, |
181 | address, | 182 | address, |