gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3948 - in GNUnet: . src/applications/fs/collection src/app


From: grothoff
Subject: [GNUnet-SVN] r3948 - in GNUnet: . src/applications/fs/collection src/applications/fs/ecrs
Date: Sat, 16 Dec 2006 19:33:31 -0800 (PST)

Author: grothoff
Date: 2006-12-16 19:33:26 -0800 (Sat, 16 Dec 2006)
New Revision: 3948

Modified:
   GNUnet/src/applications/fs/collection/check.conf
   GNUnet/src/applications/fs/collection/collection.c
   GNUnet/src/applications/fs/collection/collectiontest.c
   GNUnet/src/applications/fs/collection/peer.conf
   GNUnet/src/applications/fs/ecrs/check.conf
   GNUnet/src/applications/fs/ecrs/peer.conf
   GNUnet/todo
Log:
bugfixes

Modified: GNUnet/src/applications/fs/collection/check.conf
===================================================================
--- GNUnet/src/applications/fs/collection/check.conf    2006-12-17 02:15:15 UTC 
(rev 3947)
+++ GNUnet/src/applications/fs/collection/check.conf    2006-12-17 03:33:26 UTC 
(rev 3948)
@@ -7,6 +7,6 @@
 
 # Network options for the clients
 [NETWORK]
-CLIENT-PORT = 2087
+CLIENT-PORT = 12087
 HOST = "localhost"
 

Modified: GNUnet/src/applications/fs/collection/collection.c
===================================================================
--- GNUnet/src/applications/fs/collection/collection.c  2006-12-17 02:15:15 UTC 
(rev 3947)
+++ GNUnet/src/applications/fs/collection/collection.c  2006-12-17 03:33:26 UTC 
(rev 3948)
@@ -218,6 +218,10 @@
   pos = &buf[sizeof(CollectionData)];
   rsize -= sizeof(CollectionData);
   len = ntohl(*(int*)pos);
+  if (len > 1024 * 1024 * 4) {
+    GE_BREAK(ectx, 0);
+    len = 1024 * 1024 * 4;
+  }
   GROW(collectionData->files,
        collectionData->file_count,
        len);
@@ -227,6 +231,10 @@
   mlen = ntohl(*(int*)pos);
   pos += sizeof(int);
   len = ntohl(*(int*)pos);
+  if (len > 1024) {
+    GE_BREAK(ectx, 0);
+    len = 1024; 
+  }
   collectionData->name = MALLOC(len+1);
   pos += sizeof(int);
   rsize -= 4 * sizeof(int);
@@ -256,15 +264,19 @@
       GE_BREAK(ectx, 0);
       break;
     }
+    len = ntohl(*(int*)pos);
+    pos += sizeof(int);
     mlen = ntohl(*(int*)pos);
     pos += sizeof(int);
-    len = ntohl(*(int*)pos);
-    pos += sizeof(int);
     rsize -= 2 * sizeof(int);
     if (rsize < mlen + len) {
       GE_BREAK(ectx, 0);
       break;
     }
+    if (len > 1024 * 16) {
+      GE_BREAK(ectx, 0);
+      len = 1024 * 16;
+    }
     tmp = MALLOC(len + 1);
     tmp[len] = '\0';
     memcpy(tmp,
@@ -312,7 +324,7 @@
                     int val) {
   int bval;
 
-  bval = htons(val);
+  bval = htonl(val);
   WRITE(fd,
        &bval,
        sizeof(int));
@@ -333,11 +345,12 @@
   mlen = ECRS_sizeofMetaData(collectionData->meta,
                             NO);
   buf = MALLOC(mlen);
-  if (OK != ECRS_serializeMetaData(ectx,
-                                  collectionData->meta,
-                                  buf,
-                                  mlen,
-                                  NO)) {
+  if (mlen != ECRS_serializeMetaData(ectx,
+                                    collectionData->meta,
+                                    buf,
+                                    mlen,
+                                    NO)) {
+    GE_BREAK(ectx, 0);
     FREE(buf);
     return;
   }
@@ -355,12 +368,15 @@
     FREE(buf);
     return;
   } 
+  GE_BREAK(ectx,
+          collectionData->file_count <= 1024 * 1024 * 4);
   WRITE(fd, 
        collectionData, 
        sizeof(CollectionData));
   WRITEINT(fd, collectionData->file_count);
   WRITEINT(fd, collectionData->changed);
   WRITEINT(fd, mlen);
+  GE_BREAK(ectx, strlen(collectionData->name) < 1024);
   WRITEINT(fd, strlen(collectionData->name));
   WRITE(fd, collectionData->name, strlen(collectionData->name));
   WRITE(fd, buf, mlen);
@@ -369,17 +385,19 @@
     mlen = ECRS_sizeofMetaData(collectionData->files[i].meta,
                               NO);
     buf = MALLOC(mlen);
-    if (OK != ECRS_serializeMetaData(ectx,
-                                    collectionData->files[i].meta,
-                                    buf,
-                                    mlen,
-                                    NO)) {
+    if (mlen != ECRS_serializeMetaData(ectx,
+                                      collectionData->files[i].meta,
+                                      buf,
+                                      mlen,
+                                      NO)) {
+      GE_BREAK(ectx, 0);
       FREE(buf);
       break;
     }
     tmp = ECRS_uriToString(collectionData->files[i].uri);    
     WRITEINT(fd, strlen(tmp));
     WRITEINT(fd, mlen);
+    GE_BREAK(ectx, strlen(tmp) < 16 * 1024);
     WRITE(fd, tmp, strlen(tmp));
     FREE(tmp);
     WRITE(fd, buf, mlen);
@@ -452,7 +470,7 @@
   makeRandomId(&collectionData->data.lastId);
   collectionData->data.nextId = nextId;
   collectionData->data.updateInterval 
-    = htonll(updateInterval);
+    = htonl(updateInterval);
   collectionData->data.anonymityLevel
     = htonl(anonymityLevel);
   collectionData->data.priority 
@@ -536,7 +554,6 @@
   TIME_T now;
   struct ECRS_URI * uri;
   struct ECRS_URI * directoryURI;
-  struct ECRS_MetaData *  metaData;
   unsigned long long dirLen;
   char * tmpName;
   int fd;
@@ -634,7 +651,6 @@
     collectionData->changed = NO;
     ECRS_freeUri(uri);
   }
-  ECRS_freeMetaData(metaData);
   MUTEX_UNLOCK(lock);
 }
 
@@ -681,7 +697,7 @@
         collectionData->file_count,
         fc);
   collectionData->changed = YES;
-  if (ntohll(collectionData->data.updateInterval) == ECRS_SBLOCK_UPDATE_NONE)
+  if (ntohl(collectionData->data.updateInterval) == ECRS_SBLOCK_UPDATE_NONE)
     CO_publishCollectionNow();
   MUTEX_UNLOCK(lock);
 }

Modified: GNUnet/src/applications/fs/collection/collectiontest.c
===================================================================
--- GNUnet/src/applications/fs/collection/collectiontest.c      2006-12-17 
02:15:15 UTC (rev 3947)
+++ GNUnet/src/applications/fs/collection/collectiontest.c      2006-12-17 
03:33:26 UTC (rev 3948)
@@ -32,11 +32,14 @@
 
 #define CHECK(a) if (!(a)) { ok = NO; GE_BREAK(NULL, 0); goto FAILURE; }
 
+#define START_DAEMON 1
 
 int main(int argc,
         char * argv[]){
   struct GC_Configuration * cfg;
+#if START_DAEMON
   pid_t daemon;
+#endif
   int ok;
   struct ClientServerConnection * sock;
   struct ECRS_MetaData * meta;
@@ -49,6 +52,7 @@
     GC_free(cfg);
     return -1;
   }
+#if START_DAEMON
   daemon  = os_daemon_start(NULL,
                            cfg,
                            "peer.conf",
@@ -57,8 +61,9 @@
   GE_ASSERT(NULL, OK == connection_wait_for_running(NULL,
                                                    cfg,
                                                    30 * cronSECONDS));
+  PTHREAD_SLEEP(5 * cronSECONDS); /* give apps time to start */
+#endif
   ok = YES;
-  PTHREAD_SLEEP(5 * cronSECONDS); /* give apps time to start */
   meta = ECRS_createMetaData();
   ECRS_addToMetaData(meta,
                     EXTRACTOR_MIMETYPE,
@@ -69,6 +74,9 @@
 
   /* ACTUAL TEST CODE */
   CO_stopCollection();
+  ECRS_deleteNamespace(NULL,
+                      cfg,
+                      "test-collection");
   CHECK(NULL == CO_getCollection());
   CHECK(OK == CO_startCollection(1,
                                 100,
@@ -91,6 +99,9 @@
   FREE(have);
   CO_publishCollectionNow();
   CO_stopCollection();
+  ECRS_deleteNamespace(NULL,
+                      cfg,
+                      "test-collection");
   CHECK(NULL == CO_getCollection());
        
   /* END OF TEST CODE */
@@ -100,7 +111,9 @@
     connection_destroy(sock);
   }
   ECRS_freeMetaData(meta);
+#if START_DAEMON
   GE_ASSERT(NULL, OK == os_daemon_stop(NULL, daemon));
+#endif
   GC_free(cfg);
   return (ok == YES) ? 0 : 1;
 }

Modified: GNUnet/src/applications/fs/collection/peer.conf
===================================================================
--- GNUnet/src/applications/fs/collection/peer.conf     2006-12-17 02:15:15 UTC 
(rev 3947)
+++ GNUnet/src/applications/fs/collection/peer.conf     2006-12-17 03:33:26 UTC 
(rev 3948)
@@ -13,7 +13,7 @@
 PIDFILE         = $GNUNETD_HOME/gnunetd.pid
 HOSTS          = $GNUNETD_HOME/data/hosts/
 APPLICATIONS = "fs getoption stats"
-# TRANSPORTS = -- no transports!
+TRANSPORTS = ""
 
 [MODULES]
 sqstore = "sqstore_sqlite"
@@ -22,7 +22,7 @@
 topology = "topology_default"
 
 [NETWORK]
-PORT = 2087
+PORT = 12087
 INTERFACE = eth0
 HELOEXCHANGE = NO
 TRUSTED = 127.0.0.0/8;

Modified: GNUnet/src/applications/fs/ecrs/check.conf
===================================================================
--- GNUnet/src/applications/fs/ecrs/check.conf  2006-12-17 02:15:15 UTC (rev 
3947)
+++ GNUnet/src/applications/fs/ecrs/check.conf  2006-12-17 03:33:26 UTC (rev 
3948)
@@ -1,6 +1,6 @@
 # General settings
 [GNUNET]
-GNUNET_HOME = "/tmp/gnunet-session-test-driver"
+GNUNET_HOME = "/tmp/gnunet-ecrs-test-driver"
 LOGLEVEL = "WARNING"
 LOGFILE = ""
 PROCESS-PRIORITY = "NORMAL"

Modified: GNUnet/src/applications/fs/ecrs/peer.conf
===================================================================
--- GNUnet/src/applications/fs/ecrs/peer.conf   2006-12-17 02:15:15 UTC (rev 
3947)
+++ GNUnet/src/applications/fs/ecrs/peer.conf   2006-12-17 03:33:26 UTC (rev 
3948)
@@ -13,7 +13,7 @@
 PIDFILE         = $GNUNETD_HOME/gnunetd.pid
 HOSTS          = $GNUNETD_HOME/data/hosts/
 APPLICATIONS = "fs getoption stats"
-# TRANSPORTS = -- no transports!
+TRANSPORTS = ""
 
 [MODULES]
 sqstore = "sqstore_sqlite"

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-12-17 02:15:15 UTC (rev 3947)
+++ GNUnet/todo 2006-12-17 03:33:26 UTC (rev 3948)
@@ -14,33 +14,27 @@
 
 0.7.1 [12'06] (aka "stabilization")
 - stopping collection (gnunet-pseudonym -E) always fails,
-  even if collection was just started!
-- more testcases: [RCpre3]
-  * ecrs_core
-  * gap (incl. economy)
-  * fs/namespaces
-  * fs/collection
-  * advertising
-- fix critical known bugs:
-  * Windows installer [Nils]
-    + uninstall: Remove account
-    + libcurl, guile
-  * file/socket leak (#955) - possibly fixed
+  even if collection was just started! [RC]
+- investigate #1156 [RC]
+- investigate #1100
+- Windows installer [Nils]
+  * uninstall: Remove account
+  * libcurl, guile
 
 0.7.2 [3'07]:
-- Transports:
-  * SMTP/HTTP (using libcurl, libmicrohttpd, libesmtp)
-- Testcases (fix, add):
-  * dht/tools
-  * tracekit
-- Scheme (scm) specification of entire configuration;
-  check options used in modules:
-  - DHT options
-  - kvstore
-  - gnunet-gtk
-- Features:
-  * SMTP logger
-  * Chat support [RC]
+- minor improvements:
+  * Scheme (scm) specification of entire configuration;
+    check options used in modules:
+    + DHT options
+    + kvstore
+    + gnunet-gtk
+  * directories can be compacted -- add heuristic to determine
+    if we should NOT padd with zeros (if we would waste too
+    much space).  Needs some lookahead for size of remaining
+    directory entries. (theoretically can compact some directories
+    by 50% (?) -- incidentially 25% is what gzip can do on the
+    current directories!) [ CG ]
+- new features:
   * XFS / support for location URIs [CG] 
     + dstore deletion for quota maintenance [RC]
     + dstore bloomfilter
@@ -48,21 +42,24 @@
     + dht/cs: not done yet [RC]
     + dht/tools: update clients [RC]
     + dht/gap integration [RC]
-- Optimizations:
-  * directories can be compacted -- add heuristic to determine
-    if we should NOT padd with zeros (if we would waste too
-    much space).  Needs some lookahead for size of remaining
-    directory entries. (theoretically can compact some directories
-    by 50% (?) -- incidentially 25% is what gzip can do on the
-    current directories!) [ CG ]
+  * HTTP transport (libcurl, libmicrohttpd)
+  * SMTP transport (libesmtp)
+  * SMTP logger
+- testcases (fix, add):
+  * dht/tools
+  * ecrs_core
+  * gap (incl. economy)
+  * advertising
 
 0.7.3 [6'07] (aka "features"):
 - #747 (sharing stats for gnunet-gtk)
 - insert meta-data under hash (md5? sha1? sha-512? GNUnet-URI?)
   as keyword (to allow getting meta-data from URI only)
+- Chat support basics [RC]
 - Documentation:
   * LJ article
 - Testcases:
+  * tracekit
   * RPC
 
 0.7.4 [12'07] (aka "advanced features"):





reply via email to

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