gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3445 - in GNUnet: . src/applications/dht/module src/applic


From: grothoff
Subject: [GNUnet-SVN] r3445 - in GNUnet: . src/applications/dht/module src/applications/dht/tools src/applications/vpn
Date: Sat, 7 Oct 2006 23:18:52 -0700 (PDT)

Author: grothoff
Date: 2006-10-07 23:18:48 -0700 (Sat, 07 Oct 2006)
New Revision: 3445

Modified:
   GNUnet/src/applications/dht/module/Makefile.am
   GNUnet/src/applications/dht/module/datastore_memory.c
   GNUnet/src/applications/dht/tools/Makefile.am
   GNUnet/src/applications/dht/tools/dht_api.c
   GNUnet/src/applications/vpn/Makefile.am
   GNUnet/src/applications/vpn/vpn.c
   GNUnet/todo
Log:
fixes

Modified: GNUnet/src/applications/dht/module/Makefile.am
===================================================================
--- GNUnet/src/applications/dht/module/Makefile.am      2006-10-07 21:19:35 UTC 
(rev 3444)
+++ GNUnet/src/applications/dht/module/Makefile.am      2006-10-08 06:18:48 UTC 
(rev 3445)
@@ -15,6 +15,7 @@
   cs.c 
 libgnunetmodule_dht_la_LIBADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/util/cron/libgnunetutil_cron.la \
  $(top_builddir)/src/applications/rpc/libgnunetmodule_rpc_util.la
 libgnunetmodule_dht_la_LDFLAGS = \
   -export-dynamic -avoid-version -module

Modified: GNUnet/src/applications/dht/module/datastore_memory.c
===================================================================
--- GNUnet/src/applications/dht/module/datastore_memory.c       2006-10-07 
21:19:35 UTC (rev 3444)
+++ GNUnet/src/applications/dht/module/datastore_memory.c       2006-10-08 
06:18:48 UTC (rev 3445)
@@ -85,7 +85,9 @@
   MUTEX_LOCK(ds->lock);
   pos = ds->first;
   while (pos != NULL) {
-    if (equalsHashCode512(&keys[0], &pos->key)) {
+    if (0 == memcmp(&keys[0],
+                   &pos->key,
+                   sizeof(HashCode512))) {
       for (i=0;i<pos->count;i++)
        if (OK != resultCallback(&pos->key,
                                 pos->values[i],
@@ -125,7 +127,9 @@
   MUTEX_LOCK(ds->lock);
   pos = ds->first;
   while (pos != NULL) {
-    if (equalsHashCode512(key, &pos->key)) {
+    if (0 == memcmp(key, 
+                   &pos->key,
+                   sizeof(HashCode512))) {
       if (ds->max_memory < size) {
        MUTEX_UNLOCK(ds->lock);
        return NO;
@@ -187,7 +191,9 @@
   prev = NULL;
   pos = ds->first;
   while (pos != NULL) {
-    if (equalsHashCode512(key, &pos->key)) {
+    if (0 == memcmp(key, 
+                   &pos->key,
+                   sizeof(HashCode512))) {
       if (value != NULL) {
        for (i=0;i<pos->count;i++) {
          if ( (pos->values[i]->size == value->size) &&

Modified: GNUnet/src/applications/dht/tools/Makefile.am
===================================================================
--- GNUnet/src/applications/dht/tools/Makefile.am       2006-10-07 21:19:35 UTC 
(rev 3444)
+++ GNUnet/src/applications/dht/tools/Makefile.am       2006-10-08 06:18:48 UTC 
(rev 3445)
@@ -10,6 +10,7 @@
 libgnunetdht_api_la_SOURCES = \
   dht_api.c 
 libgnunetdht_api_la_LIBADD = \
+  $(top_builddir)/src/util/network_client/libgnunetutil_network_client.la \
   $(top_builddir)/src/util/libgnunetutil.la
 
 

Modified: GNUnet/src/applications/dht/tools/dht_api.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_api.c 2006-10-07 21:19:35 UTC (rev 
3444)
+++ GNUnet/src/applications/dht/tools/dht_api.c 2006-10-08 06:18:48 UTC (rev 
3445)
@@ -232,8 +232,9 @@
          FREE(buffer);
        }
        req = (CS_dht_request_get_MESSAGE*) buffer;
-       if (! equalsHashCode512(&req->table,
-                               &list->table)) {
+       if (0 != memcmp(&req->table,
+                       &list->table,
+                       sizeof(HashCode512))) {
          GE_LOG(ectx,
                 GE_ERROR | GE_BULK | GE_USER,
                 _("Received invalid `%s' request (wrong table)\n"),
@@ -287,8 +288,9 @@
          break;
        }
        req = (CS_dht_request_put_MESSAGE*) buffer;
-       if (! equalsHashCode512(&req->table,
-                               &list->table)) {
+       if (0 != memcmp(&req->table,
+                       &list->table,
+                       sizeof(HashCode512))) {
          GE_LOG(ectx,
                 GE_ERROR | GE_BULK | GE_USER,
                 _("Received invalid `%s' request (wrong table)\n"),
@@ -344,8 +346,9 @@
          break;
        }
        req = (CS_dht_request_remove_MESSAGE*) buffer;
-       if (! equalsHashCode512(&req->table,
-                               &list->table)) {
+       if (0 != memcmp(&req->table,
+                       &list->table,
+                       sizeof(HashCode512))) {
          GE_LOG(ectx,
                 GE_ERROR | GE_BULK | GE_USER,
                 _("Received invalid `%s' request (wrong table)\n"),
@@ -461,8 +464,9 @@
 
   MUTEX_LOCK(lock);
   for (i=0;i<tableCount;i++)
-    if (equalsHashCode512(&tables[i]->table,
-                         table)) {
+    if (0 == memcmp(&tables[i]->table,
+                   table,
+                   sizeof(HashCode512))) {
       GE_LOG(ectx,
             GE_WARNING | GE_BULK | GE_USER,
             _("This client already participates in the given DHT!\n"));
@@ -525,8 +529,9 @@
   list = NULL;
   MUTEX_LOCK(lock);
   for (i=0;i<tableCount;i++) {
-    if (equalsHashCode512(&tables[i]->table,
-                         table)) {
+    if (0 == memcmp(&tables[i]->table,
+                   table,
+                   sizeof(HashCode512))) {
       list = tables[i];
       tables[i] = tables[tableCount-1];
       GROW(tables,

Modified: GNUnet/src/applications/vpn/Makefile.am
===================================================================
--- GNUnet/src/applications/vpn/Makefile.am     2006-10-07 21:19:35 UTC (rev 
3444)
+++ GNUnet/src/applications/vpn/Makefile.am     2006-10-08 06:18:48 UTC (rev 
3445)
@@ -2,9 +2,8 @@
 
 plugindir = $(libdir)/GNUnet
 
-LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la 
 
+
 bin_PROGRAMS = \
   gnunet-vpn
 
@@ -25,6 +24,6 @@
 libgnunetmodule_vpn_la_LDFLAGS = \
   -export-dynamic -avoid-version -module \
   $(LDADD)
-
-
-
+libgnunetmodule_vpn_la_LIBADD = \
+ $(top_builddir)/src/util/crypto/libgnunetutil_crypto.la \
+ $(top_builddir)/src/util/libgnunetutil.la 

Modified: GNUnet/src/applications/vpn/vpn.c
===================================================================
--- GNUnet/src/applications/vpn/vpn.c   2006-10-07 21:19:35 UTC (rev 3444)
+++ GNUnet/src/applications/vpn/vpn.c   2006-10-08 06:18:48 UTC (rev 3445)
@@ -1331,6 +1331,34 @@
        MUTEX_UNLOCK(lock);
 }
 
+
+static int makeNonblocking(int handle) {
+#if MINGW
+  u_long l = 1;
+  if (ioctlsocket(handle, 
+                 FIONBIO, 
+                 &l) == SOCKET_ERROR) {
+    SetErrnoFromWinsockError(WSAGetLastError());
+    return SYSERR;
+  } else {
+    /* store the blocking mode */
+    __win_SetHandleBlockingMode(handle, 0);
+  }
+#else
+  int flags = fcntl(handle, F_GETFL);
+  flags |= O_NONBLOCK;
+  if (-1 == fcntl(handle,
+                 F_SETFL,
+                 flags)) {
+    GE_LOG_STRERROR(ectx,
+                   GE_WARNING | GE_USER | GE_ADMIN | GE_IMMEDIATE,
+                   "fcntl");
+    return SYSERR;
+  }
+#endif
+  return OK;
+}
+
 /**
  * Module inserted... create thread to listen to TUNTAP and pass
  * these messages on to GNUnet.
@@ -1402,7 +1430,7 @@
        PIPE(signalingPipe);
        /* important: make signalingPipe non-blocking
                to avoid stalling on signaling! */
-       setBlocking(signalingPipe[1], NO);
+       makeNonblocking(signalingPipe[1]);
 
        /* Yes we have to make our own thread, cause the GUNnet API is
         * missing some callbacks (Namely CanReadThisFd - SELECT()) that I 
would like ;-(

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-10-07 21:19:35 UTC (rev 3444)
+++ GNUnet/todo 2006-10-08 06:18:48 UTC (rev 3445)
@@ -14,14 +14,14 @@
 
 0.7.1 ['06] (aka "stabilization")
 - finish util refactoring: [RC]
-  * Not compiling:
-    + vpn
   * Testcases not compiling or passing:
     + dht/tools
   * Missing functionality: 
     + fs/fsui:
       @ generate events for suspend, abort
       @ make sure new event fields are set for all events
+    + uridb (?):
+      @ slow gnunet-gtk iterator (see drupal)
     + fs/fslib: error handing
     + fs/module: error handing
     + fs/ecrs: test-terminate integration (upload, unindex)





reply via email to

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