aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-17 08:13:49 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-17 08:13:49 +0000
commitc0d32e08cddf59b933cecd744c6cd582ec566694 (patch)
tree3f1c239c318c4eb06b40c6cd0889d1803c0d9616 /src/ats
parenta2d9b4434076254811584a4a0ffa8881d0903db8 (diff)
downloadgnunet-c0d32e08cddf59b933cecd744c6cd582ec566694.tar.gz
gnunet-c0d32e08cddf59b933cecd744c6cd582ec566694.zip
restrict to 1 scheduling client
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/gnunet-service-ats.c6
-rw-r--r--src/ats/gnunet-service-ats_addresses.c77
-rw-r--r--src/ats/gnunet-service-ats_addresses.h20
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c147
-rw-r--r--src/ats/gnunet-service-ats_scheduling.h7
5 files changed, 95 insertions, 162 deletions
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index a2c0e8c73..3babc0988 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -55,7 +55,11 @@ handle_ats_start (void *cls, struct GNUNET_SERVER_Client *client,
55 switch (flag) 55 switch (flag)
56 { 56 {
57 case START_FLAG_SCHEDULING: 57 case START_FLAG_SCHEDULING:
58 GAS_scheduling_add_client (client); 58 if (GNUNET_OK != GAS_scheduling_add_client (client))
59 {
60 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
61 return;
62 }
59 break; 63 break;
60 case START_FLAG_PERFORMANCE_WITH_PIC: 64 case START_FLAG_PERFORMANCE_WITH_PIC:
61 GAS_performance_add_client (client, flag); 65 GAS_performance_add_client (client, flag);
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c
index 2bcb9913a..68d4b03de 100644
--- a/src/ats/gnunet-service-ats_addresses.c
+++ b/src/ats/gnunet-service-ats_addresses.c
@@ -36,8 +36,6 @@ struct ATS_Address
36 36
37 size_t addr_len; 37 size_t addr_len;
38 38
39 struct GNUNET_SERVER_Client *session_client;
40
41 uint32_t session_id; 39 uint32_t session_id;
42 40
43 uint32_t ats_count; 41 uint32_t ats_count;
@@ -48,6 +46,24 @@ struct ATS_Address
48 46
49 struct GNUNET_ATS_Information * ats; 47 struct GNUNET_ATS_Information * ats;
50 48
49 struct GNUNET_BANDWIDTH_Value32NBO atsp_utilization_in;
50
51 struct GNUNET_BANDWIDTH_Value32NBO atsp_utilization_out;
52
53 struct GNUNET_TIME_Relative atsp_latency;
54
55 uint32_t atsp_distance;
56
57 uint32_t atsp_cost_wan;
58
59 uint32_t atsp_cost_lan;
60
61 uint32_t atsp_cost_wlan;
62
63 struct GNUNET_BANDWIDTH_Value32NBO assigned_bw_in;
64
65 struct GNUNET_BANDWIDTH_Value32NBO assigned_bw_out;
66
51 struct GNUNET_BANDWIDTH_Value32NBO bw_in; 67 struct GNUNET_BANDWIDTH_Value32NBO bw_in;
52 68
53 struct GNUNET_BANDWIDTH_Value32NBO bw_out; 69 struct GNUNET_BANDWIDTH_Value32NBO bw_out;
@@ -98,8 +114,7 @@ compare_address_it (void *cls,
98 struct ATS_Address * aa = (struct ATS_Address *) value; 114 struct ATS_Address * aa = (struct ATS_Address *) value;
99 115
100 /* compare sessions */ 116 /* compare sessions */
101 if ((aa->session_client != cac->search->session_client) || 117 if (aa->session_id != cac->search->session_id)
102 (aa->session_id != cac->search->session_id))
103 return GNUNET_YES; 118 return GNUNET_YES;
104 119
105 if (aa->addr_len != cac->search->addr_len) 120 if (aa->addr_len != cac->search->addr_len)
@@ -139,13 +154,12 @@ find_address (const struct GNUNET_PeerIdentity *peer,
139 154
140 155
141void 156void
142GAS_address_update (const struct GNUNET_PeerIdentity *peer, 157GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
143 const char *plugin_name, 158 const char *plugin_name,
144 const void *plugin_addr, size_t plugin_addr_len, 159 const void *plugin_addr, size_t plugin_addr_len,
145 struct GNUNET_SERVER_Client *session_client, 160 uint32_t session_id,
146 uint32_t session_id, 161 const struct GNUNET_ATS_Information *atsi,
147 const struct GNUNET_ATS_Information *atsi, 162 uint32_t atsi_count)
148 uint32_t atsi_count)
149{ 163{
150 struct ATS_Address * aa; 164 struct ATS_Address * aa;
151 struct ATS_Address * old; 165 struct ATS_Address * old;
@@ -159,7 +173,6 @@ GAS_address_update (const struct GNUNET_PeerIdentity *peer,
159 aa->addr = &aa[1]; 173 aa->addr = &aa[1];
160 memcpy (&aa[1], plugin_addr, plugin_addr_len); 174 memcpy (&aa[1], plugin_addr, plugin_addr_len);
161 aa->plugin = GNUNET_strdup (plugin_name); 175 aa->plugin = GNUNET_strdup (plugin_name);
162 aa->session_client = session_client;
163 aa->session_id = session_id; 176 aa->session_id = session_id;
164 old = find_address (peer, aa); 177 old = find_address (peer, aa);
165 if (old == NULL) 178 if (old == NULL)
@@ -187,34 +200,10 @@ GAS_address_update (const struct GNUNET_PeerIdentity *peer,
187} 200}
188 201
189 202
190static int
191remove_address_by_client (void *cls,
192 const GNUNET_HashCode * key,
193 void *value)
194{
195 struct GNUNET_SERVER_Client *client = cls;
196 struct ATS_Address * aa = value;
197
198 if (aa->session_client == client)
199 destroy_address (aa);
200 return GNUNET_OK;
201}
202
203
204void
205GAS_address_client_disconnected (struct GNUNET_SERVER_Client *client)
206{
207 if (addresses != NULL)
208 GNUNET_CONTAINER_multihashmap_iterate(addresses,
209 &remove_address_by_client, client);
210}
211
212
213void 203void
214GAS_address_destroyed (const struct GNUNET_PeerIdentity *peer, 204GAS_addresses_destroy (const struct GNUNET_PeerIdentity *peer,
215 const char *plugin_name, 205 const char *plugin_name,
216 const void *plugin_addr, size_t plugin_addr_len, 206 const void *plugin_addr, size_t plugin_addr_len,
217 struct GNUNET_SERVER_Client *session_client,
218 uint32_t session_id) 207 uint32_t session_id)
219{ 208{
220 209
@@ -225,7 +214,6 @@ GAS_address_destroyed (const struct GNUNET_PeerIdentity *peer,
225 aa.addr_len = plugin_addr_len; 214 aa.addr_len = plugin_addr_len;
226 aa.addr = plugin_addr; 215 aa.addr = plugin_addr;
227 aa.plugin = (char*) plugin_name; 216 aa.plugin = (char*) plugin_name;
228 aa.session_client = session_client;
229 aa.session_id = session_id; 217 aa.session_id = session_id;
230 218
231 res = find_address (peer, &aa); 219 res = find_address (peer, &aa);
@@ -269,7 +257,7 @@ GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer)
269 aa->bw_in); 257 aa->bw_in);
270 GAS_scheduling_transmit_address_suggestion (peer, aa->plugin, 258 GAS_scheduling_transmit_address_suggestion (peer, aa->plugin,
271 aa->addr, aa->addr_len, 259 aa->addr, aa->addr_len,
272 aa->session_client, aa->session_id, 260 aa->session_id,
273 aa->ats, aa->ats_count, 261 aa->ats, aa->ats_count,
274 aa->bw_out, aa->bw_in); 262 aa->bw_out, aa->bw_in);
275 GAS_performance_notify_clients (peer, aa->plugin, 263 GAS_performance_notify_clients (peer, aa->plugin,
@@ -332,13 +320,22 @@ free_address_it (void *cls,
332} 320}
333 321
334 322
323void
324GAS_addresses_destroy_all ()
325{
326 if (addresses != NULL)
327 GNUNET_CONTAINER_multihashmap_iterate(addresses,
328 &free_address_it, NULL);
329}
330
331
335/** 332/**
336 * Shutdown address subsystem. 333 * Shutdown address subsystem.
337 */ 334 */
338void 335void
339GAS_addresses_done () 336GAS_addresses_done ()
340{ 337{
341 GNUNET_CONTAINER_multihashmap_iterate (addresses, &free_address_it, NULL); 338 GAS_addresses_destroy_all ();
342 GNUNET_CONTAINER_multihashmap_destroy (addresses); 339 GNUNET_CONTAINER_multihashmap_destroy (addresses);
343 addresses = NULL; 340 addresses = NULL;
344} 341}
diff --git a/src/ats/gnunet-service-ats_addresses.h b/src/ats/gnunet-service-ats_addresses.h
index 335876720..1d218ba57 100644
--- a/src/ats/gnunet-service-ats_addresses.h
+++ b/src/ats/gnunet-service-ats_addresses.h
@@ -47,24 +47,24 @@ GAS_addresses_done (void);
47 47
48 48
49void 49void
50GAS_address_update (const struct GNUNET_PeerIdentity *peer, 50GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
51 const char *plugin_name, 51 const char *plugin_name,
52 const void *plugin_addr, size_t plugin_addr_len, 52 const void *plugin_addr, size_t plugin_addr_len,
53 struct GNUNET_SERVER_Client *session_client, 53 uint32_t session_id,
54 uint32_t session_id, 54 const struct GNUNET_ATS_Information *atsi,
55 const struct GNUNET_ATS_Information *atsi, 55 uint32_t atsi_count);
56 uint32_t atsi_count);
57 56
58 57
59void 58void
60GAS_address_destroyed (const struct GNUNET_PeerIdentity *peer, 59GAS_addresses_destroy (const struct GNUNET_PeerIdentity *peer,
61 const char *plugin_name, 60 const char *plugin_name,
62 const void *plugin_addr, size_t plugin_addr_len, 61 const void *plugin_addr, size_t plugin_addr_len,
63 struct GNUNET_SERVER_Client *session_client,
64 uint32_t session_id); 62 uint32_t session_id);
65 63
64
66void 65void
67GAS_address_client_disconnected (struct GNUNET_SERVER_Client *session_client); 66GAS_addresses_destroy_all (void);
67
68 68
69// FIXME: this function should likely end up in the LP-subsystem and 69// FIXME: this function should likely end up in the LP-subsystem and
70// not with 'addresses' in the future... 70// not with 'addresses' in the future...
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 825f00085..3d53c1e42 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -31,88 +31,38 @@
31 31
32 32
33/** 33/**
34 * We keep clients that are interested in scheduling in a linked list.
35 * This list typically has only one entry (for the
36 * gnunet-service-transport process); however, it is possible that
37 * there is more than one (at least briefly) because after a crash a
38 * new one may connect before we've been notified to clean up the old
39 * process.
40 */
41struct SchedulingClient
42{
43 /**
44 * Next in doubly-linked list.
45 */
46 struct SchedulingClient * next;
47
48 /**
49 * Previous in doubly-linked list.
50 */
51 struct SchedulingClient * prev;
52
53 /**
54 * Actual handle to the client.
55 */
56 struct GNUNET_SERVER_Client *client;
57
58};
59
60
61/**
62 * Head of linked list of all clients to this service.
63 */
64static struct SchedulingClient *sc_head;
65
66/**
67 * Tail of linked list of all clients to this service.
68 */
69static struct SchedulingClient *sc_tail;
70
71/**
72 * Context for sending messages to clients. 34 * Context for sending messages to clients.
73 */ 35 */
74static struct GNUNET_SERVER_NotificationContext *nc; 36static struct GNUNET_SERVER_NotificationContext *nc;
75 37
76
77/** 38/**
78 * Find the scheduling client associated with the given 39 * Actual handle to the client.
79 * handle.
80 *
81 * @param client server handle
82 * @return internal handle
83 */ 40 */
84static struct SchedulingClient * 41static struct GNUNET_SERVER_Client *my_client;
85find_client (struct GNUNET_SERVER_Client *client)
86{
87 struct SchedulingClient * sc;
88
89 for (sc = sc_head; sc != NULL; sc = sc->next)
90 if (sc->client == client)
91 return sc;
92 return NULL;
93}
94 42
95 43
96/** 44/**
97 * Register a new scheduling client. 45 * Register a new scheduling client.
98 * 46 *
99 * @param client handle of the new client 47 * @param client handle of the new client
48 * @return GNUNET_OK on success, GNUNET_SYSERR on error
100 */ 49 */
101void 50int
102GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client) 51GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client)
103{ 52{
104 struct SchedulingClient *sc; 53 if (my_client != NULL)
105 54 {
106 GNUNET_break (NULL == find_client (client)); 55 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
107 sc = GNUNET_malloc (sizeof (struct SchedulingClient)); 56 "This ATS already has a scheduling client, refusing new scheduling client for now.\n");
108 sc->client = client; 57 return GNUNET_SYSERR;
58 }
59 my_client = client;
109 GNUNET_SERVER_notification_context_add (nc, client); 60 GNUNET_SERVER_notification_context_add (nc, client);
110 GNUNET_SERVER_client_keep (client); 61 GNUNET_SERVER_client_keep (client);
111 GNUNET_CONTAINER_DLL_insert(sc_head, sc_tail, sc); 62 return GNUNET_OK;
112} 63}
113 64
114 65
115
116/** 66/**
117 * Unregister a client (which may have been a scheduling client, 67 * Unregister a client (which may have been a scheduling client,
118 * but this is not assured). 68 * but this is not assured).
@@ -122,15 +72,11 @@ GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client)
122void 72void
123GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client) 73GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client)
124{ 74{
125 struct SchedulingClient * sc; 75 if (my_client != client)
126
127 sc = find_client (client);
128 if (NULL == sc)
129 return; 76 return;
130 GNUNET_CONTAINER_DLL_remove (sc_head, sc_tail, sc); 77 GAS_addresses_destroy_all ();
131 GAS_address_client_disconnected (client);
132 GNUNET_SERVER_client_drop (client); 78 GNUNET_SERVER_client_drop (client);
133 GNUNET_free (sc); 79 my_client = NULL;
134} 80}
135 81
136 82
@@ -142,7 +88,6 @@ GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client)
142 * @param plugin_name 0-termintated string specifying the transport plugin 88 * @param plugin_name 0-termintated string specifying the transport plugin
143 * @param plugin_addr binary address for the plugin to use 89 * @param plugin_addr binary address for the plugin to use
144 * @param plugin_addr_len number of bytes in plugin_addr 90 * @param plugin_addr_len number of bytes in plugin_addr
145 * @param session_client which client gave us this session_id?
146 * @param session_id session ID to use for the given client (other clients will see 0) 91 * @param session_id session ID to use for the given client (other clients will see 0)
147 * @param atsi performance data for the address 92 * @param atsi performance data for the address
148 * @param atsi_count number of performance records in 'ats' 93 * @param atsi_count number of performance records in 'ats'
@@ -153,14 +98,12 @@ void
153GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer, 98GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer,
154 const char *plugin_name, 99 const char *plugin_name,
155 const void *plugin_addr, size_t plugin_addr_len, 100 const void *plugin_addr, size_t plugin_addr_len,
156 struct GNUNET_SERVER_Client *session_client,
157 uint32_t session_id, 101 uint32_t session_id,
158 const struct GNUNET_ATS_Information *atsi, 102 const struct GNUNET_ATS_Information *atsi,
159 uint32_t atsi_count, 103 uint32_t atsi_count,
160 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 104 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
161 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in) 105 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in)
162{ 106{
163 struct SchedulingClient *sc;
164 struct AddressSuggestionMessage *msg; 107 struct AddressSuggestionMessage *msg;
165 size_t plugin_name_length = strlen (plugin_name) + 1; 108 size_t plugin_name_length = strlen (plugin_name) + 1;
166 size_t msize = sizeof (struct AddressSuggestionMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information) 109 size_t msize = sizeof (struct AddressSuggestionMessage) + atsi_count * sizeof (struct GNUNET_ATS_Information)
@@ -169,6 +112,8 @@ GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *pe
169 struct GNUNET_ATS_Information *atsp; 112 struct GNUNET_ATS_Information *atsp;
170 char *addrp; 113 char *addrp;
171 114
115 if (my_client == NULL)
116 return;
172 GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); 117 GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE);
173 GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)); 118 GNUNET_assert (atsi_count < GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information));
174 msg = (struct AddressSuggestionMessage*) buf; 119 msg = (struct AddressSuggestionMessage*) buf;
@@ -178,7 +123,7 @@ GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *pe
178 msg->peer = *peer; 123 msg->peer = *peer;
179 msg->address_length = htons (plugin_addr_len); 124 msg->address_length = htons (plugin_addr_len);
180 msg->plugin_name_length = htons (plugin_name_length); 125 msg->plugin_name_length = htons (plugin_name_length);
181 /* session ID is set only if 'client' is the same... */ 126 msg->session_id = htonl (session_id);
182 msg->bandwidth_out = bandwidth_out; 127 msg->bandwidth_out = bandwidth_out;
183 msg->bandwidth_in = bandwidth_in; 128 msg->bandwidth_in = bandwidth_in;
184 atsp = (struct GNUNET_ATS_Information* ) &msg[1]; 129 atsp = (struct GNUNET_ATS_Information* ) &msg[1];
@@ -186,17 +131,10 @@ GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *pe
186 addrp = (char*) &atsp[atsi_count]; 131 addrp = (char*) &atsp[atsi_count];
187 memcpy (addrp, plugin_addr, plugin_addr_len); 132 memcpy (addrp, plugin_addr, plugin_addr_len);
188 strcpy (&addrp[plugin_addr_len], plugin_name); 133 strcpy (&addrp[plugin_addr_len], plugin_name);
189 for (sc = sc_head; sc != NULL; sc = sc->next) 134 GNUNET_SERVER_notification_context_unicast (nc,
190 { 135 my_client,
191 if (sc->client == session_client) 136 &msg->header,
192 msg->session_id = htonl (session_id); 137 GNUNET_YES);
193 else
194 msg->session_id = htonl (0);
195 GNUNET_SERVER_notification_context_unicast (nc,
196 sc->client,
197 &msg->header,
198 GNUNET_YES);
199 }
200} 138}
201 139
202 140
@@ -230,8 +168,7 @@ GAS_handle_request_address (void *cls, struct GNUNET_SERVER_Client *client,
230 */ 168 */
231void 169void
232GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client, 170GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
233 const struct GNUNET_MessageHeader *message) 171 const struct GNUNET_MessageHeader *message)
234
235{ 172{
236 const struct AddressUpdateMessage * m; 173 const struct AddressUpdateMessage * m;
237 const struct GNUNET_ATS_Information *atsi; 174 const struct GNUNET_ATS_Information *atsi;
@@ -273,14 +210,13 @@ GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
273 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 210 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
274 return; 211 return;
275 } 212 }
276 GAS_address_update (&m->peer, 213 GAS_addresses_update (&m->peer,
277 plugin_name, 214 plugin_name,
278 address, 215 address,
279 address_length, 216 address_length,
280 client, 217 ntohl (m->session_id),
281 ntohl (m->session_id), 218 atsi,
282 atsi, 219 ats_count);
283 ats_count);
284 GNUNET_SERVER_receive_done (client, GNUNET_OK); 220 GNUNET_SERVER_receive_done (client, GNUNET_OK);
285} 221}
286 222
@@ -308,7 +244,8 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
308 "Received `%s' message of size %u %u\n", 244 "Received `%s' message of size %u %u\n",
309 "ADDRESS_DESTROYED", ntohs (message->size), sizeof (struct AddressDestroyedMessage)); 245 "ADDRESS_DESTROYED", ntohs (message->size), sizeof (struct AddressDestroyedMessage));
310 size = ntohs (message->size); 246 size = ntohs (message->size);
311 if (size < sizeof (struct AddressDestroyedMessage)) 247 if ( (size < sizeof (struct AddressDestroyedMessage)) ||
248 (client != my_client) )
312 { 249 {
313 GNUNET_break (0); 250 GNUNET_break (0);
314 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 251 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
@@ -323,7 +260,6 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
323 plugin_name = &address[address_length]; 260 plugin_name = &address[address_length];
324 else 261 else
325 plugin_name = ""; 262 plugin_name = "";
326
327 if ( (address_length + 263 if ( (address_length +
328 plugin_name_length + 264 plugin_name_length +
329 sizeof (struct AddressDestroyedMessage) != ntohs (message->size))) 265 sizeof (struct AddressDestroyedMessage) != ntohs (message->size)))
@@ -331,21 +267,18 @@ GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
331 GNUNET_break (0); 267 GNUNET_break (0);
332 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 268 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
333 return; 269 return;
270 }
271 if ( (plugin_name_length != 0) &&
272 (plugin_name[plugin_name_length - 1] != '\0') )
273 {
274 GNUNET_break (0);
275 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
276 return;
334 } 277 }
335 278 GAS_addresses_destroy (&m->peer,
336 if (plugin_name_length != 0)
337 if (plugin_name[plugin_name_length - 1] != '\0')
338 {
339 GNUNET_break (0);
340 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
341 return;
342 }
343
344 GAS_address_destroyed (&m->peer,
345 plugin_name, 279 plugin_name,
346 address, 280 address,
347 address_length, 281 address_length,
348 client,
349 ntohl (m->session_id)); 282 ntohl (m->session_id));
350 GNUNET_SERVER_receive_done (client, GNUNET_OK); 283 GNUNET_SERVER_receive_done (client, GNUNET_OK);
351} 284}
diff --git a/src/ats/gnunet-service-ats_scheduling.h b/src/ats/gnunet-service-ats_scheduling.h
index 15eed7f85..9e188fe8f 100644
--- a/src/ats/gnunet-service-ats_scheduling.h
+++ b/src/ats/gnunet-service-ats_scheduling.h
@@ -34,8 +34,9 @@
34 * Register a new scheduling client. 34 * Register a new scheduling client.
35 * 35 *
36 * @param client handle of the new client 36 * @param client handle of the new client
37 * @return GNUNET_OK on success, GNUNET_SYSERR on error
37 */ 38 */
38void 39int
39GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client); 40GAS_scheduling_add_client (struct GNUNET_SERVER_Client *client);
40 41
41 42
@@ -57,8 +58,7 @@ GAS_scheduling_remove_client (struct GNUNET_SERVER_Client *client);
57 * @param plugin_name 0-termintated string specifying the transport plugin 58 * @param plugin_name 0-termintated string specifying the transport plugin
58 * @param plugin_addr binary address for the plugin to use 59 * @param plugin_addr binary address for the plugin to use
59 * @param plugin_addr_len number of bytes in plugin_addr 60 * @param plugin_addr_len number of bytes in plugin_addr
60 * @param session_client which client gave us this session_id? 61 * @param session_id session ID to use
61 * @param session_id session ID to use for the given client (other clients will see 0)
62 * @param atsi performance data for the address 62 * @param atsi performance data for the address
63 * @param atsi_count number of performance records in 'ats' 63 * @param atsi_count number of performance records in 'ats'
64 * @param bandwidth_out assigned outbound bandwidth 64 * @param bandwidth_out assigned outbound bandwidth
@@ -68,7 +68,6 @@ void
68GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer, 68GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity *peer,
69 const char *plugin_name, 69 const char *plugin_name,
70 const void *plugin_addr, size_t plugin_addr_len, 70 const void *plugin_addr, size_t plugin_addr_len,
71 struct GNUNET_SERVER_Client *session_client,
72 uint32_t session_id, 71 uint32_t session_id,
73 const struct GNUNET_ATS_Information *atsi, 72 const struct GNUNET_ATS_Information *atsi,
74 uint32_t atsi_count, 73 uint32_t atsi_count,