gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5219 - GNUnet/src/applications/gap


From: gnunet
Subject: [GNUnet-SVN] r5219 - GNUnet/src/applications/gap
Date: Mon, 2 Jul 2007 00:54:07 -0600 (MDT)

Author: grothoff
Date: 2007-07-02 00:54:07 -0600 (Mon, 02 Jul 2007)
New Revision: 5219

Modified:
   GNUnet/src/applications/gap/gap.c
   GNUnet/src/applications/gap/gap.h
Log:
extra checks caused trouble

Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c   2007-07-02 06:48:05 UTC (rev 5218)
+++ GNUnet/src/applications/gap/gap.c   2007-07-02 06:54:07 UTC (rev 5219)
@@ -802,33 +802,6 @@
  */
 static void useContentLater(void * data) {
   MESSAGE_HEADER * pmsg = data;
-
-#if EXTRA_CHECKS
-  const P2P_gap_reply_MESSAGE * msg = data;
-  DataContainer * value;
-  unsigned int size;
-
-  if (ntohs(msg->header.size) < sizeof(P2P_gap_reply_MESSAGE)) {
-    GE_BREAK(NULL, 0);
-    FREE(pmsg);
-    return;
-  }
-  size = ntohs(msg->header.size) - sizeof(P2P_gap_reply_MESSAGE);
-  value = MALLOC(size + sizeof(DataContainer));
-  value->size = htonl(size + sizeof(DataContainer));
-  memcpy(&value[1],
-        &msg[1],
-        size);
-  if (SYSERR == bs->put(bs->closure,
-                       &msg->primaryKey,
-                       value,
-                       0)) {
-    GE_BREAK(NULL, 0);
-    FREE(pmsg);
-    return;
-  }
-#endif
-
   useContent(NULL,
             pmsg);
   FREE(pmsg);
@@ -1409,7 +1382,7 @@
   struct qLRC * cls = closure;
   int i;
 
-#if EXTRA_CHECKS || 1
+#if EXTRA_CHECKS
   /* verify data is valid */
   uri(value,
       ANY_BLOCK,
@@ -1425,19 +1398,6 @@
                    cls->values[i],
                    ntohl(value->size)))
       return OK; /* drop, duplicate entry in DB! */
-#if EXTRA_CHECKS
-  if ( (0 != memcmp(primaryKey,
-                   &cls->query,
-                   sizeof(HashCode512))) ||
-       (SYSERR == bs->put(bs->closure,
-                         &cls->query,
-                         value,
-                         0)) ) {
-    GE_BREAK(NULL, 0);
-    return OK;
-  }
-#endif
-
   GROW(cls->values,
        cls->valueCount,
        cls->valueCount+1);
@@ -1580,16 +1540,6 @@
        FREE(cls.values[perm[i]]);
        continue;
       } 
-#if EXTRA_CHECKS
-      if (SYSERR == bs->put(bs->closure,
-                           &query->queries[0],
-                           cls.values[perm[i]],
-                           0)) {
-       GE_BREAK(NULL, 0);
-       FREE(cls.values[perm[i]]);
-       continue;
-      }
-#endif
       if ( (i < max) &&
           (sender != NULL) &&
           (YES == queueReply(sender,
@@ -2001,14 +1951,6 @@
   memcpy(&reply[1],
         &data[1],
         size - sizeof(P2P_gap_reply_MESSAGE));
-#if EXTRA_CHECKS
-  /* verify content integrity */
-  GE_ASSERT(ectx,
-           SYSERR != bs->put(bs->closure,
-                             primaryKey,
-                             data,
-                             0));
-#endif
   return size;
 }
 

Modified: GNUnet/src/applications/gap/gap.h
===================================================================
--- GNUnet/src/applications/gap/gap.h   2007-07-02 06:48:05 UTC (rev 5218)
+++ GNUnet/src/applications/gap/gap.h   2007-07-02 06:54:07 UTC (rev 5219)
@@ -39,8 +39,7 @@
 
 #define DEBUG_GAP NO
 
-#define EXTRA_CHECKS YES
-// ALLOW_EXTRA_CHECKS
+#define EXTRA_CHECKS ALLOW_EXTRA_CHECKS
 
 
 /* ***************** policy constants **************** */





reply via email to

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