add cork option to core api:
authorChristian Grothoff <christian@grothoff.org>
Fri, 11 Mar 2011 12:44:06 +0000 (12:44 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 11 Mar 2011 12:44:06 +0000 (12:44 +0000)
src/chat/gnunet-service-chat.c
src/core/core_api.c
src/dht/gnunet-service-dht.c
src/dv/gnunet-service-dv.c
src/fs/gnunet-service-fs.c
src/fs/gnunet-service-fs_cp.c
src/hostlist/hostlist-server.c
src/include/gnunet_core_service.h
src/mesh/mesh_api.c
src/topology/gnunet-daemon-topology.c

index bbf4dd8f117edcb0294472f33cfeaf048b14d21c..a1e180009ffd5b447c2cbb4e682051721ee1f7f1 100644 (file)
@@ -262,6 +262,7 @@ send_message_noficiation (void *cls,
 #endif
   my_msg = GNUNET_memdup (msg, ntohs (msg->header.size));
   if (NULL == GNUNET_CORE_notify_transmit_ready (core,
+                                                GNUNET_NO,
                                                  1,
                                                  MAX_TRANSMIT_DELAY,
                                                  &pid,
@@ -553,6 +554,7 @@ send_join_noficiation (void *cls,
     strlen (entry->room) + 
     entry->meta_len;
   if (NULL == GNUNET_CORE_notify_transmit_ready (core,
+                                                GNUNET_NO,
                                                  1,
                                                  MAX_TRANSMIT_DELAY,
                                                  &pid,
@@ -750,6 +752,7 @@ send_confirmation_receipt (void *cls,
   my_receipt = GNUNET_memdup (receipt,
                               sizeof (struct P2PConfirmationReceiptMessage));
   if (NULL == GNUNET_CORE_notify_transmit_ready (core,
+                                                GNUNET_YES,
                                                  1,
                                                  MAX_TRANSMIT_DELAY,
                                                  &pid,
@@ -936,6 +939,7 @@ send_leave_noficiation (void *cls,
   public_key = GNUNET_memdup (&entry->public_key,
                               sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded));
   if (NULL == GNUNET_CORE_notify_transmit_ready (core,
+                                                GNUNET_YES,
                                                  1,
                                                  MAX_TRANSMIT_DELAY,
                                                  &pid,
@@ -1408,6 +1412,7 @@ handle_p2p_sync_request (void *cls,
         strlen (entry->room) + 
         entry->meta_len;
       th = GNUNET_CORE_notify_transmit_ready (core,
+                                             GNUNET_NO,
                                               1,
                                               MAX_TRANSMIT_DELAY,
                                               other,
@@ -1589,6 +1594,7 @@ peer_connect_handler (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Peer connected: %s\n", GNUNET_i2s (peer));
   th = GNUNET_CORE_notify_transmit_ready (core,
+                                         GNUNET_YES,
                                           1,
                                           MAX_TRANSMIT_DELAY,
                                           peer,
index 16479b2d3c93cd330d539410cfa45dea19d861cc..a0f72090da8021abe1c0c988e30d4ede4e99c634 100644 (file)
@@ -1483,6 +1483,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
  * established (and the client has been informed about this).
  *
  * @param handle connection to core service
+ * @param cork is corking allowed for this transmission?
  * @param priority how important is the message?
  * @param maxdelay how long can the message wait?
  * @param target who should receive the message,
@@ -1496,6 +1497,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
  */
 struct GNUNET_CORE_TransmitHandle *
 GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
+                                  int cork,
                                    uint32_t priority,
                                    struct GNUNET_TIME_Relative maxdelay,
                                    const struct GNUNET_PeerIdentity *target,
index d26039adc83dfe3e4b0b52a3f3b659a425a8aec2..e455cbc30d6c7a7f0d386b8e67ae591db6a4a14a 100644 (file)
@@ -1076,7 +1076,9 @@ try_core_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       if (reply_counter >= MAX_REPLY_TIMES)
         reply_counter = 0;
       peer->th =
-        GNUNET_CORE_notify_transmit_ready (coreAPI, pending->importance,
+        GNUNET_CORE_notify_transmit_ready (coreAPI, 
+                                          GNUNET_YES,
+                                          pending->importance,
                                            pending->timeout, &peer->id, ssize,
                                            &core_transmit_notify, peer);
       if (peer->th == NULL)
index a4c78a94228a8400ba200040e314351170d2e964..900c8f5d7a1d6a7272bc4ea21ab526053d106b8e 100644 (file)
@@ -864,9 +864,16 @@ try_core_send (void *cls,
     return; /* Message send already in progress */
 
   if ((pending != NULL) && (coreAPI != NULL))
-    core_transmit_handle = GNUNET_CORE_notify_transmit_ready (coreAPI, pending->importance, pending->timeout, &pending->recipient, pending->msg_size, &core_transmit_notify, NULL);
+    core_transmit_handle = GNUNET_CORE_notify_transmit_ready (coreAPI,
+                                                             GNUNET_YES,
+                                                             pending->importance,
+                                                             pending->timeout, 
+                                                             &pending->recipient,
+                                                             pending->msg_size,
+                                                             &core_transmit_notify, NULL);
 }
 
+
 /**
  * Function called to notify a client about the socket
  * being ready to queue more data.  "buf" will be
@@ -939,7 +946,7 @@ size_t core_transmit_notify (void *cls,
 
   GNUNET_SCHEDULER_add_now(&try_core_send, NULL);
   /*if (reply != NULL)
-    core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, reply->importance, reply->timeout, &reply->recipient, reply->msg_size, &core_transmit_notify, NULL);*/
+    core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES,  reply->importance, reply->timeout, &reply->recipient, reply->msg_size, &core_transmit_notify, NULL);*/
 
   return off;
 }
@@ -1704,7 +1711,7 @@ neighbor_send_task (void *cls,
 
       GNUNET_SCHEDULER_add_now(try_core_send, NULL);
       /*if (core_transmit_handle == NULL)
-        core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, default_dv_priority, GNUNET_TIME_relative_get_forever(), &to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify, NULL);*/
+        core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES,  default_dv_priority, GNUNET_TIME_relative_get_forever(), &to->identity, sizeof(p2p_dv_MESSAGE_NeighborInfo), &core_transmit_notify, NULL);*/
 
     }
 
@@ -2080,7 +2087,7 @@ static int schedule_disconnect_messages (void *cls,
 
   GNUNET_SCHEDULER_add_now(try_core_send, NULL);
   /*if (core_transmit_handle == NULL)
-    core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, default_dv_priority, GNUNET_TIME_relative_get_forever(), &notify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL);*/
+    core_transmit_handle = GNUNET_CORE_notify_transmit_ready(coreAPI, GNUNET_YES, default_dv_priority, GNUNET_TIME_relative_get_forever(), &notify->identity, sizeof(p2p_dv_MESSAGE_Disconnect), &core_transmit_notify, NULL);*/
 
   return GNUNET_YES;
 }
index cbfac932273f28a5f0862483af2fbbb8d0d814bf..1016981607e8dd4cadaac979cb2690f483c4db4e 100644 (file)
@@ -1163,6 +1163,7 @@ consider_migration (void *cls,
     }
   cp->cth 
     = GNUNET_CORE_notify_transmit_ready (core,
+                                        GNUNET_YES,
                                         0, GNUNET_TIME_UNIT_FOREVER_REL,
                                         (const struct GNUNET_PeerIdentity*) key,
                                         msize + sizeof (struct PutMessage),
@@ -2169,6 +2170,7 @@ delayed_transmission_request (void *cls,
                       &pid);
   cp->last_transmission_request_start = GNUNET_TIME_absolute_get ();
   cp->cth = GNUNET_CORE_notify_transmit_ready (core,
+                                              GNUNET_YES,
                                               pm->priority,
                                               GNUNET_CONSTANTS_SERVICE_TIMEOUT,
                                               &pid,
@@ -2405,6 +2407,7 @@ add_to_pending_messages_for_peer (struct ConnectedPeer *cp,
   /* need to schedule transmission */
   cp->last_transmission_request_start = GNUNET_TIME_absolute_get ();
   cp->cth = GNUNET_CORE_notify_transmit_ready (core,
+                                              GNUNET_YES,
                                               cp->pending_messages_head->priority,
                                               MAX_TRANSMIT_DELAY,
                                               &pid,
index 6e39d7bd25c367ff2e5c3b65b371fa0d162c27cf..4d1cba508e83d41864f1bfcb6ac8c87d8b3ddf0d 100644 (file)
@@ -368,6 +368,7 @@ core_reserve_callback (void *cls,
     {
       /* reservation success, try transmission now! */
       pth->cth = GNUNET_CORE_notify_transmit_ready (GSF_core,
+                                                   GNUNET_YES,
                                                    pth->priority,
                                                    GNUNET_TIME_absolute_get_remaining (pth->timeout),
                                                    peer,
@@ -1110,6 +1111,7 @@ GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp,
   if (is_ready)
     {
       pth->cth = GNUNET_CORE_notify_transmit_ready (GSF_core,
+                                                   GNUNET_YES,
                                                    priority,
                                                    timeout,
                                                    &target,
index 91354b87c57c21dc24fc0a7606e98d2a305c3a3b..62d4fa64b0eb543a740658e39727fc492452cf6b 100644 (file)
@@ -414,6 +414,7 @@ connect_handler (void *cls,
               "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_ADV_TIMEOUT,
                                                 peer,
index 5664d34fcf845573f391a12599d37f06d5169888..755604b885742269a9419082871a92fb1e72c292 100644 (file)
@@ -414,6 +414,7 @@ struct GNUNET_CORE_TransmitHandle;
  * 
  *
  * @param handle connection to core service
+ * @param cork is corking allowed for this transmission?
  * @param priority how important is the message?
  * @param maxdelay how long can the message wait?
  * @param target who should receive the message,
@@ -437,6 +438,7 @@ struct GNUNET_CORE_TransmitHandle *
 GNUNET_CORE_notify_transmit_ready (struct
                                   GNUNET_CORE_Handle
                                   *handle,
+                                  int cork,
                                   uint32_t priority,
                                   struct
                                   GNUNET_TIME_Relative
index f714d32bb2f91c6ad6606fb0ed91f5a09afe0cd3..f539312cf7166b66b54b712a1f2138bce3f9f984 100644 (file)
@@ -441,6 +441,7 @@ GNUNET_MESH_notify_transmit_ready (struct
   cls->notify = notify;
   cls->tunnel = tunnel;
   GNUNET_CORE_notify_transmit_ready(tunnel->handle->core,
+                                   cork,
                                    priority,
                                    maxdelay,
                                    &tunnel->peer,
index 1441e218a3874af5f8ea4e733d228307c7b950dc..2fa3367545c2c44eeea10e387948658f9b2ac18e 100644 (file)
@@ -635,7 +635,9 @@ schedule_next_hello (void *cls,
   if (delay.rel_value == 0)
     {
       /* now! */
-      pl->hello_req = GNUNET_CORE_notify_transmit_ready (handle, 0,
+      pl->hello_req = GNUNET_CORE_notify_transmit_ready (handle, 
+                                                        GNUNET_YES,
+                                                        0,
                                                         GNUNET_CONSTANTS_SERVICE_TIMEOUT,
                                                         &pl->pid,
                                                         next_want,