fix
authorFlorian Dold <florian.dold@gmail.com>
Wed, 17 Apr 2013 11:07:31 +0000 (11:07 +0000)
committerFlorian Dold <florian.dold@gmail.com>
Wed, 17 Apr 2013 11:07:31 +0000 (11:07 +0000)
src/set/gnunet-service-set.c
src/set/set_api.c

index 9eaca990ea48ac6b1d91f5f95f920009dc148996..69296fe79f342a7c89784843bee95d2e430b426f 100644 (file)
 #include "gnunet_core_service.h"
 #include "gnunet_stream_lib.h"
 
+struct Set
+{
+
+};
+
+struct Listener
+{
+
+};
+
+/*
+static struct Listener *sets_head;
+static struct Listener *sets_tail;
+
+static struct Listener *listeners_head;
+static struct Listener *listeners_tail;
+*/
+
+
+/**
+ * Called when a client wants to create a new set.
+ *
+ * @param cls unused
+ * @param client client that sent the message
+ * @param m message sent by the client
+ */
+static void
+handle_client_create (void *cls,
+                      struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *m)
+{
+  
+}
+
 
 /**
  * Function called by the service's run
  * @param cfg configuration to use
  */
 static void
-run (void *cls,
-     struct GNUNET_SERVER_Handle * server,
-     const struct GNUNET_CONFIGURATION_Handle *
-     cfg)
+run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg)
 
 {
-  /* FIXME */
+  static const struct GNUNET_SERVER_MessageHandler server_handlers[] = {
+    {handle_client_create, NULL, GNUNET_MESSAGE_TYPE_SET_CREATE, 0},
+    {NULL, NULL, 0, 0}
+  };
+
+
+  GNUNET_SERVER_add_handlers (server, server_handlers);
 }
 
 
index ee328aad9bb5f181cc661db6b7770cd4acb317ee..45c4e47bd2f110d5b7fdc7fbef29d35a5dbf2334 100644 (file)
@@ -82,8 +82,8 @@ struct GNUNET_SET_ListenHandle
  * @param cls the set
  * @param mh the message
  */
-void
-handle_result (void *cls, struct GNUNET_MessageHeader *mh)
+static void
+handle_result (void *cls, const struct GNUNET_MessageHeader *mh)
 {
   struct ResultMessage *msg = (struct ResultMessage *) mh;
   struct GNUNET_SET_Handle *set = cls;
@@ -125,8 +125,8 @@ handle_result (void *cls, struct GNUNET_MessageHeader *mh)
  * @param cls the listen handle
  * @param mh the message
  */
-void
-handle_request (void *cls, struct GNUNET_MessageHeader *mh)
+static void
+handle_request (void *cls, const struct GNUNET_MessageHeader *mh)
 {
   struct RequestMessage *msg = (struct RequestMessage *) mh;
   struct GNUNET_SET_ListenHandle *lh = cls;