aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-07 14:15:38 +0000
commite5bd8fb4aa72717b8707a4652f14c0735acb52c4 (patch)
tree08398e22b9408cc24b6b9e6cb360fe04b9eeae05 /src/ats
parent572bab1ace57fb9d7acbd218d6940cb1e9a0797b (diff)
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.c3
-rw-r--r--src/ats/gnunet-service-ats_addresses.c3
-rw-r--r--src/ats/gnunet-service-ats_performance.c3
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c1
4 files changed, 9 insertions, 1 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 838de6623c..355a279bac 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,
if (NULL == sh->mq)
return; /* disconnected, skip for now */
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ar->properties.scope);
namelen = strlen (ar->address->transport_name) + 1;
msize = ar->address->address_length + namelen;
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,
GNUNET_break (0);
return NULL;
}
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
namelen = strlen (address->transport_name) + 1;
msize = address->address_length + namelen;
if ((msize + sizeof (struct AddressUpdateMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
@@ -774,6 +776,7 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
ar->address->transport_name,
ar->session,
ar->slot);
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
GNUNET_ATS_properties_hton (&ar->properties,
prop);
if (NULL == sh->mq)
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index d587d832b3..aa0e67ff8b 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,
GNUNET_break (0);
return;
}
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
new_address = create_address (peer,
plugin_name,
plugin_addr,
@@ -294,7 +295,7 @@ GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
"Received ADDRESS_UPDATE for peer `%s' slot %u\n",
GNUNET_i2s (peer),
(unsigned int) session_id);
-
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
/* Update address */
aa->t_last_activity = GNUNET_TIME_absolute_get();
aa->properties = *prop;
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c
index f0fe1927cb..831afb4186 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,
struct GNUNET_SERVER_NotificationContext *nc;
char *addrp;
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE);
msg = (struct PeerInformationMessage *) buf;
msg->header.size = htons (msize);
@@ -159,6 +160,7 @@ GAS_performance_notify_all_clients (const struct GNUNET_PeerIdentity *peer,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
{
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
notify_client (NULL,
peer,
plugin_name,
@@ -212,6 +214,7 @@ peerinfo_it (void *cls,
plugin_name,
(unsigned int) ntohl (bandwidth_out.value__),
(unsigned int) ntohl (bandwidth_in.value__));
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop->scope);
notify_client (client,
id,
plugin_name,
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 1bd243aae0..1aa96b861e 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,
GNUNET_NO);
GNUNET_ATS_properties_ntoh (&prop,
&m->properties);
+ GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != prop.scope);
GAS_addresses_add (&m->peer,
plugin_name,
address,