towards reviving priorities in core API, this time with enum to make classes clearer
authorChristian Grothoff <christian@grothoff.org>
Thu, 30 Jan 2014 18:24:13 +0000 (18:24 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 30 Jan 2014 18:24:13 +0000 (18:24 +0000)
16 files changed:
src/ats-tests/ats-testing-traffic.c
src/core/core_api.c
src/core/gnunet-service-core.h
src/core/gnunet-service-core_clients.c
src/core/test_core_api.c
src/core/test_core_api_reliability.c
src/core/test_core_quota_compliance.c
src/dht/gnunet-service-dht_neighbours.c
src/dv/gnunet-service-dv.c
src/experimentation/gnunet-daemon-experimentation_nodes.c
src/fs/gnunet-service-fs_cp.c
src/hostlist/hostlist-server.c
src/include/gnunet_core_service.h
src/mesh/gnunet-service-mesh_peer.c
src/nse/gnunet-service-nse.c
src/topology/gnunet-daemon-topology.c

index 9163d2cd1c9d7cbe2093749ea3f729e16b889348..ecee768169367e7f3e18c23e0dd2ea4f8eb02c27 100644 (file)
@@ -104,7 +104,9 @@ comm_schedule_send (void *cls,
   if (GNUNET_YES == top->test_core)
   {
     p->cth = GNUNET_CORE_notify_transmit_ready (
-      p->me->ch, GNUNET_NO, 0, GNUNET_TIME_UNIT_MINUTES, &p->dest->id,
+      p->me->ch, GNUNET_NO,
+      GNUNET_CORE_PRIO_BEST_EFFORT,
+      GNUNET_TIME_UNIT_MINUTES, &p->dest->id,
       TEST_MESSAGE_SIZE, &send_ping_ready_cb, p);
   }
   else
@@ -159,9 +161,12 @@ GNUNET_ATS_TEST_traffic_handle_ping (struct BenchmarkPartner *p)
   {
     GNUNET_assert (NULL == p->cth);
 
-    p->cth = GNUNET_CORE_notify_transmit_ready (p->me->ch, GNUNET_NO, 0,
-        GNUNET_TIME_UNIT_MINUTES, &p->dest->id, TEST_MESSAGE_SIZE,
-        &comm_send_pong_ready, p);
+    p->cth
+      = GNUNET_CORE_notify_transmit_ready (p->me->ch, GNUNET_NO,
+                                           GNUNET_CORE_PRIO_BEST_EFFORT,
+                                           GNUNET_TIME_UNIT_MINUTES,
+                                           &p->dest->id, TEST_MESSAGE_SIZE,
+                                           &comm_send_pong_ready, p);
   }
   else
   {
index c69e3fe1d8a9b37241349b35006b9bb9a9509020..56bd29df3dbf755d1501afd2d3bdff6d94832fdf 100644 (file)
@@ -71,7 +71,7 @@ struct GNUNET_CORE_TransmitHandle
   /**
    * How important is this message?
    */
-  uint32_t priority;
+  enum GNUNET_CORE_Priority priority;
 
   /**
    * Size of this request.
@@ -517,7 +517,7 @@ request_next_transmission (struct PeerRecord *pr)
   smr = (struct SendMessageRequest *) &cm[1];
   smr->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND_REQUEST);
   smr->header.size = htons (sizeof (struct SendMessageRequest));
-  smr->priority = htonl (th->priority);
+  smr->priority = htonl ((uint32_t) th->priority);
   smr->deadline = GNUNET_TIME_absolute_hton (th->timeout);
   smr->peer = pr->peer;
   smr->reserved = htonl (0);
@@ -653,7 +653,7 @@ transmit_message (void *cls, size_t size, void *buf)
        GNUNET_i2s (&pr->peer), (unsigned int) th->msize);
   sm = (struct SendMessage *) buf;
   sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND);
-  sm->priority = htonl (th->priority);
+  sm->priority = htonl ((uint32_t) th->priority);
   sm->deadline = GNUNET_TIME_absolute_hton (th->timeout);
   sm->peer = pr->peer;
   sm->cork = htonl ((uint32_t) th->cork);
@@ -1187,7 +1187,7 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
 
 /**
  * Disconnect from the core service.  This function can only
- * be called *after* all pending 'GNUNET_CORE_notify_transmit_ready'
+ * be called *after* all pending #GNUNET_CORE_notify_transmit_ready()
  * requests have been explicitly canceled.
  *
  * @param handle connection to core to disconnect
@@ -1279,7 +1279,7 @@ run_request_next_transmission (void *cls,
  */
 struct GNUNET_CORE_TransmitHandle *
 GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
-                                   uint32_t priority,
+                                   enum GNUNET_CORE_Priority priority,
                                    struct GNUNET_TIME_Relative maxdelay,
                                    const struct GNUNET_PeerIdentity *target,
                                    size_t notify_size,
@@ -1289,9 +1289,6 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
   struct PeerRecord *pr;
   struct GNUNET_CORE_TransmitHandle *th;
 
-  GNUNET_assert (NULL != handle);
-  GNUNET_assert (NULL != target);
-
   if (notify_size > GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
   {
      GNUNET_break (0);
@@ -1329,7 +1326,8 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task);
   pr->ntr_task =
     GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr);
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmission request added to queue\n");
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Transmission request added to queue\n");
   return th;
 }
 
index e48ad8badbadde02ab5b2e1a99e362130ad66901..8d3e8ee2ac2f68e0310349d9d013c41447dba178 100644 (file)
@@ -27,6 +27,7 @@
 #define GNUNET_SERVICE_CORE_H
 
 #include "gnunet_statistics_service.h"
+#include "gnunet_core_service.h"
 #include "core.h"
 
 /**
@@ -73,7 +74,7 @@ struct GSC_ClientActiveRequest
   /**
    * How important is this request.
    */
-  uint32_t priority;
+  enum GNUNET_CORE_Priority priority;
 
   /**
    * Has this request been solicited yet?
index f6574b7f9395b69dcf069e914f0b188d87515379..f153ac397088a68d86a72fca3187ce64f5802a3f 100644 (file)
@@ -374,7 +374,7 @@ handle_client_send_request (void *cls, struct GNUNET_SERVER_Client *client,
   }
 
   car = GNUNET_CONTAINER_multipeermap_get (c->requests, &req->peer);
-  if (car == NULL)
+  if (NULL == car)
   {
     /* create new entry */
     car = GNUNET_new (struct GSC_ClientActiveRequest);
@@ -391,7 +391,7 @@ handle_client_send_request (void *cls, struct GNUNET_SERVER_Client *client,
   }
   car->target = req->peer;
   car->deadline = GNUNET_TIME_absolute_ntoh (req->deadline);
-  car->priority = ntohl (req->priority);
+  car->priority = (enum GNUNET_CORE_Priority) ntohl (req->priority);
   car->msize = ntohs (req->size);
   car->smr_id = req->smr_id;
   car->was_solicited = GNUNET_NO;
@@ -503,7 +503,7 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
  * or other CLIENT (for loopback).
  *
  * @param cls closure
- * @param client reservation request ('struct GSC_ClientActiveRequest')
+ * @param client reservation request (`struct GSC_ClientActiveRequest`)
  * @param message the actual message
  */
 static int
@@ -560,7 +560,7 @@ client_tokenizer_callback (void *cls, void *client,
  *
  * @param cls NULL
  * @param key identity of peer for which this is an active request
- * @param value the 'struct GSC_ClientActiveRequest' to free
+ * @param value the `struct GSC_ClientActiveRequest` to free
  * @return #GNUNET_YES (continue iteration)
  */
 static int
index af2b98e4189075a6d5db01e34e4239301d9ac30b..b3674fdec094d5991a567619451245d27538f56a 100644 (file)
@@ -174,7 +174,8 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
                 "Asking core (1) for transmission to peer `%4s'\n",
                 GNUNET_i2s (&p2.id));
     if (NULL ==
-        GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_YES, 0,
+        GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_YES,
+                                           GNUNET_CORE_PRIO_BEST_EFFORT,
                                            GNUNET_TIME_relative_multiply
                                            (GNUNET_TIME_UNIT_SECONDS, 145),
                                            &p2.id,
index 97006fe9502bee4a931bc8cf0b9b8a3ee1064800..cb05fa9e5b06343ebb1a276329c2761794aea0f1 100644 (file)
@@ -189,7 +189,8 @@ transmit_ready (void *cls, size_t size, void *buf)
   {
     if (p1.ch != NULL)
       GNUNET_break (NULL !=
-                    GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                    GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                       GNUNET_CORE_PRIO_BEST_EFFORT,
                                                        FAST_TIMEOUT, &p2.id,
                                                        get_size (tr_n),
                                                        &transmit_ready, &p1));
@@ -250,7 +251,8 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
         GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
     start_time = GNUNET_TIME_absolute_get ();
     GNUNET_break (NULL !=
-                  GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                  GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                     GNUNET_CORE_PRIO_BEST_EFFORT,
                                                      TIMEOUT, &p2.id,
                                                      get_size (0),
                                                      &transmit_ready, &p1));
@@ -340,7 +342,8 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
   {
     if (n == tr_n)
       GNUNET_break (NULL !=
-                    GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                    GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                       GNUNET_CORE_PRIO_BEST_EFFORT,
                                                        FAST_TIMEOUT, &p2.id,
                                                        get_size (tr_n),
                                                        &transmit_ready, &p1));
index 91ba1d621ec61e5ca6a2d83c613688fd1ac8bfb1..0e74fbef50e442f29cdf4b30d266b7e774a93400 100644 (file)
@@ -325,7 +325,8 @@ transmit_ready (void *cls, size_t size, void *buf)
     if ((p1.ch != NULL) && (p1.connect_status == 1))
       GNUNET_break (NULL !=
                     (p1.nth =
-                     GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                     GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                        GNUNET_CORE_PRIO_BEST_EFFORT,
                                                         FAST_TIMEOUT, &p2.id,
                                                         MESSAGESIZE,
                                                         &transmit_ready, &p1)));
@@ -392,7 +393,8 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
 
     GNUNET_break (NULL !=
                   (p1.nth =
-                   GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                   GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                      GNUNET_CORE_PRIO_BEST_EFFORT,
                                                       TIMEOUT, &p2.id,
                                                       MESSAGESIZE,
                                                       &transmit_ready, &p1)));
@@ -488,7 +490,8 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
 
   if (running == GNUNET_YES)
     GNUNET_break (NULL !=
-                  GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO, 0,
+                  GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
+                                                     GNUNET_CORE_PRIO_BEST_EFFORT,
                                                      FAST_TIMEOUT, &p2.id,
                                                      MESSAGESIZE,
                                                      &transmit_ready, &p1));
index d15af4ee6f552d064921c3fc43fff1576a3be0f7..25aa0c7b566bb99bba31141fb6ce97c80e1a7637 100644 (file)
@@ -793,16 +793,16 @@ core_transmit_notify (void *cls, size_t size, void *buf)
     GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, pending);
     GNUNET_free (pending);
   }
-  if (pending == NULL)
+  if (NULL == pending)
   {
     /* no messages pending */
     return 0;
   }
-  if (buf == NULL)
+  if (NULL == buf)
   {
     peer->th =
         GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
-                                           pending->importance,
+                                           GNUNET_CORE_PRIO_BEST_EFFORT,
                                            GNUNET_TIME_absolute_get_remaining
                                            (pending->timeout), &peer->id,
                                            ntohs (pending->msg->size),
@@ -828,7 +828,7 @@ core_transmit_notify (void *cls, size_t size, void *buf)
   {
     peer->th =
         GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
-                                           pending->importance,
+                                           GNUNET_CORE_PRIO_BEST_EFFORT,
                                            GNUNET_TIME_absolute_get_remaining
                                            (pending->timeout), &peer->id, msize,
                                            &core_transmit_notify, peer);
@@ -858,7 +858,7 @@ process_peer_queue (struct PeerInfo *peer)
                             ntohs (pending->msg->size), GNUNET_NO);
   peer->th =
       GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
-                                         pending->importance,
+                                         GNUNET_CORE_PRIO_BEST_EFFORT,
                                          GNUNET_TIME_absolute_get_remaining
                                          (pending->timeout), &peer->id,
                                          ntohs (pending->msg->size),
@@ -2224,4 +2224,4 @@ GDS_NEIGHBOURS_get_id ()
 }
 
 
-/* end of gnunet-service-dht_neighbours.c */
\ No newline at end of file
+/* end of gnunet-service-dht_neighbours.c */
index 70a55494cabb155338ec3eb3268c8facde509f4b..a3d6e4942fc849a5c76e49326995c4db0818d2e9 100644 (file)
@@ -637,7 +637,7 @@ core_transmit_notify (void *cls, size_t size, void *buf)
     dn->cth =
       GNUNET_CORE_notify_transmit_ready (core_api,
                                         GNUNET_YES /* cork */,
-                                        0 /* priority */,
+                                        GNUNET_CORE_PRIO_BEST_EFFORT,
                                         GNUNET_TIME_UNIT_FOREVER_REL,
                                         &dn->peer,
                                         msize,
@@ -705,7 +705,7 @@ forward_payload (struct DirectNeighbor *target,
   if (NULL == target->cth)
     target->cth = GNUNET_CORE_notify_transmit_ready (core_api,
                                                     GNUNET_YES /* cork */,
-                                                    0 /* priority */,
+                                                    GNUNET_CORE_PRIO_BEST_EFFORT,
                                                     GNUNET_TIME_UNIT_FOREVER_REL,
                                                     &target->peer,
                                                     msize,
index 65b2d9c38d0a854fb39ef445d144f8c3b212c553..1c4152793e7ee5bdb07216d49b691726095a6bd5 100644 (file)
@@ -210,7 +210,9 @@ schedule_transmisson (struct NodeComCtx *e_ctx)
   if (NULL != e_ctx->n->cth)
     return;
 
-  e_ctx->n->cth = GNUNET_CORE_notify_transmit_ready (ch, GNUNET_NO, 0, FAST_TIMEOUT,
+  e_ctx->n->cth = GNUNET_CORE_notify_transmit_ready (ch, GNUNET_NO,
+                                                     GNUNET_CORE_PRIO_BEST_EFFORT,
+                                                     FAST_TIMEOUT,
                                                     &e_ctx->n->id, e_ctx->size,
                                                     transmit_read_wrapper, e_ctx);
   if (NULL == e_ctx->n->cth)
@@ -281,7 +283,7 @@ send_experimentation_request_cb (void *cls, size_t bufsize, void *buf)
   size_t ri_size = sizeof (struct GNUNET_CRYPTO_EddsaPublicKey) * my_issuer_count;
   size_t total_size = msg_size + ri_size;
   struct GNUNET_CRYPTO_EddsaPublicKey *issuers;
-       
+
   n->cth = NULL;
   if (NULL == buf)
   {
index a586ea50356fe354a448ab0056b5d016244fe621..82b1f5867db390195821dd130191aa1fde0b9a2e 100644 (file)
@@ -268,7 +268,7 @@ struct GSF_ConnectedPeer
 
   /**
    * Set to 1 if we're currently in the process of calling
-   * 'GNUNET_CORE_notify_transmit_ready' (so while cth is
+   * #GNUNET_CORE_notify_transmit_ready() (so while cth is
    * NULL, we should not call notify_transmit_ready for this
    * handle right now).
    */
@@ -439,7 +439,8 @@ schedule_transmission (struct GSF_PeerTransmitHandle *pth)
   GNUNET_assert (NULL == cp->cth);
   cp->cth_in_progress++;
   cp->cth =
-    GNUNET_CORE_notify_transmit_ready (GSF_core, GNUNET_YES, pth->priority,
+    GNUNET_CORE_notify_transmit_ready (GSF_core, GNUNET_YES,
+                                       GNUNET_CORE_PRIO_BACKGROUND,
                                       GNUNET_TIME_absolute_get_remaining
                                       (pth->timeout), &target, pth->size,
                                       &peer_transmit_ready_cb, cp);
@@ -558,7 +559,8 @@ ats_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
     /* reservation success, try transmission now! */
     cp->cth_in_progress++;
     cp->cth =
-        GNUNET_CORE_notify_transmit_ready (GSF_core, GNUNET_YES, pth->priority,
+        GNUNET_CORE_notify_transmit_ready (GSF_core, GNUNET_YES,
+                                           GNUNET_CORE_PRIO_BACKGROUND,
                                            GNUNET_TIME_absolute_get_remaining
                                            (pth->timeout), peer, pth->size,
                                            &peer_transmit_ready_cb, cp);
index ef4debc056290c4783b2ca9ac4d9a9ed5f848eea..2564991d5c22a4c7848cb588a1095320157210b8 100644 (file)
@@ -381,7 +381,8 @@ connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer)
               "Asked core to transmit advertisement message with a size of %u bytes to peer `%s'\n",
               size, GNUNET_i2s (peer));
   if (NULL ==
-      GNUNET_CORE_notify_transmit_ready (core, GNUNET_YES, 0,
+      GNUNET_CORE_notify_transmit_ready (core, GNUNET_YES,
+                                         GNUNET_CORE_PRIO_BEST_EFFORT,
                                          GNUNET_ADV_TIMEOUT, peer, size,
                                          &adv_transmit_ready, NULL))
   {
index 4eca0cc03994779b6f60fb8e175d328f4c3762e3..6c68a68334f05d46e80eaedff56c9927cb044ac2 100644 (file)
@@ -46,6 +46,34 @@ extern "C"
  */
 #define GNUNET_CORE_VERSION 0x00000001
 
+/**
+ * Traffic priorities.
+ */
+enum GNUNET_CORE_Priority
+{
+
+  /**
+   * Highest priority, control traffic (i.e. NSE, Core/Mesh KX).
+   */
+  GNUNET_CORE_PRIO_CRITICAL_CONTROL = 0,
+
+  /**
+   * Urgent traffic (local peer, i.e. conversation).
+   */
+  GNUNET_CORE_PRIO_URGENT = 1,
+
+  /**
+   * Normal traffic (i.e. mesh/dv relay, DHT)
+   */
+  GNUNET_CORE_PRIO_BEST_EFFORT = 2,
+
+  /**
+   * Background traffic (i.e. fs)
+   */
+  GNUNET_CORE_PRIO_BACKGROUND = 3
+
+};
+
 
 /**
  * Opaque handle to the service.
@@ -59,8 +87,9 @@ struct GNUNET_CORE_Handle;
  * @param cls closure
  * @param peer peer identity this notification is about
  */
-typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls,
-                                                 const struct GNUNET_PeerIdentity *peer);
+typedef void
+(*GNUNET_CORE_ConnectEventHandler) (void *cls,
+                                    const struct GNUNET_PeerIdentity *peer);
 
 
 /**
@@ -69,8 +98,9 @@ typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls,
  * @param cls closure
  * @param peer peer identity this notification is about
  */
-typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls,
-                                                    const struct GNUNET_PeerIdentity *peer);
+typedef void
+(*GNUNET_CORE_DisconnectEventHandler) (void *cls,
+                                       const struct GNUNET_PeerIdentity *peer);
 
 
 /**
@@ -84,11 +114,10 @@ typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls,
  * @return #GNUNET_OK to keep the connection open,
  *         #GNUNET_SYSERR to close connection to the peer (signal serious error)
  */
-typedef int (*GNUNET_CORE_MessageCallback) (void *cls,
-                                            const struct GNUNET_PeerIdentity *
-                                            other,
-                                            const struct GNUNET_MessageHeader *
-                                            message);
+typedef int
+(*GNUNET_CORE_MessageCallback) (void *cls,
+                                const struct GNUNET_PeerIdentity *other,
+                                const struct GNUNET_MessageHeader *message);
 
 
 /**
@@ -98,7 +127,7 @@ typedef int (*GNUNET_CORE_MessageCallback) (void *cls,
 struct GNUNET_CORE_MessageHandler
 {
   /**
-   * Function to call for messages of "type".
+   * Function to call for messages of @e type.
    */
   GNUNET_CORE_MessageCallback callback;
 
@@ -129,8 +158,9 @@ struct GNUNET_CORE_MessageHandler
  * @param cls closure
  * @param my_identity ID of this peer, NULL if we failed
  */
-typedef void (*GNUNET_CORE_StartupCallback) (void *cls,
-                                             const struct GNUNET_PeerIdentity *my_identity);
+typedef void
+(*GNUNET_CORE_StartupCallback) (void *cls,
+                                const struct GNUNET_PeerIdentity *my_identity);
 
 
 /**
@@ -233,8 +263,9 @@ struct GNUNET_CORE_TransmitHandle;
  *         if NULL is returned, "notify" will NOT be called.
  */
 struct GNUNET_CORE_TransmitHandle *
-GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
-                                   uint32_t priority,
+GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
+                                   int cork,
+                                   enum GNUNET_CORE_Priority priority,
                                    struct GNUNET_TIME_Relative maxdelay,
                                    const struct GNUNET_PeerIdentity *target,
                                    size_t notify_size,
index 3e4c2acabd48c2bfb70b61a694c86561aaeda8c2..7d499f953f5ca98579a3273753b1cc1bc1d1b963 100644 (file)
@@ -838,7 +838,7 @@ queue_send (void *cls, size_t size, void *buf)
       peer->core_transmit =
           GNUNET_CORE_notify_transmit_ready (core_handle,
                                              GNUNET_NO,
-                                             0,
+                                             GNUNET_CORE_PRIO_CRITICAL_CONTROL,
                                              GNUNET_TIME_UNIT_FOREVER_REL,
                                              dst_id,
                                              queue->size,
@@ -910,7 +910,8 @@ queue_send (void *cls, size_t size, void *buf)
     {
       peer->core_transmit =
           GNUNET_CORE_notify_transmit_ready (core_handle,
-                                             GNUNET_NO, 0,
+                                             GNUNET_NO,
+                                             GNUNET_CORE_PRIO_CRITICAL_CONTROL,
                                              GNUNET_TIME_UNIT_FOREVER_REL,
                                              dst_id,
                                              queue->size,
@@ -1079,7 +1080,7 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size,
     peer->core_transmit =
         GNUNET_CORE_notify_transmit_ready (core_handle,
                                            GNUNET_NO,
-                                           0,
+                                           GNUNET_CORE_PRIO_CRITICAL_CONTROL,
                                            GNUNET_TIME_UNIT_FOREVER_REL,
                                            GNUNET_PEER_resolve2 (peer->id),
                                            size,
@@ -1196,7 +1197,7 @@ GMP_queue_unlock (struct MeshPeer *peer, struct MeshConnection *c)
   peer->core_transmit =
       GNUNET_CORE_notify_transmit_ready (core_handle,
                                          GNUNET_NO,
-                                         0,
+                                         GNUNET_CORE_PRIO_CRITICAL_CONTROL,
                                          GNUNET_TIME_UNIT_FOREVER_REL,
                                          GNUNET_PEER_resolve2 (peer->id),
                                          size,
index 3cda2b114c7cdaec89da807a84cde732a7eb1a7a..7ad08a9178c60ada6e6e0f1bfd5d961627e9297c 100644 (file)
@@ -70,7 +70,7 @@
 /**
  * Message priority to use.
  */
-#define NSE_PRIORITY 5
+#define NSE_PRIORITY GNUNET_CORE_PRIO_CRITICAL_CONTROL
 
 #if FREEBSD
 #define log2(a) (log(a)/log(2))
@@ -660,7 +660,8 @@ transmit_task_cb (void *cls,
 
   GNUNET_assert (NULL == peer_entry->th);
   peer_entry->th =
-      GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO, NSE_PRIORITY,
+      GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
+                                         NSE_PRIORITY,
                                          GNUNET_TIME_UNIT_FOREVER_REL,
                                          &peer_entry->id,
                                          sizeof (struct
index e4e9808e43fca36898b82afff96cb125091bebf4..db9177be8f01cbe65931d0ad0f8cb6cb18e52e1d 100644 (file)
@@ -641,7 +641,8 @@ schedule_next_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   {
     /* now! */
     pl->hello_req =
-        GNUNET_CORE_notify_transmit_ready (handle, GNUNET_YES, 0,
+        GNUNET_CORE_notify_transmit_ready (handle, GNUNET_YES,
+                                           GNUNET_CORE_PRIO_BEST_EFFORT,
                                            GNUNET_CONSTANTS_SERVICE_TIMEOUT,
                                            &pl->pid, next_want,
                                            &hello_advertising_ready, pl);