gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5536 - in GNUnet/src: applications/datastore applications/


From: gnunet
Subject: [GNUnet-SVN] r5536 - in GNUnet/src: applications/datastore applications/dht/module applications/dstore applications/fs/module applications/identity applications/session applications/topology_default applications/topology_f2f applications/vpn include server transports
Date: Fri, 24 Aug 2007 03:54:17 -0600 (MDT)

Author: grothoff
Date: 2007-08-24 03:54:16 -0600 (Fri, 24 Aug 2007)
New Revision: 5536

Modified:
   GNUnet/src/applications/datastore/prefetch.h
   GNUnet/src/applications/dht/module/service.c
   GNUnet/src/applications/dstore/dstore.c
   GNUnet/src/applications/fs/module/migration.c
   GNUnet/src/applications/identity/identity.c
   GNUnet/src/applications/session/connect.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/applications/topology_f2f/topology.c
   GNUnet/src/applications/vpn/vpn.c
   GNUnet/src/include/gnunet_datastore_service.h
   GNUnet/src/include/gnunet_identity_service.h
   GNUnet/src/server/connection.c
   GNUnet/src/server/handler.c
   GNUnet/src/transports/http.c
   GNUnet/src/transports/tcp_helper.c
Log:
experimental new session key exchange code

Modified: GNUnet/src/applications/datastore/prefetch.h
===================================================================
--- GNUnet/src/applications/datastore/prefetch.h        2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/applications/datastore/prefetch.h        2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -47,8 +47,7 @@
  *        for any type.
  * @return OK if a value was found, SYSERR if not
  */
-int getRandom (HashCode512 * key,
-               Datastore_Value ** value);
+int getRandom (HashCode512 * key, Datastore_Value ** value);
 
 
 /* end of prefetch.h */

Modified: GNUnet/src/applications/dht/module/service.c
===================================================================
--- GNUnet/src/applications/dht/module/service.c        2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/applications/dht/module/service.c        2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -168,18 +168,18 @@
   cron_start (cron);
   if (OK != init_dht_store (1024 * 1024, capi))
     {
-      GE_BREAK(capi->ectx, 0);
+      GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   if (OK != init_dht_table (capi))
     {
-      GE_BREAK(capi->ectx, 0);
+      GE_BREAK (capi->ectx, 0);
       done_dht_store ();
       return NULL;
     }
   if (OK != init_dht_routing (capi))
     {
-      GE_BREAK(capi->ectx, 0);
+      GE_BREAK (capi->ectx, 0);
       done_dht_table ();
       done_dht_store ();
       return NULL;

Modified: GNUnet/src/applications/dstore/dstore.c
===================================================================
--- GNUnet/src/applications/dstore/dstore.c     2007-08-24 09:10:36 UTC (rev 
5535)
+++ GNUnet/src/applications/dstore/dstore.c     2007-08-24 09:54:16 UTC (rev 
5536)
@@ -118,7 +118,7 @@
   int fd;
   sqlite3 *dbh;
   char *tmpl;
-  
+
   if (fn != NULL)
     {
       UNLINK (fn);
@@ -127,8 +127,8 @@
   tmpl = "/tmp/dstoreXXXXXX";
 
 #ifdef MINGW
-  fn = (char *) MALLOC(MAX_PATH + 1);
-  plibc_conv_to_win_path(tmpl, fn);
+  fn = (char *) MALLOC (MAX_PATH + 1);
+  plibc_conv_to_win_path (tmpl, fn);
 #else
   fn = STRDUP (tmpl);
 #endif
@@ -449,7 +449,7 @@
 #endif
   if (OK != db_reset ())
     {
-      GE_BREAK(capi->ectx, 0);
+      GE_BREAK (capi->ectx, 0);
       return NULL;
     }
   lock = MUTEX_CREATE (NO);

Modified: GNUnet/src/applications/fs/module/migration.c
===================================================================
--- GNUnet/src/applications/fs/module/migration.c       2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/applications/fs/module/migration.c       2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -148,30 +148,29 @@
 
   index = coreAPI->computeIndex (receiver);
   MUTEX_LOCK (lock);
-  now = get_time();
+  now = get_time ();
   entry = -1;
   discard_entry = -1;
   discard_match = -1;
   minDist = -1;                 /* max */
   for (i = 0; i < MAX_RECORDS; i++)
     {
-      if (content[i].value == NULL) 
-       {
-         if (discard_time >= now - MAX_POLL_FREQUENCY)
-           continue;
-         discard_time = now;
-         if (OK != datastore->getRandom (&content[i].key,
-                                         &content[i].value))
-           {
-             content[entry].value = NULL;  /* just to be sure... */
-             continue;
-           } 
-         else 
-           {
-             if (stats != NULL)
-               stats->change (stat_migration_factor, 1);
-           }
-       }
+      if (content[i].value == NULL)
+        {
+          if (discard_time >= now - MAX_POLL_FREQUENCY)
+            continue;
+          discard_time = now;
+          if (OK != datastore->getRandom (&content[i].key, &content[i].value))
+            {
+              content[entry].value = NULL;      /* just to be sure... */
+              continue;
+            }
+          else
+            {
+              if (stats != NULL)
+                stats->change (stat_migration_factor, 1);
+            }
+        }
       match = 1;
       if (ntohl (content[i].value->size) + sizeof (GapWrapper) -
           sizeof (Datastore_Value) <= padding)
@@ -206,30 +205,34 @@
             }
         }
     }
-  if ( (discard_entry != -1) &&
-       (discard_match > MAX_RECEIVERS / 2) &&
-       (discard_time < now - MAX_POLL_FREQUENCY) ) {
-    discard_time = now;
-    FREENONNULL (content[discard_entry].value);
-    content[discard_entry].value = NULL;
-    content[discard_entry].sentCount = 0;
-    if (OK != datastore->getRandom (&content[discard_entry].key,
-                                   &content[discard_entry].value)) {
-       content[discard_entry].value = NULL;  /* just to be sure... */
-       discard_entry = -1;
-    } else {
-      if (stats != NULL)
-        stats->change (stat_migration_factor, 1);
+  if ((discard_entry != -1) &&
+      (discard_match > MAX_RECEIVERS / 2) &&
+      (discard_time < now - MAX_POLL_FREQUENCY))
+    {
+      discard_time = now;
+      FREENONNULL (content[discard_entry].value);
+      content[discard_entry].value = NULL;
+      content[discard_entry].sentCount = 0;
+      if (OK != datastore->getRandom (&content[discard_entry].key,
+                                      &content[discard_entry].value))
+        {
+          content[discard_entry].value = NULL;  /* just to be sure... */
+          discard_entry = -1;
+        }
+      else
+        {
+          if (stats != NULL)
+            stats->change (stat_migration_factor, 1);
+        }
     }
-  }
   if (entry == -1)
     entry = discard_entry;
-  if (entry == -1) 
+  if (entry == -1)
     {
-#if DEBUG_MIGRATION 
+#if DEBUG_MIGRATION
       GE_LOG (ectx,
-             GE_DEBUG | GE_REQUEST | GE_USER,
-             "Migration: no content available for migration.\n");
+              GE_DEBUG | GE_REQUEST | GE_USER,
+              "Migration: no content available for migration.\n");
 #endif
       MUTEX_UNLOCK (lock);
       return 0;
@@ -244,12 +247,11 @@
   size = sizeof (GapWrapper) + ntohl (value->size) - sizeof (Datastore_Value);
   if (size > padding)
     {
-#if DEBUG_MIGRATION 
-          GE_LOG (ectx,
-                  GE_DEBUG | GE_REQUEST | GE_USER,
-                  "Migration: available content too big (%u > %u) for 
migration.\n",
-                 size,
-                 padding);
+#if DEBUG_MIGRATION
+      GE_LOG (ectx,
+              GE_DEBUG | GE_REQUEST | GE_USER,
+              "Migration: available content too big (%u > %u) for 
migration.\n",
+              size, padding);
 #endif
       MUTEX_UNLOCK (lock);
       return 0;
@@ -273,7 +275,7 @@
                   GE_DEBUG | GE_REQUEST | GE_USER,
                   "Migration: failed to locate indexed content for 
migration.\n");
 #endif
-         return 0;
+          return 0;
         }
       if (stats != NULL)
         stats->change (stat_on_demand_migration_attempts, 1);
@@ -288,12 +290,11 @@
       MUTEX_UNLOCK (lock);
 #if DEBUG_MIGRATION
       GE_LOG (ectx,
-             GE_DEBUG | GE_REQUEST | GE_USER,
-             "Migration: available content too big (%u > %u) for migration.\n",
-             size,
-             padding);
+              GE_DEBUG | GE_REQUEST | GE_USER,
+              "Migration: available content too big (%u > %u) for 
migration.\n",
+              size, padding);
 #endif
-    return 0;
+      return 0;
     }
   et = ntohll (value->expirationTime);
   if (et > now)
@@ -322,21 +323,28 @@
               GE_DEBUG | GE_REQUEST | GE_USER,
               "gap's tryMigrate returned %u\n", ret);
 #endif
-      if (ret != 0) {
-       if (content[entry].sentCount == MAX_RECEIVERS) {
-         FREE (content[entry].value);
-         content[entry].value = NULL;
-         content[entry].sentCount = 0;   
-       } else {
-         content[entry].receiverIndices[content[entry].sentCount++] = index;
-       }
-      } else {
+      if (ret != 0)
+        {
+          if (content[entry].sentCount == MAX_RECEIVERS)
+            {
+              FREE (content[entry].value);
+              content[entry].value = NULL;
+              content[entry].sentCount = 0;
+            }
+          else
+            {
+              content[entry].receiverIndices[content[entry].sentCount++] =
+                index;
+            }
+        }
+      else
+        {
 #if DEBUG_MIGRATION
-       GE_LOG (ectx,
-               GE_DEBUG | GE_REQUEST | GE_USER,
-               "Migration: not enough cover traffic\n");
+          GE_LOG (ectx,
+                  GE_DEBUG | GE_REQUEST | GE_USER,
+                  "Migration: not enough cover traffic\n");
 #endif
-      }
+        }
     }
   MUTEX_UNLOCK (lock);
   if ((ret > 0) && (stats != NULL))

Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-08-24 09:10:36 UTC (rev 
5535)
+++ GNUnet/src/applications/identity/identity.c 2007-08-24 09:54:16 UTC (rev 
5536)
@@ -860,13 +860,13 @@
 }
 
 /**
- * Is the host currently 'strictly' blacklisted (i.e. we refuse to talk)?
+ * Is the host currently blacklisted (i.e. we refuse to talk)?
  *
  * @param identity host to check
  * @return YES if true, else NO
  */
 static int
-isBlacklistedStrict (const PeerIdentity * identity)
+isBlacklisted (const PeerIdentity * identity, int strict)
 {
   cron_t now;
   HostEntry *entry;
@@ -880,7 +880,7 @@
       return NO;
     }
   now = get_time ();
-  if ((now < entry->until) && (entry->strict == YES))
+  if ((now < entry->until) && ((entry->strict == YES) || (strict == NO)))
     {
 #if DEBUG_IDENTITY
       EncName enc;
@@ -1329,7 +1329,7 @@
   id.identity2Hello = &identity2Hello;
   id.verifyPeerSignature = &verifyPeerSignature;
   id.blacklistHost = &blacklistHost;
-  id.isBlacklistedStrict = &isBlacklistedStrict;
+  id.isBlacklisted = &isBlacklisted;
   id.whitelistHost = &whitelistHost;
   id.changeHostTrust = &changeHostTrust;
   id.getHostTrust = &getHostTrust;

Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c   2007-08-24 09:10:36 UTC (rev 
5535)
+++ GNUnet/src/applications/session/connect.c   2007-08-24 09:54:16 UTC (rev 
5536)
@@ -491,10 +491,10 @@
               GE_ERROR | GE_USER | GE_IMMEDIATE,
               _("Could not create any HELLO for myself!\n"));
     }
-#if DEBUG_SESSION
+#if DEBUG_SESSION || 1
   GE_LOG (ectx,
           GE_DEBUG | GE_USER | GE_REQUEST,
-          "Sending session key `%s' to peer `%s'.\n", printSKEY (&sk), &enc);
+          "Sending session key  to peer `%s'.\n", &enc);
 #endif
   if (stats != NULL)
     {
@@ -593,6 +593,14 @@
               &enc);
       return SYSERR;
     }
+  if ((OK != coreAPI->getCurrentSessionKey (sender,
+                                            NULL,
+                                            NULL,
+                                            YES)) &&
+      (YES == identity->isBlacklisted (sender, NO)))
+    return SYSERR;              /* other peer initiated but is
+                                   listed as not allowed => discard */
+
   sessionkeySigned = (const P2P_setkey_MESSAGE *) msg;
 
   if ((ntohs (msg->size) == sizeof (P2P_new_setkey_MESSAGE)) ||
@@ -825,6 +833,8 @@
           GE_DEBUG | GE_USER | GE_REQUEST,
           "Trying to exchange key with `%s'.\n", &enc);
 #endif
+  if (YES == identity->isBlacklisted (peer, NO))
+    return NO;                  /* not allowed right now! */
   if (OK == exchangeKey (peer, NULL, NULL))
     return NO;
   return SYSERR;

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/applications/topology_default/topology.c 2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -217,7 +217,7 @@
           GE_DEBUG | GE_REQUEST | GE_USER | GE_DEVELOPER,
           "Trying to connect to peer `%s'\n", &enc);
 #endif
-  if (NO == identity->isBlacklistedStrict (&indexMatch.match))
+  if (NO == identity->isBlacklisted (&indexMatch.match, YES))
     {
       coreAPI->unicast (&indexMatch.match, NULL, 0, 0);
       identity->blacklistHost (&indexMatch.match, (unsigned int) (saturation * 
5 * 60 * 60),    /* 5 hours at full saturation */

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/applications/topology_f2f/topology.c     2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -220,7 +220,7 @@
           GE_DEBUG | GE_REQUEST | GE_USER,
           "Topology: trying to connect to `%s'.\n", &enc);
 #endif
-  if (NO == identity->isBlacklistedStrict (&indexMatch.match))
+  if (NO == identity->isBlacklisted (&indexMatch.match, YES))
     {
       coreAPI->unicast (&indexMatch.match, NULL, 0, 0);
       identity->blacklistHost (&indexMatch.match, (unsigned int) 5 * 60 * 60 * 
saturation,      /* 5h at full saturation */

Modified: GNUnet/src/applications/vpn/vpn.c
===================================================================
--- GNUnet/src/applications/vpn/vpn.c   2007-08-24 09:10:36 UTC (rev 5535)
+++ GNUnet/src/applications/vpn/vpn.c   2007-08-24 09:54:16 UTC (rev 5536)
@@ -907,7 +907,7 @@
        if (timeout.tv_sec < (interval / 2)) {
                for (i = 0; i < entries1; i++) {
                        if (((store1+i)->active) > 0) {
-                               if 
(identity->isBlacklistedStrict(&((store1+i)->peer))) {
+                               if 
(identity->isBlacklisted(&((store1+i)->peer)), YES) {
                                        GE_LOG(ectx, GE_INFO | GE_REQUEST | 
GE_USER, _("RFC4193 --- whitelist of peer %x\n"),
                                                
(store1+i)->peer.hashPubKey.bits[0]);
                                        
identity->whitelistHost(&((store1+i)->peer));

Modified: GNUnet/src/include/gnunet_datastore_service.h
===================================================================
--- GNUnet/src/include/gnunet_datastore_service.h       2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/include/gnunet_datastore_service.h       2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -176,8 +176,7 @@
    * @param value set to an approximate match
    * @return OK if a value was found, SYSERR if not
    */
-  int (*getRandom) (HashCode512 * key,
-                    Datastore_Value ** value);
+  int (*getRandom) (HashCode512 * key, Datastore_Value ** value);
 
   /**
    * Explicitly remove some content from the database.

Modified: GNUnet/src/include/gnunet_identity_service.h
===================================================================
--- GNUnet/src/include/gnunet_identity_service.h        2007-08-24 09:10:36 UTC 
(rev 5535)
+++ GNUnet/src/include/gnunet_identity_service.h        2007-08-24 09:54:16 UTC 
(rev 5536)
@@ -186,8 +186,7 @@
    *        strict blacklisting
    * @return YES if true, else NO
    */
-  int (*isBlacklisted) (const PeerIdentity * identity,
-                       int strict);
+  int (*isBlacklisted) (const PeerIdentity * identity, int strict);
 
   /**
    * Whitelist a host. This method is called if a host

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-08-24 09:10:36 UTC (rev 5535)
+++ GNUnet/src/server/connection.c      2007-08-24 09:54:16 UTC (rev 5536)
@@ -624,6 +624,8 @@
 
 static int stat_hangupSent;
 
+static int stat_closedTransport;
+
 static int stat_encrypted;
 
 static int stat_transmitted;
@@ -1622,9 +1624,21 @@
       ensureTransportConnected (be);
       if (be->session.tsession == NULL)
         {
+#if DEBUG_CONNECTION || 1
+          EncName enc;
+          IF_GELOG (ectx,
+                    GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+                    hash2enc (&be->session.sender.hashPubKey, &enc));
+          GE_LOG (ectx,
+                  GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+                  "Session is DOWN for `%s' due to transport disconnect\n",
+                  &enc);
+#endif
 #if STRICT_STAT_DOWN
           be->status = STAT_DOWN;
 #endif
+          if (stats != NULL)
+            stats->change (stat_closedTransport, 1);
           for (i = 0; i < be->sendBufferSize; i++)
             {
               FREENONNULL (be->sendBuffer[i]->closure);
@@ -1799,11 +1813,22 @@
     }
   if ((ret == SYSERR) && (be->session.tsession != NULL))
     {
+#if DEBUG_CONNECTION || 1
+      EncName enc;
+      IF_GELOG (ectx,
+                GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+                hash2enc (&be->session.sender.hashPubKey, &enc));
+      GE_LOG (ectx,
+              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+              "Session is DOWN for `%s' due to transmission error\n", &enc);
+#endif
       tsession = be->session.tsession;
       be->session.tsession = NULL;
 #if STRICT_STAT_DOWN
       be->status = STAT_DOWN;
 #endif
+      if (stats != NULL)
+        stats->change (stat_closedTransport, 1);
       transport->disconnect (tsession, __FILE__);
       for (i = 0; i < be->sendBufferSize; i++)
         {
@@ -2078,7 +2103,15 @@
   if (be->status == STAT_UP)
     {
       SendEntry *se;
-
+#if DEBUG_CONNECTION || 1
+      EncName enc;
+      IF_GELOG (ectx,
+                GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+                hash2enc (&be->session.sender.hashPubKey, &enc));
+      GE_LOG (ectx,
+              GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
+              "Session DOWN for `%s' due to HANGUP received\n", &enc);
+#endif
       hangup.header.type = htons (P2P_PROTO_hangup);
       hangup.header.size = htons (sizeof (P2P_hangup_MESSAGE));
       identity->getPeerIdentity (identity->getPublicPrivateKey (),
@@ -2109,9 +2142,6 @@
     {
       tsession = be->session.tsession;
       be->session.tsession = NULL;
-#if STRICT_STAT_DOWN
-      be->status = STAT_DOWN;
-#endif
       transport->disconnect (tsession, __FILE__);
     }
   for (i = 0; i < be->sendBufferSize; i++)
@@ -2190,7 +2220,7 @@
   int earlyRun;
   int load;
   int *perm;
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
   EncName enc;
 #endif
 
@@ -2312,7 +2342,7 @@
           entries[u]->recently_received = 0;    /* "clear" slate */
           if (entries[u]->violations > 10)
             {
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
               IF_GELOG (ectx,
                         GE_INFO | GE_BULK | GE_DEVELOPER,
                         hash2enc (&entries[u]->session.sender.hashPubKey,
@@ -2528,7 +2558,7 @@
 
       if (be->idealized_limit < MIN_BPM_PER_PEER)
         {
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
           IF_GELOG (ectx,
                     GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
                     hash2enc (&be->session.sender.hashPubKey, &enc));
@@ -2627,7 +2657,7 @@
               if ((now > root->isAlive) &&      /* concurrency might make this 
false... */
                   (now - root->isAlive > SECONDS_INACTIVE_DROP * cronSECONDS))
                 {
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
                   EncName enc;
 
                   /* switch state form UP to DOWN: too much inactivity */
@@ -2696,7 +2726,7 @@
                   (now - root->isAlive >
                    SECONDS_NOPINGPONG_DROP * cronSECONDS))
                 {
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
                   EncName enc;
 
                   IF_GELOG (ectx,
@@ -2915,7 +2945,7 @@
 handleHANGUP (const PeerIdentity * sender, const MESSAGE_HEADER * msg)
 {
   BufferEntry *be;
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
   EncName enc;
 #endif
 
@@ -2926,7 +2956,7 @@
                    &((P2P_hangup_MESSAGE *) msg)->sender,
                    sizeof (PeerIdentity)))
     return SYSERR;
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
   IF_GELOG (ectx,
             GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
             hash2enc (&sender->hashPubKey, &enc));
@@ -3020,7 +3050,7 @@
           ((be->status & STAT_SETKEY_RECEIVED) > 0) &&
           (OK == ensureTransportConnected (be)) && (be->status != STAT_UP))
         {
-#if DEBUG_CONNECTION
+#if DEBUG_CONNECTION || 1
           EncName enc;
           IF_GELOG (ectx,
                     GE_DEBUG | GE_REQUEST | GE_DEVELOPER,
@@ -3138,8 +3168,10 @@
         {
           if ((be->status & STAT_SETKEY_SENT) > 0)
             {
-              *key = be->skey_local;
-              *age = be->skey_local_created;
+              if (key != NULL)
+                *key = be->skey_local;
+              if (age != NULL)
+                *age = be->skey_local_created;
               ret = OK;
             }
         }
@@ -3147,8 +3179,10 @@
         {                       /* for receiving */
           if ((be->status & STAT_SETKEY_RECEIVED) > 0)
             {
-              *key = be->skey_remote;
-              *age = be->skey_remote_created;
+              if (key != NULL)
+                *key = be->skey_remote;
+              if (age != NULL)
+                *age = be->skey_remote_created;
               ret = OK;
             }
         }
@@ -3372,6 +3406,10 @@
                                                                "# bytes of 
outgoing messages dropped"));
       stat_hangupSent
         = stats->create (gettext_noop ("# connections closed (HANGUP sent)"));
+      stat_closedTransport
+        =
+        stats->
+        create (gettext_noop ("# connections closed (transport issue)"));
       stat_encrypted = stats->create (gettext_noop (    /* includes encrypted 
but then
                                                            not transmitted 
data */
                                                      "# bytes encrypted"));
@@ -3759,8 +3797,7 @@
   unsigned short len;
 
   ENTRY ();
-  if ((getBandwidthAssignedTo (receiver, NULL, NULL) != OK) &&
-      (identity->isBlacklistedStrict (receiver) == NO))
+  if (getBandwidthAssignedTo (receiver, NULL, NULL) != OK)
     session->tryConnect (receiver);
   if (msg == NULL)
     {

Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2007-08-24 09:10:36 UTC (rev 5535)
+++ GNUnet/src/server/handler.c 2007-08-24 09:54:16 UTC (rev 5536)
@@ -666,7 +666,7 @@
 #endif
     }
   /* check for blacklisting */
-  if (YES == identity->isBlacklistedStrict (&mp->sender))
+  if (YES == identity->isBlacklisted (&mp->sender, YES))
     {
 #if DEBUG_HANDLER
       EncName enc;

Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c        2007-08-24 09:10:36 UTC (rev 5535)
+++ GNUnet/src/transports/http.c        2007-08-24 09:54:16 UTC (rev 5536)
@@ -1396,21 +1396,23 @@
       GE_BREAK (coreAPI->ectx, 0);
       return SYSERR;
     }
-  if (httpSession->is_client) {
-    /* client */
-    if ( (important != YES) &&
-        (httpSession->cs.client.puts != NULL) )
-       return NO;            
-    return YES;
-  } else {
-    /* server */
-    if (httpSession->cs.server.wsize == 0)
+  if (httpSession->is_client)
+    {
+      /* client */
+      if ((important != YES) && (httpSession->cs.client.puts != NULL))
+        return NO;
       return YES;
-    if ( (httpSession->cs.server.wpos + size > httpSession->cs.server.wsize) &&
-        (important != YES) )
-      return NO;
-    return YES;
-  }
+    }
+  else
+    {
+      /* server */
+      if (httpSession->cs.server.wsize == 0)
+        return YES;
+      if ((httpSession->cs.server.wpos + size > httpSession->cs.server.wsize)
+          && (important != YES))
+        return NO;
+      return YES;
+    }
 }
 
 
@@ -1706,7 +1708,7 @@
       timeout = 0;
       have_tv = MHD_NO;
       if (mhd_daemon != NULL)
-       have_tv = MHD_get_timeout (mhd_daemon, &timeout);
+        have_tv = MHD_get_timeout (mhd_daemon, &timeout);
       if ((CURLM_OK == curl_multi_timeout (curl_multi, &ms)) &&
           ((ms < timeout) || (have_tv == MHD_NO)))
         {

Modified: GNUnet/src/transports/tcp_helper.c
===================================================================
--- GNUnet/src/transports/tcp_helper.c  2007-08-24 09:10:36 UTC (rev 5535)
+++ GNUnet/src/transports/tcp_helper.c  2007-08-24 09:54:16 UTC (rev 5536)
@@ -305,6 +305,7 @@
   TSession *tsession;
   TCPSession *tcpSession;
 
+  GE_ASSERT (NULL, sock != NULL);
   if (NO != blt (addr, addr_len))
     {
 #if DEBUG_TCP





reply via email to

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