remove limit_outbound, DCE
authorChristian Grothoff <christian@grothoff.org>
Mon, 10 Oct 2011 08:38:39 +0000 (08:38 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 10 Oct 2011 08:38:39 +0000 (08:38 +0000)
src/core/core.h
src/core/core_api.c
src/core/gnunet-service-core_neighbours.c
src/core/gnunet-service-core_sessions.c

index a1854ccb40b32a906399043f98db0c6ae80aff70..f57d2b59782cf00c0de562912245064bf35cc2cc 100644 (file)
@@ -255,11 +255,9 @@ struct RequestInfoMessage
   uint32_t rim_id GNUNET_PACKED;
 
   /**
-   * Limit the number of bytes of outbound traffic to this
-   * peer to at most the specified amount (naturally, the
-   * amount is also limited by the receiving peer).
+   * Reserved, always zero.
    */
-  struct GNUNET_BANDWIDTH_Value32NBO limit_outbound;
+  uint32_t reserved GNUNET_PACKED;
 
   /**
    * Number of bytes of inbound traffic to reserve, can
index 91368ffc3fa81b8ebfdbe9947a4bf2dfca49b3d3..c740f593c4e18c544b8bf758eac883a32c09c7e0 100644 (file)
@@ -1722,7 +1722,7 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h,
   rim->header.size = htons (sizeof (struct RequestInfoMessage));
   rim->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO);
   rim->rim_id = htonl (pr->rim_id = h->rim_id_gen++);
-  rim->limit_outbound = GNUNET_BANDWIDTH_VALUE_MAX; // FIXME: remove entirely soon...
+  rim->reserved = htonl (0);
   rim->reserve_inbound = htonl (amount);
   rim->preference_change = GNUNET_htonll (preference);
   rim->peer = *peer;
index c3456ccf4c96e9decab45533e8236483102abed5..774c173dca6d1056f5116d43d545b7812f4ecc17 100644 (file)
@@ -113,11 +113,6 @@ struct Neighbour
    */
   GNUNET_SCHEDULER_TaskIdentifier retry_plaintext_task;
 
-  /**
-   * Tracking bandwidth for sending to this peer.
-   */
-  struct GNUNET_BANDWIDTH_Tracker available_send_window;
-
   /**
    * Tracking bandwidth for sending to this peer.
    */
@@ -251,7 +246,6 @@ transmit_ready (void *cls, size_t size, void *buf)
   GNUNET_assert (size >= m->size);
   memcpy (cbuf, &m[1], m->size);
   ret = m->size;
-  GNUNET_BANDWIDTH_tracker_consume (&n->available_send_window, m->size);
 #if DEBUG_CORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Copied message of type %u and size %u into transport buffer for `%4s'\n",
@@ -351,9 +345,6 @@ handle_transport_notify_connect (void *cls,
 #endif
   n = GNUNET_malloc (sizeof (struct Neighbour));
   n->peer = *peer;
-  GNUNET_BANDWIDTH_tracker_init (&n->available_send_window, 
-                                GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
-                                 MAX_WINDOW_TIME_S);
   GNUNET_BANDWIDTH_tracker_init (&n->available_recv_window, 
                                 GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
                                  MAX_WINDOW_TIME_S);
index 93f9b69508b2c02f1a38c35781d02642a86fc6de..6ab97d7d09bb1ce17b5a6c6e5619c79d9518abe3 100644 (file)
@@ -121,12 +121,6 @@ struct Session
    */
   GNUNET_SCHEDULER_TaskIdentifier cork_task;
 
-  /**
-   * Tracking bandwidth for sending to this peer.
-   * // FIXME: unused! should it be used?
-   */
-  struct GNUNET_BANDWIDTH_Tracker available_send_window;
-
   /**
    * Tracking bandwidth for receiving from this peer.
    * // FIXME: need to set it!
@@ -134,15 +128,19 @@ struct Session
   struct GNUNET_BANDWIDTH_Tracker available_recv_window;
 
   /**
-   * Available bandwidth out for this peer (current target).
-   * // FIXME: check usage!
+   * Available bandwidth out for this peer (current target).  This
+   * value should be the 'MIN' of 'bw_out_internal_limit' and
+   * 'bw_out_external_limit'.
    */
   struct GNUNET_BANDWIDTH_Value32NBO bw_out;
 
   /**
    * Internal bandwidth limit set for this peer (initially typically
-   * set to "-1").  Actual "bw_out" is MIN of
+   * set to "MAX_INT").  Actual "bw_out" is MIN of
    * "bpm_out_internal_limit" and "bw_out_external_limit".
+   *
+   * 
+   *
    * // FIXME: check usage
    */
   struct GNUNET_BANDWIDTH_Value32NBO bw_out_internal_limit;
@@ -773,26 +771,6 @@ GSC_SESSIONS_handle_client_request_info (void *cls, struct GNUNET_SERVER_Client
   }
 
   want_reserv = ntohl (rcm->reserve_inbound);
-  if (session->bw_out_internal_limit.value__ != rcm->limit_outbound.value__)
-  {
-    session->bw_out_internal_limit = rcm->limit_outbound;
-    if (session->bw_out.value__ !=
-       GNUNET_BANDWIDTH_value_min (session->bw_out_internal_limit,
-                                   session->bw_out_external_limit).value__)
-    {
-      session->bw_out =
-       GNUNET_BANDWIDTH_value_min (session->bw_out_internal_limit,
-                                   session->bw_out_external_limit);
-      GNUNET_BANDWIDTH_tracker_update_quota (&session->available_recv_window,
-                                            session->bw_out);
-#if 0
-      // FIXME: who does this?
-      GNUNET_TRANSPORT_set_quota (transport, &session->peer, 
-                                 session->bw_in, 
-                                 session->bw_out);
-#endif
-    }
-  }
   if (want_reserv < 0)
   {
     got_reserv = want_reserv;