-comments for Florian
authorChristian Grothoff <christian@grothoff.org>
Wed, 15 May 2013 13:39:46 +0000 (13:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 15 May 2013 13:39:46 +0000 (13:39 +0000)
src/include/gnunet_set_service.h
src/set/mq.h
src/set/set.h
src/set/test_set.conf

index b768823192e9c83bf8796607f42dfde8cd50a374..72d7ee521c667dc6548211631e21fee9448d81b9 100644 (file)
@@ -86,17 +86,26 @@ enum GNUNET_SET_Status
    * Everything went ok.
    */
   GNUNET_SET_STATUS_OK,
+
   /**
    * There was a timeout.
    */
   GNUNET_SET_STATUS_TIMEOUT,
+
   /**
    * The other peer refused to to the operation with us,
    * or something went wrong.
    */
   GNUNET_SET_STATUS_FAILURE,
+
+  /**
+   * Success, all elements have been returned (but the other
+   * peer might still be receiving some from us, so we are not done).
+   */
+  GNUNET_SET_STATUS_HALF_DONE,
+
   /**
-   * Success, all elements have been sent.
+   * Success, all elements have been sent (and received).
    */
   GNUNET_SET_STATUS_DONE
 };
@@ -140,7 +149,7 @@ struct GNUNET_SET_Element
   /**
    * Actual data of the element
    */
-  void *data;
+  const void *data;
 };
 
 
@@ -161,7 +170,7 @@ typedef void (*GNUNET_SET_Continuation) (void *cls);
  * @param status see enum GNUNET_SET_Status
  */
 typedef void (*GNUNET_SET_ResultIterator) (void *cls,
-                                           struct GNUNET_SET_Element *element,
+                                           const struct GNUNET_SET_Element *element,
                                            enum GNUNET_SET_Status status);
 
 
@@ -258,7 +267,7 @@ GNUNET_SET_destroy (struct GNUNET_SET_Handle *set);
  *        fail due to hash collisions, using a different salt for each operation
  *        makes it harder for an attacker to exploit this
  * @param timeout result_cb will be called with GNUNET_SET_STATUS_TIMEOUT
- *        if the operation is not done after the specified time
+ *        if the operation is not done after the specified time; @deprecated
  * @param result_mode specified how results will be returned,
  *        see 'GNUNET_SET_ResultMode'.
  * @param result_cb called on error or success
@@ -313,7 +322,7 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh);
  *
  * @param request request to accept
  * @param set set used for the requested operation 
- * @param timeout timeout for the set operation
+ * @param timeout timeout for the set operation, @deprecated
  * @param result_mode specified how results will be returned,
  *        see 'GNUNET_SET_ResultMode'.
  * @param result_cb callback for the results
index 42b755163a7c4141c5363576d7a08a150f2013fe..b7a89f6e051921efb65fee65fafd2043f7a1c3d3 100644 (file)
@@ -276,7 +276,6 @@ struct GNUNET_MQ_MessageQueue *
 GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
 
 
-
 /**
  * Create a message queue for a GNUNET_STREAM_Socket.
  * If handlers are specfied, receive messages from the stream socket.
@@ -285,12 +284,14 @@ GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
  * @param handlers handlers for receiving messages
  * @param cls closure for the handlers
  * @return the message queue
+ * @deprecated - GNUNET_MQ_queue_create_with_callbacks
  */
 struct GNUNET_MQ_MessageQueue *
 GNUNET_MQ_queue_for_stream_socket (struct GNUNET_STREAM_Socket *socket,
                                    const struct GNUNET_MQ_Handler *handlers,
                                    void *cls);
 
+
 /**
  * Replace the handlers of a message queue with new handlers.
  * Takes effect immediately, even for messages that already have been received, but for
@@ -306,7 +307,6 @@ GNUNET_MQ_replace_handlers (struct GNUNET_MQ_MessageQueue *mq,
                             void *cls);
 
 
-
 /**
  * Call a callback once the message has been sent, that is, the message
  * can not be canceled anymore.
@@ -321,6 +321,7 @@ GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
                        GNUNET_MQ_NotifyCallback cb,
                        void *cls);
 
+
 /**
  * Call a callback once all messages queued have been sent,
  * i.e. the message queue is empty.
@@ -328,6 +329,7 @@ GNUNET_MQ_notify_sent (struct GNUNET_MQ_Message *mqm,
  * @param mqm the message queue to send the notification for
  * @param cb the callback to call on an empty queue
  * @param cls closure for cb
+ * @deprecated
  */
 void
 GNUNET_MQ_notify_empty (struct GNUNET_MQ_MessageQueue *mqm,
@@ -341,6 +343,7 @@ GNUNET_MQ_notify_empty (struct GNUNET_MQ_MessageQueue *mqm,
  * @param mqm the message queue to send the notification for
  * @param cb the callback to call on a read error
  * @param cls closure for cb
+ * @deprecated, integrate with queue creation
  */
 void
 GNUNET_MQ_notify_read_error (struct GNUNET_MQ_MessageQueue *mqm,
index 33e0aafddf95ec627a0cc4fdafb5c4d0de00f08c..ad2200de939b662ad401b475e89294e888085e20 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2012 Christian Grothoff (and other contributing authors)
+     (C) 2012, 2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -49,6 +49,7 @@ struct SetCreateMessage
   /**
    * Operation type, values of enum GNUNET_SET_OperationType
    */
+  // FIXME: use 32_t for 'enum'.
   uint16_t operation GNUNET_PACKED;
 };
 
@@ -61,14 +62,15 @@ struct ListenMessage
   struct GNUNET_MessageHeader header;
 
   /**
-   * application id
+   * Operation type, values of enum GNUNET_SET_OperationType
    */
-  struct GNUNET_HashCode app_id;
+  uint16_t operation GNUNET_PACKED;
 
   /**
-   * Operation type, values of enum GNUNET_SET_OperationType
+   * application id
    */
-  uint16_t operation GNUNET_PACKED;
+  struct GNUNET_HashCode app_id;
+
 };
 
 
@@ -104,17 +106,17 @@ struct RequestMessage
    */
   struct GNUNET_MessageHeader header;
 
-  /**
-   * Identity of the requesting peer.
-   */
-  struct GNUNET_PeerIdentity peer_id;
-
   /**
    * ID of the request we want to accept,
    * chosen by the service.
    */
   uint32_t accept_id GNUNET_PACKED;
 
+  /**
+   * Identity of the requesting peer.
+   */
+  struct GNUNET_PeerIdentity peer_id;
+
   /* rest: nested context message */
 };
 
@@ -126,6 +128,11 @@ struct EvaluateMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * id of our evaluate, chosen by the client
+   */
+  uint32_t request_id GNUNET_PACKED;
+
   /**
    * Peer to evaluate the operation with
    */
@@ -136,11 +143,6 @@ struct EvaluateMessage
    */
   struct GNUNET_HashCode app_id;
 
-  /**
-   * id of our evaluate, chosen by the client
-   */
-  uint32_t request_id GNUNET_PACKED;
-
   /**
    * Salt to use for the operation
    */
index c1d5a0f93fd58f44be35951458bc1e1694842786..34b7a8d2fd1797a04e93a14c72334a3fed4fe604 100644 (file)
@@ -1,3 +1,7 @@
+# @INLINE@ test_set_defaults.conf
+[PATHS]
+SERVICEHOME = /tmp/test-gnunet-set/
+
 [set]
 AUTOSTART = YES
 PORT = 2106