small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to...
[oweals/gnunet.git] / src / psyc / gnunet-service-psyc.c
index 75a94bcb7f9d507ae1e9a0ee30685738f7fe60d6..2b436aa214008e1ac7dbb0a18f5b262c75c0efef 100644 (file)
@@ -428,10 +428,10 @@ message_queue_drop (struct Channel *chn);
 
 
 static void
-schedule_transmit_message (void *cls,
-                           const struct GNUNET_SCHEDULER_TaskContext *tc)
+schedule_transmit_message (void *cls)
 {
   struct Channel *chn = cls;
+
   transmit_message (chn);
 }
 
@@ -440,10 +440,9 @@ schedule_transmit_message (void *cls,
  * Task run during shutdown.
  *
  * @param cls unused
- * @param tc unused
  */
 static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   if (NULL != nc)
   {
@@ -1030,9 +1029,12 @@ client_send_mcast_req (struct Master *mst,
   pmsg->fragment_offset = req->fragment_offset;
   pmsg->flags = htonl (GNUNET_PSYC_MESSAGE_REQUEST);
   pmsg->slave_pub_key = req->member_pub_key;
-
   memcpy (&pmsg[1], &req[1], size - sizeof (*req));
+
   client_send_msg (chn, &pmsg->header);
+
+  /* FIXME: save req to PSYCstore so that it can be resent later to clients */
+
   GNUNET_free (pmsg);
 }
 
@@ -2057,12 +2059,14 @@ slave_transmit_notify (void *cls, size_t *data_size, void *data)
 static void
 master_transmit_message (struct Master *mst)
 {
-  if (NULL == mst->chn.tmit_head)
+  struct Channel *chn = &mst->chn;
+  struct TransmitMessage *tmit_msg = chn->tmit_head;
+  if (NULL == tmit_msg)
     return;
   if (NULL == mst->tmit_handle)
   {
     mst->tmit_handle
-      = GNUNET_MULTICAST_origin_to_all (mst->origin, mst->chn.tmit_head->id,
+      = GNUNET_MULTICAST_origin_to_all (mst->origin, tmit_msg->id,
                                         mst->max_group_generation,
                                         master_transmit_notify, mst);
   }
@@ -2167,12 +2171,18 @@ slave_queue_message (struct Slave *slv, struct TransmitMessage *tmit_msg)
 /**
  * Queue PSYC message parts for sending to multicast.
  *
- * @param chn           Channel to send to.
- * @param client       Client the message originates from.
- * @param data_size    Size of @a data.
- * @param data         Concatenated message parts.
- * @param first_ptype  First message part type in @a data.
- * @param last_ptype   Last message part type in @a data.
+ * @param chn
+ *        Channel to send to.
+ * @param client
+ *        Client the message originates from.
+ * @param data_size
+ *        Size of @a data.
+ * @param data
+ *        Concatenated message parts.
+ * @param first_ptype
+ *        First message part type in @a data.
+ * @param last_ptype
+ *        Last message part type in @a data.
  */
 static struct TransmitMessage *
 queue_message (struct Channel *chn,