[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6989 - GNUnet/src/applications/fs/collection
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6989 - GNUnet/src/applications/fs/collection |
Date: |
Sun, 1 Jun 2008 20:22:48 -0600 (MDT) |
Author: grothoff
Date: 2008-06-01 20:22:47 -0600 (Sun, 01 Jun 2008)
New Revision: 6989
Modified:
GNUnet/src/applications/fs/collection/collection.c
GNUnet/src/applications/fs/collection/collectiontest.c
Log:
fx
Modified: GNUnet/src/applications/fs/collection/collection.c
===================================================================
--- GNUnet/src/applications/fs/collection/collection.c 2008-06-02 02:11:51 UTC
(rev 6988)
+++ GNUnet/src/applications/fs/collection/collection.c 2008-06-02 02:22:47 UTC
(rev 6989)
@@ -183,7 +183,7 @@
return;
}
if ((size > 0x7FFFFFFF) ||
- (size < sizeof (CollectionData) + 4 * sizeof (int)))
+ (size < sizeof (CollectionData) + 3 * sizeof (int)))
{
GNUNET_GE_BREAK (ectx, 0);
UNLINK (fn);
@@ -224,9 +224,9 @@
pos += sizeof (int);
collectionData->changed = ntohl (*(int *) pos);
pos += sizeof (int);
- mlen = ntohl (*(int *) pos);
- pos += sizeof (int);
- rsize -= 4 * sizeof (int);
+ mlen = ntohl (*(unsigned int *) pos);
+ pos += sizeof (unsigned int);
+ rsize -= 3 * sizeof (int);
if (mlen > rsize)
{
GNUNET_GE_BREAK (ectx, 0);
Modified: GNUnet/src/applications/fs/collection/collectiontest.c
===================================================================
--- GNUnet/src/applications/fs/collection/collectiontest.c 2008-06-02
02:11:51 UTC (rev 6988)
+++ GNUnet/src/applications/fs/collection/collectiontest.c 2008-06-02
02:22:47 UTC (rev 6989)
@@ -42,8 +42,8 @@
int ok;
struct GNUNET_ClientServerConnection *sock;
struct GNUNET_ECRS_MetaData *meta;
+ struct GNUNET_ECRS_MetaData *have;
GNUNET_ECRS_FileInfo fi;
- char *have;
GNUNET_disable_entropy_gathering ();
cfg = GNUNET_GC_create ();
@@ -71,14 +71,13 @@
/* ACTUAL TEST CODE */
GNUNET_CO_collection_stop ();
- GNUNET_ECRS_namespace_delete (NULL, cfg, "test-collection");
CHECK (NULL == GNUNET_CO_collection_get_name ());
CHECK (GNUNET_OK == GNUNET_CO_collection_start (1, 100, 60, /* 60s */
- "test-collection", meta));
+ meta));
have = GNUNET_CO_collection_get_name ();
CHECK (NULL != have);
- CHECK (0 == strcmp (have, "test-collection"));
- GNUNET_free (have);
+ CHECK (GNUNET_ECRS_meta_data_test_equal (have, meta));
+ GNUNET_ECRS_meta_data_destroy (have);
fi.meta = meta;
fi.uri =
GNUNET_ECRS_string_to_uri (NULL,
@@ -89,11 +88,10 @@
GNUNET_CO_init (NULL, cfg);
have = GNUNET_CO_collection_get_name ();
CHECK (NULL != have);
- CHECK (0 == strcmp (have, "test-collection"));
- GNUNET_free (have);
+ CHECK (GNUNET_ECRS_meta_data_test_equal (have, meta));
+ GNUNET_ECRS_meta_data_destroy (have);
GNUNET_CO_collection_publish_now ();
GNUNET_CO_collection_stop ();
- GNUNET_ECRS_namespace_delete (NULL, cfg, "test-collection");
CHECK (NULL == GNUNET_CO_collection_get_name ());
/* END OF TEST CODE */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6989 - GNUnet/src/applications/fs/collection,
gnunet <=