gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3435 - in GNUnet: . src/applications/dht src/applications/


From: grothoff
Subject: [GNUnet-SVN] r3435 - in GNUnet: . src/applications/dht src/applications/dht/tools src/include
Date: Mon, 2 Oct 2006 13:03:24 -0700 (PDT)

Author: grothoff
Date: 2006-10-02 13:03:21 -0700 (Mon, 02 Oct 2006)
New Revision: 3435

Modified:
   GNUnet/README.debian
   GNUnet/src/applications/dht/Makefile.am
   GNUnet/src/applications/dht/tools/Makefile.am
   GNUnet/src/applications/dht/tools/dht-query.c
   GNUnet/src/include/gnunet_fsui_lib.h
   GNUnet/todo
Log:
dht/tools compiles

Modified: GNUnet/README.debian
===================================================================
--- GNUnet/README.debian        2006-10-02 17:46:25 UTC (rev 3434)
+++ GNUnet/README.debian        2006-10-02 20:03:21 UTC (rev 3435)
@@ -23,7 +23,7 @@
 libltdl3-dev
 libgtk2.0-dev
 libsqlite3-dev
-libmysqlclient14-dev
+libmysqlclient15-dev
 libncurses5-dev
 libcurl3-gnutls-dev
 libncursesw5-dev

Modified: GNUnet/src/applications/dht/Makefile.am
===================================================================
--- GNUnet/src/applications/dht/Makefile.am     2006-10-02 17:46:25 UTC (rev 
3434)
+++ GNUnet/src/applications/dht/Makefile.am     2006-10-02 20:03:21 UTC (rev 
3435)
@@ -1 +1 @@
-SUBDIRS = module 
+SUBDIRS = module tools

Modified: GNUnet/src/applications/dht/tools/Makefile.am
===================================================================
--- GNUnet/src/applications/dht/tools/Makefile.am       2006-10-02 17:46:25 UTC 
(rev 3434)
+++ GNUnet/src/applications/dht/tools/Makefile.am       2006-10-02 20:03:21 UTC 
(rev 3435)
@@ -30,6 +30,7 @@
   $(top_builddir)/src/applications/dht/tools/libgnunetdht_api.la \
   $(top_builddir)/src/util/config_impl/libgnunetutil_config.la \
   $(top_builddir)/src/util/loggers/libgnunetutil_logging.la \
+  $(top_builddir)/src/util/crypto/libgnunetutil_crypto.la \
   $(top_builddir)/src/util/network_client/libgnunetutil_network_client.la \
   $(top_builddir)/src/util/libgnunetutil.la
 

Modified: GNUnet/src/applications/dht/tools/dht-query.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht-query.c       2006-10-02 17:46:25 UTC 
(rev 3434)
+++ GNUnet/src/applications/dht/tools/dht-query.c       2006-10-02 20:03:21 UTC 
(rev 3435)
@@ -27,9 +27,11 @@
 #include "platform.h"
 #include "gnunet_protocols.h"
 #include "gnunet_util.h"
+#include "gnunet_util_crypto.h"
 #include "gnunet_dht_lib.h"
 #include "gnunet_util_config_impl.h"
 #include "gnunet_util_error_loggers.h"
+#include "gnunet_util_network_client.h"
 #include "gnunet_dht_datastore_memory.h"
 
 static DHT_TableId table;
@@ -40,6 +42,8 @@
 
 static struct GE_Context * ectx;
 
+static struct GC_Configuration * cfg;
+
 static char * cfgFilename;
 
 /**
@@ -85,13 +89,14 @@
         GE_DEBUG | GE_REQUEST | GE_USER,
         "Issuing '%s(%s)' command.\n",
         "get", key);
-  ret = DHT_LIB_get(&table,
+  ret = DHT_LIB_get(cfg,
+                   ectx,
+                   &table,
                    DHT_STRING2STRING_BLOCK,
                    1, /* prio */
                    1, /* key count */
                    &hc,
-                   getConfigurationInt("DHT-QUERY",
-                                       "TIMEOUT"),
+                   timeout,
                    &printCallback,
                    (void*) key);
   if (ret == 0)
@@ -102,7 +107,7 @@
 
 static void do_put(struct ClientServerConnection * sock,
                   const char * key,
-                  char * value) {
+                  const char * value) {
   DataContainer * dc;
   HashCode512 hc;
 
@@ -112,14 +117,16 @@
   dc->size = htonl(strlen(value)
                   + sizeof(DataContainer));
   memcpy(&dc[1], value, strlen(value));
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "Issuing '%s(%s,%s)' command.\n",
-      "put", key, value);
-  if (OK == DHT_LIB_put(&table,                
+  GE_LOG(ectx,
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "Issuing '%s(%s,%s)' command.\n",
+        "put", key, value);
+  if (OK == DHT_LIB_put(cfg,
+                       ectx,
+                       &table,
                        &hc,
                        1, /* prio */
-                       getConfigurationInt("DHT-QUERY",
-                                           "TIMEOUT"),
+                       timeout,
                        dc)) {
     printf(_("'%s(%s,%s)' succeeded\n"),
           "put",
@@ -134,7 +141,7 @@
 
 static void do_remove(struct ClientServerConnection * sock,
                      const char * key,
-                     char * value) {
+                     const char * value) {
   DataContainer * dc;
   HashCode512 hc;
 
@@ -144,13 +151,15 @@
   dc->size = htonl(strlen(value)
                   + sizeof(DataContainer));
   memcpy(&dc[1], value, strlen(value));
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "Issuing '%s(%s,%s)' command.\n",
-      "remove", key, value);
-  if (OK == DHT_LIB_remove(&table,
+  GE_LOG(ectx, 
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "Issuing '%s(%s,%s)' command.\n",
+        "remove", key, value);
+  if (OK == DHT_LIB_remove(cfg,
+                          ectx,
+                          &table,
                           &hc,
-                          getConfigurationInt("DHT-QUERY",
-                                              "TIMEOUT"),
+                          timeout,
                           dc)) {
     printf(_("'%s(%s,%s)' succeeded\n"),
           "remove",
@@ -165,13 +174,10 @@
 
 
 int main(int argc,
-        char **argv) {
-  int count;
-  char ** commands;
+        const char **argv) {
   int i;
   struct ClientServerConnection * handle;
   HashCode512 table;
-  struct GC_Configuration * cfg;
 
   ectx = GE_create_context_stderr(NO, 
                                  GE_WARNING | GE_ERROR | GE_FATAL |
@@ -206,8 +212,7 @@
   FREE(table_id);
   table_id = NULL;
 
-  count = getConfigurationStringList(&commands);
-  handle = getClientSocket();
+  handle = client_connection_create(ectx, cfg);
   if (handle == NULL) {
     fprintf(stderr,
            _("Failed to connect to gnunetd.\n"));
@@ -216,21 +221,21 @@
     return 1;
   }
 
-  for (i=0;i<count;i++) {
-    if (0 == strcmp("get", commands[i])) {
-      if (i+2 > count) {
+  while (i < argc) {
+    if (0 == strcmp("get", argv[i])) {
+      if (i+2 > argc) {
        fprintf(stderr,
                _("Command `%s' requires an argument (`%s').\n"),
                "get",
                "key");
        break;
       } else {
-       do_get(handle, commands[++i]);
+       do_get(handle, argv[++i]);
       }
       continue;
     }
-    if (0 == strcmp("put", commands[i])) {
-      if (i+3 > count) {
+    if (0 == strcmp("put", argv[i])) {
+      if (i+3 > argc) {
        fprintf(stderr,
                _("Command `%s' requires two arguments (`%s' and `%s').\n"),
                "put",
@@ -238,13 +243,13 @@
                "value");
        break;
       } else {
-       do_put(handle, commands[i+1], commands[i+2]);
+       do_put(handle, argv[i+1], argv[i+2]);
        i+=2;
       }
       continue;
     }
-    if (0 == strcmp("remove", commands[i])) {
-      if (i+3 > count) {
+    if (0 == strcmp("remove", argv[i])) {
+      if (i+3 > argc) {
        fprintf(stderr,
                _("Command `%s' requires two arguments (`%s' and `%s').\n"),
                "remove",
@@ -252,20 +257,17 @@
                "value");
        break;
       } else {
-       do_remove(handle, commands[i+1], commands[i+2]);
+       do_remove(handle, argv[i+1], argv[i+2]);
        i+=2;
       }
       continue;
     }
     fprintf(stderr,
            _("Unsupported command `%s'.  Aborting.\n"),
-           commands[i]);
+           argv[i]);
     break;
   }
   connection_destroy(handle);
-  for (i=0;i<count;i++)
-    FREE(commands[i]);
-  FREE(commands);
   GC_free(cfg);
   GE_free_context(ectx);
   return 0;

Modified: GNUnet/src/include/gnunet_fsui_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fsui_lib.h        2006-10-02 17:46:25 UTC (rev 
3434)
+++ GNUnet/src/include/gnunet_fsui_lib.h        2006-10-02 20:03:21 UTC (rev 
3435)
@@ -728,7 +728,7 @@
 
 
 /**
- * Abort an upload.  If the context is for a recursive
+ * Abort an unindex operation.  If the context is for a recursive
  * upload, all sub-uploads will also be aborted.
  *
  * @return SYSERR on error

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-10-02 17:46:25 UTC (rev 3434)
+++ GNUnet/todo 2006-10-02 20:03:21 UTC (rev 3435)
@@ -15,7 +15,6 @@
 0.7.1 ['06] (aka "stabilization")
 - finish util refactoring: [RC]
   * Not compiling:
-    + dht/tools
     + vpn
   * Testcases not compiling or passing:
     + dht/tools





reply via email to

[Prev in Thread] Current Thread [Next in Thread]