simplify api
authorChristian Grothoff <christian@grothoff.org>
Fri, 3 Jun 2011 20:43:37 +0000 (20:43 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 3 Jun 2011 20:43:37 +0000 (20:43 +0000)
src/core/gnunet-service-core.c
src/transport/test_quota_compliance.c
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_unreliability.c
src/transport/transport_api.c

index 1331fce2566840e3621c1d32d43396125734e0d9..7053cc6033f3523ee9db11e6d391d1c2c7fe3549 100644 (file)
@@ -1611,9 +1611,7 @@ handle_client_request_info (void *cls,
              GNUNET_TRANSPORT_set_quota (transport,
                                          &n->peer,
                                          n->bw_in,
-                                         n->bw_out,
-                                         GNUNET_TIME_UNIT_FOREVER_REL,
-                                         NULL, NULL); 
+                                         n->bw_out);
              handle_peer_status_change (n);
            }
        }
@@ -3704,9 +3702,7 @@ handle_pong (struct Neighbour *n,
          GNUNET_TRANSPORT_set_quota (transport,
                                      &n->peer,
                                      n->bw_in,
-                                     n->bw_out,
-                                     GNUNET_TIME_UNIT_FOREVER_REL,
-                                     NULL, NULL); 
+                                     n->bw_out);
        }
 #if DEBUG_CORE
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -4226,9 +4222,7 @@ handle_encrypted_message (struct Neighbour *n,
       GNUNET_TRANSPORT_set_quota (transport,
                                  &n->peer,
                                  n->bw_in,
-                                 n->bw_out,
-                                 GNUNET_TIME_UNIT_FOREVER_REL,
-                                 NULL, NULL); 
+                                 n->bw_out);
     }
   n->last_activity = GNUNET_TIME_absolute_get ();
   if (n->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
@@ -4509,9 +4503,7 @@ neighbour_quota_update (void *cls,
        GNUNET_TRANSPORT_set_quota (transport,
                                    &n->peer,
                                    n->bw_in,
-                                   n->bw_out,
-                                   GNUNET_TIME_UNIT_FOREVER_REL,
-                                   NULL, NULL);
+                                   n->bw_out);
       handle_peer_status_change (n);
     }
   schedule_quota_update (n);
@@ -4574,9 +4566,7 @@ handle_transport_notify_connect (void *cls,
   GNUNET_TRANSPORT_set_quota (transport,
                              &n->peer,
                              n->bw_in,
-                             n->bw_out,
-                             GNUNET_TIME_UNIT_FOREVER_REL,
-                             NULL, NULL);
+                             n->bw_out);
   send_key (n); 
 }
 
index d8ac5eab3a19464bc7f17a84dba0e93ddd2101f2..1f4d21fc8d526cacd9a38a0740a8ec3f6ce94fb8 100644 (file)
@@ -516,18 +516,13 @@ static void measure (unsigned long long quota_p1, unsigned long long quota_p2 )
 
 #endif
                GNUNET_TRANSPORT_set_quota (p1.th,
-                         &p2.id,
-                         GNUNET_BANDWIDTH_value_init (current_quota_p1 ),
-                         GNUNET_BANDWIDTH_value_init (current_quota_p1 ),
-                         GNUNET_TIME_UNIT_FOREVER_REL,
-                         NULL, NULL);
+                                           &p2.id,
+                                           GNUNET_BANDWIDTH_value_init (current_quota_p1),
+                                           GNUNET_BANDWIDTH_value_init (current_quota_p1));
                GNUNET_TRANSPORT_set_quota (p2.th,
-                         &p1.id,
-                         GNUNET_BANDWIDTH_value_init (current_quota_p2),
-                         GNUNET_BANDWIDTH_value_init (current_quota_p2),
-                         GNUNET_TIME_UNIT_FOREVER_REL,
-                         NULL, NULL);
-
+                                           &p1.id,
+                                           GNUNET_BANDWIDTH_value_init (current_quota_p2),
+                                           GNUNET_BANDWIDTH_value_init (current_quota_p2));
                GNUNET_SCHEDULER_cancel (die_task);
                die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
                                                   &end_badly,
index 17007ab8856e754d4854e9416d8a903867ddb633..2d44167d4e58f66fd079a217c537a60fc39d3e36 100644 (file)
@@ -341,9 +341,7 @@ notify_connect (void *cls,
       GNUNET_TRANSPORT_set_quota (p1.th,
                                  &p2.id,
                                  GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_TIME_UNIT_FOREVER_REL,
-                                 NULL, NULL);
+                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
       start_time = GNUNET_TIME_absolute_get ();
       connected++;
     }
@@ -352,9 +350,7 @@ notify_connect (void *cls,
       GNUNET_TRANSPORT_set_quota (p2.th,
                                  &p1.id,
                                  GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_TIME_UNIT_FOREVER_REL,
-                                 NULL, NULL);
+                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
       connected++;
     }
 
index 929e88b1c386fa33bde0013f7206298e726a4e32..d27a5193e8eaeee3f015a3ab5db874aa16658f6d 100644 (file)
@@ -438,9 +438,7 @@ notify_connect (void *cls,
       GNUNET_TRANSPORT_set_quota (p1.th,
                                  &p2.id,
                                  GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_TIME_UNIT_FOREVER_REL,
-                                 NULL, NULL);
+                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
       start_time = GNUNET_TIME_absolute_get ();
       connected++;
     }
@@ -449,9 +447,7 @@ notify_connect (void *cls,
       GNUNET_TRANSPORT_set_quota (p2.th,
                                  &p1.id,
                                  GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
-                                 GNUNET_TIME_UNIT_FOREVER_REL,
-                                 NULL, NULL);
+                                 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
       connected++;
     }
 
index 0fc1bb8ef7f8882126cc7b881cff709b1b96e480..ef846c147164f2270671a4b0bdaa2eb72411d599 100644 (file)
@@ -925,19 +925,12 @@ send_set_quota (void *cls, size_t size, void *buf)
  * @param target who's bandwidth quota is being changed
  * @param quota_in incoming bandwidth quota in bytes per ms
  * @param quota_out outgoing bandwidth quota in bytes per ms
- * @param timeout how long to wait until signaling failure if
- *        we can not communicate the quota change
- * @param cont continuation to call when done, will be called
- *        either with reason "TIMEOUT" or with reason "PREREQ_DONE"
- * @param cont_cls closure for continuation
  */
 void
 GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
                             const struct GNUNET_PeerIdentity *target,
                             struct GNUNET_BANDWIDTH_Value32NBO quota_in,
-                            struct GNUNET_BANDWIDTH_Value32NBO quota_out,
-                            struct GNUNET_TIME_Relative timeout,
-                            GNUNET_SCHEDULER_Task cont, void *cont_cls)
+                            struct GNUNET_BANDWIDTH_Value32NBO quota_out)
 {
   struct NeighbourList *n;
   struct SetQuotaContext *sqc;
@@ -973,9 +966,9 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
   sqc = GNUNET_malloc (sizeof (struct SetQuotaContext));
   sqc->handle = handle;
   sqc->target = *target;
-  sqc->cont = cont;
-  sqc->cont_cls = cont_cls;
-  sqc->timeout = GNUNET_TIME_relative_to_absolute (timeout);
+  sqc->cont = NULL;
+  sqc->cont_cls = NULL;
+  sqc->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_FOREVER_REL);
   sqc->quota_in = quota_in;
   schedule_control_transmit (handle,
                              sizeof (struct QuotaSetMessage),