-simplifying core API (#2400)
[oweals/gnunet.git] / src / chat / gnunet-service-chat.c
index a7001775961559663ecc072c2d5e367792aef460..3405659a9fe6008ffba8067eefce6fcfebdd7a3d 100644 (file)
@@ -36,7 +36,6 @@
 #define DEBUG_CHAT_SERVICE GNUNET_EXTRA_LOGGING
 #define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 #define EXPECTED_NEIGHBOUR_COUNT 16
-#define QUEUE_SIZE 16
 #define MAX_ANONYMOUS_MSG_LIST_LENGTH 16
 
 
@@ -981,6 +980,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
  * @param other the other peer involved
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of entries in atsi
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -988,8 +988,8 @@ static int
 handle_p2p_join_notification (void *cls,
                               const struct GNUNET_PeerIdentity *other,
                               const struct GNUNET_MessageHeader *message,
-                              const struct GNUNET_ATS_Information
-                              *atsi)
+                              const struct GNUNET_ATS_Information *atsi,
+                              unsigned int atsi_count)
 {
   const struct P2PJoinNotificationMessage *p2p_jnmsg;
   char *room_name;
@@ -1097,6 +1097,7 @@ handle_p2p_join_notification (void *cls,
  * @param other the other peer involved
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of entries in atsi
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1104,8 +1105,8 @@ static int
 handle_p2p_leave_notification (void *cls,
                                const struct GNUNET_PeerIdentity *other,
                                const struct GNUNET_MessageHeader *message,
-                               const struct GNUNET_ATS_Information
-                               *atsi)
+                               const struct GNUNET_ATS_Information *atsi,
+                               unsigned int atsi_count)
 {
   const struct P2PLeaveNotificationMessage *p2p_lnmsg;
   GNUNET_HashCode id;
@@ -1178,6 +1179,7 @@ handle_p2p_leave_notification (void *cls,
  * @param other the other peer involved
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of entries in atsi
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1185,8 +1187,8 @@ static int
 handle_p2p_message_notification (void *cls,
                                  const struct GNUNET_PeerIdentity *other,
                                  const struct GNUNET_MessageHeader *message,
-                                 const struct GNUNET_ATS_Information
-                                 *atsi)
+                                 const struct GNUNET_ATS_Information *atsi,
+                                 unsigned int atsi_count)
 {
   const struct P2PReceiveNotificationMessage *p2p_rnmsg;
   struct P2PReceiveNotificationMessage *my_p2p_rnmsg;
@@ -1329,13 +1331,15 @@ handle_p2p_message_notification (void *cls,
  * @param other the other peer involved
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of entries in atsi
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_p2p_sync_request (void *cls, const struct GNUNET_PeerIdentity *other,
                          const struct GNUNET_MessageHeader *message,
-                         const struct GNUNET_ATS_Information *atsi)
+                         const struct GNUNET_ATS_Information *atsi,
+                         unsigned int atsi_count)
 {
   struct ChatClient *entry;
   struct GNUNET_CORE_TransmitHandle *th;
@@ -1370,6 +1374,7 @@ handle_p2p_sync_request (void *cls, const struct GNUNET_PeerIdentity *other,
  * @param other the other peer involved
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of entries in atsi
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1377,8 +1382,8 @@ static int
 handle_p2p_confirmation_receipt (void *cls,
                                  const struct GNUNET_PeerIdentity *other,
                                  const struct GNUNET_MessageHeader *message,
-                                 const struct GNUNET_ATS_Information
-                                 *atsi)
+                                 const struct GNUNET_ATS_Information *atsi,
+                                 unsigned int atsi_count)
 {
   const struct P2PConfirmationReceiptMessage *p2p_crmsg;
   struct P2PConfirmationReceiptMessage *my_p2p_crmsg;
@@ -1515,10 +1520,12 @@ transmit_sync_request_to_peer (void *cls, size_t size, void *buf)
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of entries in atsi
  */
 static void
 peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
-                      const struct GNUNET_ATS_Information *atsi)
+                      const struct GNUNET_ATS_Information *atsi,
+                      unsigned int atsi_count)
 {
   struct ConnectedPeer *cp;
   struct GNUNET_CORE_TransmitHandle *th;
@@ -1702,10 +1709,9 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
       GNUNET_CONTAINER_multihashmap_create (EXPECTED_NEIGHBOUR_COUNT);
   GNUNET_SERVER_add_handlers (server, handlers);
   core =
-      GNUNET_CORE_connect (cfg, QUEUE_SIZE, NULL, &core_init,
+      GNUNET_CORE_connect (cfg, NULL, &core_init,
                            &peer_connect_handler, &peer_disconnect_handler,
-                           NULL, GNUNET_NO, NULL, GNUNET_NO,
-                           p2p_handlers);
+                           NULL, GNUNET_NO, NULL, GNUNET_NO, p2p_handlers);
   GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
                                 NULL);