[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5873 - in GNUnet/src: applications/fragmentation applicati
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5873 - in GNUnet/src: applications/fragmentation applications/fs applications/fs/ecrs applications/fs/lib applications/fs/module applications/identity applications/session applications/stats applications/testbed applications/testing applications/topology_default applications/tracekit include server transports util/network |
Date: |
Tue, 11 Dec 2007 23:59:59 -0700 (MST) |
Author: grothoff
Date: 2007-12-11 23:59:59 -0700 (Tue, 11 Dec 2007)
New Revision: 5873
Modified:
GNUnet/src/applications/fragmentation/fragmentation.c
GNUnet/src/applications/fs/ecrs/keyspace.c
GNUnet/src/applications/fs/ecrs/search.c
GNUnet/src/applications/fs/ecrs/unindex.c
GNUnet/src/applications/fs/ecrs/upload.c
GNUnet/src/applications/fs/ecrs_core.c
GNUnet/src/applications/fs/ecrs_core_test.c
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/lib/fslibtest.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/fs/module/ondemand.c
GNUnet/src/applications/identity/identity.c
GNUnet/src/applications/session/connect.c
GNUnet/src/applications/stats/clientapi.c
GNUnet/src/applications/stats/statistics.c
GNUnet/src/applications/testbed/commands.c
GNUnet/src/applications/testbed/testbed.c
GNUnet/src/applications/testing/testing.c
GNUnet/src/applications/testing/testingtest_loop.c
GNUnet/src/applications/topology_default/topology.c
GNUnet/src/applications/tracekit/clientapi.c
GNUnet/src/applications/tracekit/gnunet-tracekit.c
GNUnet/src/include/ecrs_core.h
GNUnet/src/include/gnunet_tracekit_lib.h
GNUnet/src/include/gnunet_util_cron.h
GNUnet/src/include/gnunet_util_network.h
GNUnet/src/server/handler.c
GNUnet/src/transports/udp.c
GNUnet/src/transports/udp6.c
GNUnet/src/util/network/io.c
Log:
formatting
Modified: GNUnet/src/applications/fragmentation/fragmentation.c
===================================================================
--- GNUnet/src/applications/fragmentation/fragmentation.c 2007-12-12
06:59:46 UTC (rev 5872)
+++ GNUnet/src/applications/fragmentation/fragmentation.c 2007-12-12
06:59:59 UTC (rev 5873)
@@ -591,8 +591,7 @@
GNUNET_GE_INFO | GNUNET_GE_USER | GNUNET_GE_REQUEST,
_("`%s' registering handler %d\n"), "fragmentation",
GNUNET_P2P_PROTO_MESSAGE_FRAGMENT);
- capi->registerHandler (GNUNET_P2P_PROTO_MESSAGE_FRAGMENT,
- &processFragment);
+ capi->registerHandler (GNUNET_P2P_PROTO_MESSAGE_FRAGMENT, &processFragment);
ret.fragment = &fragment;
return &ret;
Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -66,7 +66,8 @@
type = ntohl (value->type);
size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
if (GNUNET_OK !=
- GNUNET_EC_file_block_check_and_get_query (size, (DBlock *) & value[1],
GNUNET_YES, &query))
+ GNUNET_EC_file_block_check_and_get_query (size, (DBlock *) & value[1],
+ GNUNET_YES, &query))
return GNUNET_SYSERR;
GNUNET_GE_ASSERT (ectx, type == GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
@@ -237,8 +238,12 @@
#if EXTRA_CHECKS
/* extra check: verify sig */
GNUNET_GE_ASSERT (ectx,
- GNUNET_OK == GNUNET_EC_file_block_check_and_get_query
(size, (DBlock *) kb,
- GNUNET_YES, &hc));
+ GNUNET_OK ==
+ GNUNET_EC_file_block_check_and_get_query (size,
+ (DBlock *)
+ kb,
+ GNUNET_YES,
+ &hc));
#endif
GNUNET_RSA_free_key (pk);
if (GNUNET_OK != GNUNET_FS_insert (sock, value))
Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs/search.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -338,7 +338,9 @@
size);
#endif
if (GNUNET_OK !=
- GNUNET_EC_file_block_check_and_get_query (size, (const DBlock *)
&value[1], GNUNET_YES, &query))
+ GNUNET_EC_file_block_check_and_get_query (size,
+ (const DBlock *) &value[1],
+ GNUNET_YES, &query))
return GNUNET_SYSERR;
for (i = 0; i < sqc->queryCount; i++)
{
@@ -348,9 +350,14 @@
((ps->type == type) ||
(ps->type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)) &&
(GNUNET_YES == GNUNET_EC_is_block_applicable_for_query (type,
- size,
- (const DBlock *) &value[1],
- &query, ps->keyCount, ps->keys)))
+ size,
+ (const
+ DBlock *)
+ &value[1],
+ &query,
+ ps->
+ keyCount,
+ ps->keys)))
{
switch (type)
{
Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs/unindex.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -292,7 +292,8 @@
}
if (!wasIndexed)
{
- if (GNUNET_OK == GNUNET_EC_file_block_encode (db, size, &chk.query,
&value))
+ if (GNUNET_OK ==
+ GNUNET_EC_file_block_encode (db, size, &chk.query, &value))
{
*value = *dblock; /* copy options! */
#if STRICT_CHECKS
Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs/upload.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -289,7 +289,8 @@
if (GNUNET_OK != tt (ttClosure))
goto FAILURE;
GNUNET_EC_file_block_get_key (db, size + sizeof (DBlock), &mchk.key);
- GNUNET_EC_file_block_get_query (db, size + sizeof (DBlock), &mchk.query);
+ GNUNET_EC_file_block_get_query (db, size + sizeof (DBlock),
+ &mchk.query);
#if DEBUG_UPLOAD
IF_GELOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
@@ -316,7 +317,8 @@
value = NULL;
if (GNUNET_OK !=
GNUNET_EC_file_block_encode (db,
- size + sizeof (DBlock), &mchk.query, &value))
+ size + sizeof (DBlock),
+ &mchk.query, &value))
{
GNUNET_GE_BREAK (ectx, 0);
goto FAILURE;
Modified: GNUnet/src/applications/fs/ecrs_core.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs_core.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -45,9 +45,9 @@
*/
int
GNUNET_EC_file_block_encode (const DBlock * data,
- unsigned int len,
- const GNUNET_HashCode * query,
- GNUNET_DatastoreValue ** value)
+ unsigned int len,
+ const GNUNET_HashCode * query,
+ GNUNET_DatastoreValue ** value)
{
GNUNET_HashCode hc;
GNUNET_AES_SessionKey skey;
@@ -89,7 +89,8 @@
* a certain block of data.
*/
void
-GNUNET_EC_file_block_get_key (const DBlock * data, unsigned int len,
GNUNET_HashCode * key)
+GNUNET_EC_file_block_get_key (const DBlock * data, unsigned int len,
+ GNUNET_HashCode * key)
{
GNUNET_GE_ASSERT (NULL, len >= sizeof (DBlock));
GNUNET_hash (&data[1], len - sizeof (DBlock), key);
@@ -103,7 +104,7 @@
*/
void
GNUNET_EC_file_block_get_query (const DBlock * db, unsigned int len,
- GNUNET_HashCode * query)
+ GNUNET_HashCode * query)
{
char *tmp;
const char *data;
@@ -146,7 +147,8 @@
*/
int
GNUNET_EC_file_block_check_and_get_query (unsigned int size,
- const DBlock * data, int verify, GNUNET_HashCode * query)
+ const DBlock * data, int verify,
+ GNUNET_HashCode * query)
{
unsigned int type;
@@ -284,10 +286,11 @@
*/
int
GNUNET_EC_is_block_applicable_for_query (unsigned int type,
- unsigned int size,
- const DBlock * data,
- const GNUNET_HashCode * hc,
- unsigned int keyCount, const GNUNET_HashCode * keys)
+ unsigned int size,
+ const DBlock * data,
+ const GNUNET_HashCode * hc,
+ unsigned int keyCount,
+ const GNUNET_HashCode * keys)
{
GNUNET_HashCode h;
Modified: GNUnet/src/applications/fs/ecrs_core_test.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core_test.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/ecrs_core_test.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -43,15 +43,17 @@
data = GNUNET_malloc (len);
memset (&data[1], rand (), len - sizeof (DBlock));
data->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
- CHECK (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA == GNUNET_EC_file_block_get_type
(len, data),
- data);
+ CHECK (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA ==
+ GNUNET_EC_file_block_get_type (len, data), data);
GNUNET_EC_file_block_get_key (data, len, &key);
GNUNET_EC_file_block_get_query (data, len, &query);
- CHECK (GNUNET_OK == GNUNET_EC_file_block_encode (data, len, &query, &value),
data);
+ CHECK (GNUNET_OK == GNUNET_EC_file_block_encode (data, len, &query, &value),
+ data);
memcpy (data, &value[1], len);
GNUNET_free (value);
- CHECK (GNUNET_YES == GNUNET_EC_is_block_applicable_for_query
(GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
- len, data, &query, 1, &query),
+ CHECK (GNUNET_YES ==
+ GNUNET_EC_is_block_applicable_for_query
+ (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA, len, data, &query, 1, &query),
data);
GNUNET_free (data);
return 0;
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/lib/fslib.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -98,8 +98,8 @@
}
rep = (const CS_fs_reply_content_MESSAGE *) hdr;
size = ntohs (hdr->size) - sizeof (CS_fs_reply_content_MESSAGE);
- if (GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
(DBlock *) & rep[1], GNUNET_NO, /* gnunetd will have checked already */
- &query))
+ if (GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
(DBlock *) & rep[1], GNUNET_NO, /* gnunetd will have checked already */
+ &query))
{
GNUNET_GE_BREAK (ctx->ectx, 0);
GNUNET_free (hdr);
@@ -123,7 +123,8 @@
value->size =
htonl (size + sizeof (GNUNET_DatastoreValue));
value->type =
- htonl (GNUNET_EC_file_block_get_type (size, (DBlock *)
& rep[1]));
+ htonl (GNUNET_EC_file_block_get_type
+ (size, (DBlock *) & rep[1]));
value->prio = htonl (0);
value->anonymityLevel = rep->anonymityLevel;
value->expirationTime = rep->expirationTime;
Modified: GNUnet/src/applications/fs/lib/fslibtest.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslibtest.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/lib/fslibtest.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -126,14 +126,15 @@
blk = makeBlock (cls->i);
GNUNET_EC_file_block_get_query ((DBlock *) & blk[1],
- ntohl (blk->size) - sizeof (GNUNET_DatastoreValue),
- &ekey);
+ ntohl (blk->size) -
+ sizeof (GNUNET_DatastoreValue), &ekey);
GNUNET_GE_ASSERT (NULL,
- GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) &
blk[1],
- ntohl (blk->size) -
- sizeof
- (GNUNET_DatastoreValue),
- &ekey, &eblk));
+ GNUNET_OK ==
+ GNUNET_EC_file_block_encode ((DBlock *) & blk[1],
+ ntohl (blk->size) -
+ sizeof
+ (GNUNET_DatastoreValue),
+ &ekey, &eblk));
if ((0 == memcmp (&ekey, key, sizeof (GNUNET_HashCode)))
&& (value->size == blk->size)
&& (0 ==
@@ -167,8 +168,9 @@
dv = makeBlock (i);
db = (DBlock *) & dv[1];
- GNUNET_EC_file_block_get_query (db, ntohl (dv->size) - sizeof
(GNUNET_DatastoreValue),
- &query);
+ GNUNET_EC_file_block_get_query (db,
+ ntohl (dv->size) -
+ sizeof (GNUNET_DatastoreValue), &query);
GNUNET_free (dv);
closure.found = GNUNET_NO;
closure.i = i;
@@ -248,12 +250,13 @@
fprintf (stderr, ".");
block = makeBlock (i);
GNUNET_EC_file_block_get_query ((DBlock *) & block[1],
- ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
- &query);
- CHECK (GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) & block[1],
- ntohl (block->size) -
- sizeof (GNUNET_DatastoreValue),
- &query, &eblock));
+ ntohl (block->size) -
+ sizeof (GNUNET_DatastoreValue), &query);
+ CHECK (GNUNET_OK ==
+ GNUNET_EC_file_block_encode ((DBlock *) & block[1],
+ ntohl (block->size) -
+ sizeof (GNUNET_DatastoreValue),
+ &query, &eblock));
eblock->expirationTime = block->expirationTime;
eblock->prio = block->prio;
CHECK (GNUNET_OK == GNUNET_FS_insert (sock, eblock));
@@ -291,12 +294,13 @@
fprintf (stderr, ".");
block = makeBlock (i);
GNUNET_EC_file_block_get_query ((DBlock *) & block[1],
- ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
- &query);
- CHECK (GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) & block[1],
- ntohl (block->size) -
- sizeof (GNUNET_DatastoreValue),
- &query, &eblock));
+ ntohl (block->size) -
+ sizeof (GNUNET_DatastoreValue), &query);
+ CHECK (GNUNET_OK ==
+ GNUNET_EC_file_block_encode ((DBlock *) & block[1],
+ ntohl (block->size) -
+ sizeof (GNUNET_DatastoreValue),
+ &query, &eblock));
eblock->expirationTime = block->expirationTime;
eblock->prio = block->prio;
CHECK (GNUNET_OK == GNUNET_FS_insert (sock, eblock));
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/fs/module/fs.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -125,8 +125,9 @@
sizeof (GNUNET_DatastoreValue);
dv = GNUNET_malloc (size);
dv->size = htonl (size);
- dv->type = htonl (GNUNET_EC_file_block_get_type (size - sizeof
(GNUNET_DatastoreValue),
- (DBlock *) & gw[1]));
+ dv->type =
+ htonl (GNUNET_EC_file_block_get_type
+ (size - sizeof (GNUNET_DatastoreValue), (DBlock *) & gw[1]));
dv->prio = htonl (prio);
dv->anonymityLevel = htonl (0);
et = GNUNET_ntohll (gw->timeout);
@@ -171,8 +172,10 @@
gw = (const GapWrapper *) value;
size = ntohl (gw->dc.size) - sizeof (GapWrapper);
if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
- (const DBlock *) &gw[1],
- GNUNET_YES, &hc))
+ (const DBlock *)
+ &gw[1],
+ GNUNET_YES,
+ &hc))
|| (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
{
GNUNET_GE_BREAK_OP (ectx, 0); /* value failed verification! */
@@ -185,10 +188,13 @@
return GNUNET_SYSERR;
}
if (GNUNET_YES != GNUNET_EC_is_block_applicable_for_query (ntohl (dv->type),
- ntohl (dv->size) -
- sizeof (GNUNET_DatastoreValue),
- (const DBlock *) &dv[1], &hc, 0,
- query))
+ ntohl (dv->
+ size) -
+ sizeof
+
(GNUNET_DatastoreValue),
+ (const DBlock *)
+ &dv[1], &hc, 0,
+ query))
{
GNUNET_GE_BREAK (ectx, 0);
GNUNET_free (dv);
@@ -248,8 +254,10 @@
gw = (const GapWrapper *) value;
size = ntohl (gw->dc.size) - sizeof (GapWrapper);
if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
- (const DBlock *) &gw[1],
- GNUNET_YES, &hc))
+ (const DBlock *)
+ &gw[1],
+ GNUNET_YES,
+ &hc))
|| (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
{
GNUNET_GE_BREAK (NULL, 0);
@@ -345,8 +353,10 @@
datum->anonymityLevel = ri->anonymityLevel;
if (GNUNET_OK !=
GNUNET_EC_file_block_check_and_get_query (ntohs (ri->header.size) -
- sizeof (CS_fs_request_insert_MESSAGE),
- (const DBlock *) &ri[1], GNUNET_YES, &query))
+ sizeof
+ (CS_fs_request_insert_MESSAGE),
+ (const DBlock *) &ri[1],
+ GNUNET_YES, &query))
{
GNUNET_GE_BREAK (ectx, 0);
GNUNET_GE_BREAK (cectx, 0);
@@ -356,8 +366,8 @@
}
type =
GNUNET_EC_file_block_get_type (ntohs (ri->header.size) -
- sizeof (CS_fs_request_insert_MESSAGE),
- (const DBlock *) &ri[1]);
+ sizeof (CS_fs_request_insert_MESSAGE),
+ (const DBlock *) &ri[1]);
#if DEBUG_FS
IF_GELOG (ectx, GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
GNUNET_hash_to_enc (&query, &enc));
@@ -402,10 +412,11 @@
gw->timeout = GNUNET_htonll (et);
memcpy (&gw[1], &ri[1], size - sizeof (GapWrapper));
/* sanity check */
- if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size -
sizeof (GapWrapper),
- (const DBlock *) &gw[1],
- GNUNET_YES,
- &hc))
+ if ((GNUNET_OK !=
+ GNUNET_EC_file_block_check_and_get_query (size -
+ sizeof (GapWrapper),
+ (const DBlock *) &gw[1],
+ GNUNET_YES, &hc))
|| (0 != memcmp (&hc, &query, sizeof (GNUNET_HashCode))))
{
GNUNET_GE_BREAK (NULL, 0);
@@ -592,15 +603,17 @@
sizeof (CS_fs_request_delete_MESSAGE));
type =
GNUNET_EC_file_block_get_type (ntohs (rd->header.size) -
- sizeof (CS_fs_request_delete_MESSAGE),
- (const DBlock *) &rd[1]);
+ sizeof (CS_fs_request_delete_MESSAGE),
+ (const DBlock *) &rd[1]);
value->type = htonl (type);
memcpy (&value[1],
&rd[1], ntohs (req->size) - sizeof (CS_fs_request_delete_MESSAGE));
if (GNUNET_OK !=
GNUNET_EC_file_block_check_and_get_query (ntohs (rd->header.size) -
- sizeof (CS_fs_request_delete_MESSAGE),
- (const DBlock *) &rd[1], GNUNET_NO, &query))
+ sizeof
+ (CS_fs_request_delete_MESSAGE),
+ (const DBlock *) &rd[1],
+ GNUNET_NO, &query))
{
GNUNET_free (value);
GNUNET_GE_BREAK (ectx, 0);
@@ -776,8 +789,11 @@
}
#if EXTRA_CHECKS
if ((GNUNET_OK !=
- GNUNET_EC_file_block_check_and_get_query (ntohl (value->size) - sizeof
(GNUNET_DatastoreValue),
- (const DBlock *) &value[1], GNUNET_YES, &hc))
+ GNUNET_EC_file_block_check_and_get_query (ntohl (value->size) -
+ sizeof
+ (GNUNET_DatastoreValue),
+ (const DBlock *) &value[1],
+ GNUNET_YES, &hc))
|| (!equalsGNUNET_HashCode (&hc, key)))
{
GNUNET_GE_BREAK (ectx, 0); /* value failed verification! */
@@ -785,10 +801,12 @@
}
#endif
ret = GNUNET_EC_is_block_applicable_for_query (ntohl (value->type),
- ntohl (value->size) -
- sizeof (GNUNET_DatastoreValue),
- (const DBlock *) &value[1], key, ggc->keyCount,
- ggc->keys);
+ ntohl (value->size) -
+ sizeof
+ (GNUNET_DatastoreValue),
+ (const DBlock *) &value[1],
+ key, ggc->keyCount,
+ ggc->keys);
if (ret == GNUNET_SYSERR)
{
IF_GELOG (ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
@@ -967,15 +985,16 @@
return GNUNET_NO;
}
gw = (const GapWrapper *) content;
- if ((GNUNET_OK == GNUNET_EC_file_block_check_and_get_query (size - sizeof
(GapWrapper),
- (const DBlock *) &gw[1],
- verify,
- &q)) &&
- (0 == memcmp (&q,
- primaryKey, sizeof (GNUNET_HashCode))) &&
- ((type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY) ||
- (type == (t = GNUNET_EC_file_block_get_type (size - sizeof (GapWrapper),
- (const DBlock *) &gw[1])))))
+ if ((GNUNET_OK ==
+ GNUNET_EC_file_block_check_and_get_query (size - sizeof (GapWrapper),
+ (const DBlock *) &gw[1],
+ verify, &q))
+ && (0 == memcmp (&q, primaryKey, sizeof (GNUNET_HashCode)))
+ && ((type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)
+ || (type ==
+ (t =
+ GNUNET_EC_file_block_get_type (size - sizeof (GapWrapper),
+ (const DBlock *) &gw[1])))))
{
switch (type)
{
Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c 2007-12-12 06:59:46 UTC
(rev 5872)
+++ GNUnet/src/applications/fs/module/ondemand.c 2007-12-12 06:59:59 UTC
(rev 5873)
@@ -254,7 +254,8 @@
#if EXTRA_CHECKS
{
GNUNET_DatastoreValue *dsvalue;
- if (GNUNET_OK != GNUNET_EC_file_block_encode (content, size, &key,
&dsvalue))
+ if (GNUNET_OK !=
+ GNUNET_EC_file_block_encode (content, size, &key, &dsvalue))
{
GNUNET_GE_BREAK (cectx, 0);
GNUNET_GE_BREAK (ectx, 0);
@@ -502,8 +503,8 @@
}
CLOSE (fileHandle);
ret = GNUNET_EC_file_block_encode (db,
- ntohl (odb->blockSize) + sizeof (DBlock),
- query, enc);
+ ntohl (odb->blockSize) + sizeof (DBlock),
+ query, enc);
GNUNET_free (db);
GNUNET_free (fn);
if (ret == GNUNET_SYSERR)
Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/identity/identity.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -1192,7 +1192,7 @@
if (sizeof (CS_identity_connect_MESSAGE) != ntohs (message->size))
return GNUNET_SYSERR;
msg = (const CS_identity_connect_MESSAGE *) message;
- whitelistHost(&msg->other);
+ whitelistHost (&msg->other);
coreAPI->unicast (&msg->other, NULL, 0, 0);
ret = coreAPI->queryPeerStatus (&msg->other, NULL, NULL);
return coreAPI->sendValueToClient (sock,
Modified: GNUnet/src/applications/session/connect.c
===================================================================
--- GNUnet/src/applications/session/connect.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/session/connect.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -874,9 +874,10 @@
#if DEBUG_SESSION
GNUNET_GE_LOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_USER | GNUNET_GE_REQUEST,
- "Peer `%s' blacklisted, cannot connect right now\n",
&enc);
+ "Peer `%s' blacklisted, cannot connect right now\n",
+ &enc);
#endif
- return GNUNET_NO; /* not allowed right now! */
+ return GNUNET_NO; /* not allowed right now! */
}
#if DEBUG_SESSION
GNUNET_GE_LOG (ectx,
Modified: GNUnet/src/applications/stats/clientapi.c
===================================================================
--- GNUnet/src/applications/stats/clientapi.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/stats/clientapi.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -356,7 +356,8 @@
((char
*) (((CS_stats_reply_MESSAGE_GENERIC *)
statMsg)->values))[mpos],
- GNUNET_ntohll (((CS_stats_reply_MESSAGE_GENERIC *)
statMsg)->values[i]), cls);
+ GNUNET_ntohll (((CS_stats_reply_MESSAGE_GENERIC *)
+ statMsg)->values[i]), cls);
}
mpos +=
strlen (&
Modified: GNUnet/src/applications/stats/statistics.c
===================================================================
--- GNUnet/src/applications/stats/statistics.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/stats/statistics.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -315,7 +315,7 @@
/* second pass: copy values and messages to message */
for (pos = start; pos < end; pos++)
((CS_stats_reply_MESSAGE_GENERIC *) statMsg)->values[pos -
- start] =
+ start] =
GNUNET_htonll (entries[pos].value);
mpos = sizeof (unsigned long long) * (end - start);
for (pos = start; pos < end; pos++)
@@ -431,8 +431,7 @@
&handleMessageSupported);
capi->
registerClientHandler
- (GNUNET_CS_PROTO_STATS_GET_CS_MESSAGE_SUPPORTED,
- &handleMessageSupported);
+ (GNUNET_CS_PROTO_STATS_GET_CS_MESSAGE_SUPPORTED, &handleMessageSupported);
capi->registerClientHandler (GNUNET_CS_PROTO_TRAFFIC_COUNT,
&processGetConnectionCountRequest);
capi->registerHandler (GNUNET_P2P_PROTO_NOISE, &processNoise);
@@ -465,8 +464,7 @@
&handleMessageSupported);
coreAPI->
unregisterClientHandler
- (GNUNET_CS_PROTO_STATS_GET_CS_MESSAGE_SUPPORTED,
- &handleMessageSupported);
+ (GNUNET_CS_PROTO_STATS_GET_CS_MESSAGE_SUPPORTED, &handleMessageSupported);
coreAPI->unregisterClientHandler (GNUNET_CS_PROTO_TRAFFIC_COUNT,
&processGetConnectionCountRequest);
coreAPI->unregisterHandler (GNUNET_P2P_PROTO_NOISE, &processNoise);
Modified: GNUnet/src/applications/testbed/commands.c
===================================================================
--- GNUnet/src/applications/testbed/commands.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/testbed/commands.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -118,8 +118,7 @@
msg->header.size = htons (msgsz);
msg->header.type = htons (GNUNET_CS_PROTO_TESTBED_REQUEST);
msg->msgType = htonl (msgType);
- memcpy (&((TESTBED_CS_MESSAGE_GENERIC *) msg)->data[0], arg,
- argSize);
+ memcpy (&((TESTBED_CS_MESSAGE_GENERIC *) msg)->data[0], arg, argSize);
msgsz = GNUNET_client_connection_write (&nodes[peer].sock, &msg->header);
GNUNET_free (msg);
if (msgsz == GNUNET_SYSERR)
@@ -1006,8 +1005,7 @@
reply = NULL;
if (GNUNET_SYSERR ==
GNUNET_client_connection_read (&nodes[dst].sock,
- (CS_MESSAGE_HEADER **) &
- reply))
+ (CS_MESSAGE_HEADER **) & reply))
{
XPRINTF (" peer %s is not responding after %d of %d bytes.\n",
nodes[dst].ips, pos, ack);
@@ -1310,8 +1308,7 @@
msg->header.header.type = htons (GNUNET_CS_PROTO_TESTBED_REQUEST);
msg->header.msgType = htonl (TESTBED_UPLOAD_FILE);
msg->type = htonl (TESTBED_FILE_DELETE);
- memcpy (((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf, argv[2],
- flen);
+ memcpy (((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf, argv[2], flen);
if (GNUNET_SYSERR ==
GNUNET_client_connection_write (&nodes[peer].sock, &msg->header.header))
Modified: GNUnet/src/applications/testbed/testbed.c
===================================================================
--- GNUnet/src/applications/testbed/testbed.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/testbed/testbed.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -667,12 +667,10 @@
pi = GNUNET_malloc (sizeof (ProcessInfo));
pi->argc = 0;
for (pos = 0; pos < size; pos++)
- if (((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->commandLine[pos] ==
- '\0')
+ if (((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->commandLine[pos] == '\0')
pi->argc++;
mainName =
- GNUNET_strdup (&((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->
- commandLine[0]);
+ GNUNET_strdup (&((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->commandLine[0]);
clientConfig = NULL;
if (0 == strncmp ("gnunet", mainName, strlen ("gnunet")))
clientConfig = getConfigurationString ("TESTBED", "CLIENTCONFIG");
@@ -683,8 +681,7 @@
pi->argv[0] = mainName;
pi->argv[pi->argc] = NULL; /* termination! */
for (pos = size - 2; pos >= 0; pos--)
- if (((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->commandLine[pos] ==
- '\0')
+ if (((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->commandLine[pos] == '\0')
pi->argv[--argc2] =
GNUNET_strdup (&((TESTBED_EXEC_MESSAGE_GENERIC *) emsg)->
commandLine[pos + 1]);
@@ -931,7 +928,7 @@
return;
}
GNUNET_free (filename);
- s = ((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf + strlen
(((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf) + 1; /* \0 added */
+ s = ((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf + strlen
(((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf) + 1; /* \0 added */
size = ntohs (msg->header.header.size) -
sizeof (TESTBED_UPLOAD_FILE_MESSAGE) -
(strlen (((TESTBED_UPLOAD_FILE_MESSAGE_GENERIC *) msg)->buf) + 1);
Modified: GNUnet/src/applications/testing/testing.c
===================================================================
--- GNUnet/src/applications/testing/testing.c 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/applications/testing/testing.c 2007-12-12 06:59:59 UTC (rev
5873)
@@ -211,21 +211,19 @@
}
#if VERBOSE
-static int printInfo(void *data,
- const GNUNET_PeerIdentity *
- identity,
- const void *address,
- unsigned int addr_len,
- GNUNET_CronTime last_message,
- unsigned int trust,
- unsigned int bpmFromPeer) {
+static int
+printInfo (void *data,
+ const GNUNET_PeerIdentity *
+ identity,
+ const void *address,
+ unsigned int addr_len,
+ GNUNET_CronTime last_message,
+ unsigned int trust, unsigned int bpmFromPeer)
+{
GNUNET_EncName oth;
- GNUNET_hash_to_enc(&identity->hashPubKey, &oth);
- fprintf(stderr,
- "%s: %llu - %u\n",
- (const char*) &oth,
- last_message,
- bpmFromPeer);
+ GNUNET_hash_to_enc (&identity->hashPubKey, &oth);
+ fprintf (stderr,
+ "%s: %llu - %u\n", (const char *) &oth, last_message, bpmFromPeer);
return GNUNET_OK;
}
#endif
@@ -299,33 +297,22 @@
GNUNET_free_non_null (h1);
GNUNET_free_non_null (h2);
}
- if (ret != GNUNET_OK)
- {
+ if (ret != GNUNET_OK)
+ {
#if VERBOSE
- GNUNET_EncName e1;
- GNUNET_EncName e2;
- GNUNET_hash_to_enc(&h1->senderIdentity.hashPubKey,
- &e1);
- GNUNET_hash_to_enc(&h2->senderIdentity.hashPubKey,
- &e2);
- fprintf(stderr,
- "\nFailed to connect `%s' and `%s'\n",
- (const char*) &e1,
- (const char*) &e2);
- fprintf(stderr,
- "Connections of `%s':\n",
- (const char*) &e1);
- GNUNET_IDENTITY_request_peer_infos(sock1,
- &printInfo,
- NULL);
- fprintf(stderr,
- "Connections of `%s':\n",
- (const char*) &e2);
- GNUNET_IDENTITY_request_peer_infos(sock2,
- &printInfo,
- NULL);
+ GNUNET_EncName e1;
+ GNUNET_EncName e2;
+ GNUNET_hash_to_enc (&h1->senderIdentity.hashPubKey, &e1);
+ GNUNET_hash_to_enc (&h2->senderIdentity.hashPubKey, &e2);
+ fprintf (stderr,
+ "\nFailed to connect `%s' and `%s'\n",
+ (const char *) &e1, (const char *) &e2);
+ fprintf (stderr, "Connections of `%s':\n", (const char *) &e1);
+ GNUNET_IDENTITY_request_peer_infos (sock1, &printInfo, NULL);
+ fprintf (stderr, "Connections of `%s':\n", (const char *) &e2);
+ GNUNET_IDENTITY_request_peer_infos (sock2, &printInfo, NULL);
#endif
- }
+ }
fprintf (stderr, "%s\n", ret == GNUNET_OK ? "!" : "?");
GNUNET_client_connection_destroy (sock1);
GNUNET_client_connection_destroy (sock2);
Modified: GNUnet/src/applications/testing/testingtest_loop.c
===================================================================
--- GNUnet/src/applications/testing/testingtest_loop.c 2007-12-12 06:59:46 UTC
(rev 5872)
+++ GNUnet/src/applications/testing/testingtest_loop.c 2007-12-12 06:59:59 UTC
(rev 5873)
@@ -45,28 +45,30 @@
int j;
int i;
- for (j=0;j<LOOP_COUNT; j++) {
- peers = GNUNET_TESTING_start_daemons ("tcp",
- "advertising topology stats",
- "/tmp/gnunet-testing-test-loop",
- 2087, 10, PEER_COUNT);
- if (peers == NULL)
- {
- fprintf (stderr, "Failed to start the gnunetd daemons!\n");
- return -1;
- }
- /* connect as star-topology */
- for (i = 1; i < PEER_COUNT; i++)
- {
- if (GNUNET_OK != GNUNET_TESTING_connect_daemons (2087, 2087 + 10 * i))
- {
- GNUNET_TESTING_stop_daemons (peers);
- fprintf (stderr, "Failed to connect the peers!\n");
- return -1;
- }
- }
- GNUNET_TESTING_stop_daemons (peers);
- }
+ for (j = 0; j < LOOP_COUNT; j++)
+ {
+ peers = GNUNET_TESTING_start_daemons ("tcp",
+ "advertising topology stats",
+ "/tmp/gnunet-testing-test-loop",
+ 2087, 10, PEER_COUNT);
+ if (peers == NULL)
+ {
+ fprintf (stderr, "Failed to start the gnunetd daemons!\n");
+ return -1;
+ }
+ /* connect as star-topology */
+ for (i = 1; i < PEER_COUNT; i++)
+ {
+ if (GNUNET_OK !=
+ GNUNET_TESTING_connect_daemons (2087, 2087 + 10 * i))
+ {
+ GNUNET_TESTING_stop_daemons (peers);
+ fprintf (stderr, "Failed to connect the peers!\n");
+ return -1;
+ }
+ }
+ GNUNET_TESTING_stop_daemons (peers);
+ }
return 0;
}
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2007-12-12 06:59:46 UTC
(rev 5872)
+++ GNUnet/src/applications/topology_default/topology.c 2007-12-12 06:59:59 UTC
(rev 5873)
@@ -526,75 +526,77 @@
{
GNUNET_free (fn);
fn = NULL;
- if ( (friends_only) ||
- (minimum_friend_count > 0) ) {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_ERROR |
- GNUNET_GE_IMMEDIATE,
- _("Could not read friends list `%s'\n"), fn);
- return GNUNET_SYSERR;
- }
+ if ((friends_only) || (minimum_friend_count > 0))
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_ERROR |
+ GNUNET_GE_IMMEDIATE,
+ _("Could not read friends list `%s'\n"), fn);
+ return GNUNET_SYSERR;
+ }
}
- if (fn != NULL)
+ if (fn != NULL)
{
data = GNUNET_malloc (size);
if (size != GNUNET_disk_file_read (ectx, fn, size, data))
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
- _("Failed to read friends list from `%s'\n"), fn);
- GNUNET_free (fn);
- GNUNET_free (data);
- return GNUNET_SYSERR;
- }
- GNUNET_free (fn);
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("Failed to read friends list from `%s'\n"), fn);
+ GNUNET_free (fn);
+ GNUNET_free (data);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_free (fn);
pos = 0;
while ((pos < size) && isspace (data[pos]))
- pos++;
+ pos++;
while (pos <= size - sizeof (GNUNET_EncName))
- {
- memcpy (&enc, &data[pos], sizeof (GNUNET_EncName));
- if (!isspace (enc.encoding[sizeof (GNUNET_EncName) - 1]))
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK |
GNUNET_GE_USER,
- _
- ("Syntax error in topology specification, skipping
bytes.\n"));
- continue;
- }
- enc.encoding[sizeof (GNUNET_EncName) - 1] = '\0';
- if (GNUNET_OK == GNUNET_enc_to_hash ((char *) &enc, &hc))
- {
- GNUNET_array_grow (friends, friendCount, friendCount + 1);
- friends[friendCount - 1].hashPubKey = hc;
- }
- else
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK |
GNUNET_GE_USER,
- _
- ("Syntax error in topology specification, skipping
bytes `%s'.\n"),
- &enc);
- }
- pos = pos + sizeof (GNUNET_EncName);
- while ((pos < size) && isspace (data[pos]))
- pos++;
- }
+ {
+ memcpy (&enc, &data[pos], sizeof (GNUNET_EncName));
+ if (!isspace (enc.encoding[sizeof (GNUNET_EncName) - 1]))
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK |
+ GNUNET_GE_USER,
+ _
+ ("Syntax error in topology specification,
skipping bytes.\n"));
+ continue;
+ }
+ enc.encoding[sizeof (GNUNET_EncName) - 1] = '\0';
+ if (GNUNET_OK == GNUNET_enc_to_hash ((char *) &enc, &hc))
+ {
+ GNUNET_array_grow (friends, friendCount, friendCount + 1);
+ friends[friendCount - 1].hashPubKey = hc;
+ }
+ else
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK |
+ GNUNET_GE_USER,
+ _
+ ("Syntax error in topology specification,
skipping bytes `%s'.\n"),
+ &enc);
+ }
+ pos = pos + sizeof (GNUNET_EncName);
+ while ((pos < size) && isspace (data[pos]))
+ pos++;
+ }
if ((minimum_friend_count > friendCount) && (friends_only == GNUNET_NO))
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
- _
- ("Fewer friends specified than required by minimum
friend count. Will only connect to friends.\n"));
- }
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _
+ ("Fewer friends specified than required by minimum
friend count. Will only connect to friends.\n"));
+ }
if ((minimum_friend_count > coreAPI->getSlotCount ()) &&
- (friends_only == GNUNET_NO))
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
- _
- ("More friendly connections required than target total
number of connections.\n"));
- }
+ (friends_only == GNUNET_NO))
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _
+ ("More friendly connections required than target
total number of connections.\n"));
+ }
}
return 0;
}
@@ -666,9 +668,7 @@
coreAPI->releaseService (pingpong);
pingpong = NULL;
coreAPI = NULL;
- GNUNET_array_grow(friends,
- friendCount,
- 0);
+ GNUNET_array_grow (friends, friendCount, 0);
return GNUNET_OK;
}
Modified: GNUnet/src/applications/tracekit/clientapi.c
===================================================================
--- GNUnet/src/applications/tracekit/clientapi.c 2007-12-12 06:59:46 UTC
(rev 5872)
+++ GNUnet/src/applications/tracekit/clientapi.c 2007-12-12 06:59:59 UTC
(rev 5873)
@@ -41,63 +41,59 @@
* @param cls extra argument to report function
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_TRACEKIT_run (struct GNUNET_ClientServerConnection *sock,
- unsigned int depth,
- unsigned int priority,
- GNUNET_TRACEKIT_ReportCallback report,
- void * cls) {
+int
+GNUNET_TRACEKIT_run (struct GNUNET_ClientServerConnection *sock,
+ unsigned int depth,
+ unsigned int priority,
+ GNUNET_TRACEKIT_ReportCallback report, void *cls)
+{
CS_tracekit_probe_MESSAGE probe;
CS_tracekit_reply_MESSAGE *reply;
int i;
int count;
-
+
probe.header.size = htons (sizeof (CS_tracekit_probe_MESSAGE));
probe.header.type = htons (GNUNET_CS_PROTO_TRACEKIT_PROBE);
- probe.hops = htonl(depth);
- probe.priority = htonl(priority);
+ probe.hops = htonl (depth);
+ probe.priority = htonl (priority);
if (GNUNET_SYSERR == GNUNET_client_connection_write (sock, &probe.header))
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
reply = NULL;
while (GNUNET_OK ==
GNUNET_client_connection_read (sock,
- (GNUNET_MessageHeader **) &reply))
+ (GNUNET_MessageHeader **) & reply))
{
- count =
- ntohs (reply->header.size) - sizeof (CS_tracekit_reply_MESSAGE);
- if ( (count < 0) ||
- (0 != count % sizeof (GNUNET_PeerIdentity)) )
+ count = ntohs (reply->header.size) - sizeof (CS_tracekit_reply_MESSAGE);
+ if ((count < 0) || (0 != count % sizeof (GNUNET_PeerIdentity)))
{
GNUNET_GE_BREAK (NULL, 0);
return GNUNET_SYSERR;
}
count = count / sizeof (GNUNET_PeerIdentity);
- if (count == 0)
- {
- if (GNUNET_OK !=
- report(cls,
- &reply->responderId,
- NULL) ) {
- GNUNET_free(reply);
- return GNUNET_OK; /* application aborted */
- }
- }
- else
- {
- for (i=0;i<count;i++)
- {
- if (GNUNET_OK !=
- report(cls,
- &reply->responderId,
- &((GNUNET_PeerIdentity*) &reply[1])[i]))
- {
- GNUNET_free(reply);
- return GNUNET_OK; /* application aborted */
- }
- }
- }
+ if (count == 0)
+ {
+ if (GNUNET_OK != report (cls, &reply->responderId, NULL))
+ {
+ GNUNET_free (reply);
+ return GNUNET_OK; /* application aborted */
+ }
+ }
+ else
+ {
+ for (i = 0; i < count; i++)
+ {
+ if (GNUNET_OK !=
+ report (cls,
+ &reply->responderId,
+ &((GNUNET_PeerIdentity *) & reply[1])[i]))
+ {
+ GNUNET_free (reply);
+ return GNUNET_OK; /* application aborted */
+ }
+ }
+ }
GNUNET_free (reply);
reply = NULL;
}
return GNUNET_OK;
}
-
Modified: GNUnet/src/applications/tracekit/gnunet-tracekit.c
===================================================================
--- GNUnet/src/applications/tracekit/gnunet-tracekit.c 2007-12-12 06:59:46 UTC
(rev 5872)
+++ GNUnet/src/applications/tracekit/gnunet-tracekit.c 2007-12-12 06:59:59 UTC
(rev 5873)
@@ -31,7 +31,8 @@
#include "gnunet_tracekit_lib.h"
#include "tracekit.h"
-struct SeenRecord {
+struct SeenRecord
+{
GNUNET_PeerIdentity src;
GNUNET_PeerIdentity dst;
};
@@ -50,31 +51,27 @@
static unsigned int delay = 300;
-static struct SeenRecord * seen;
+static struct SeenRecord *seen;
static unsigned int count;
static int
-check_seen(const GNUNET_PeerIdentity * src,
- const GNUNET_PeerIdentity * dst) {
+check_seen (const GNUNET_PeerIdentity * src, const GNUNET_PeerIdentity * dst)
+{
static GNUNET_PeerIdentity null_peer;
unsigned int j;
if (dst == NULL)
dst = &null_peer;
for (j = 0; j < count; j++)
- if ( (0 == memcmp (src,
- &seen[j].src,
- sizeof (GNUNET_HashCode)) ) &&
- (0 == memcmp (dst,
- &seen[j].dst,
- sizeof (GNUNET_HashCode) ) ) )
+ if ((0 == memcmp (src,
+ &seen[j].src,
+ sizeof (GNUNET_HashCode))) &&
+ (0 == memcmp (dst, &seen[j].dst, sizeof (GNUNET_HashCode))))
return GNUNET_YES;
- GNUNET_array_grow(seen,
- count,
- count+1);
- seen[count-1].src = *src;
- seen[count-1].dst = *dst;
+ GNUNET_array_grow (seen, count, count + 1);
+ seen[count - 1].src = *src;
+ seen[count - 1].dst = *dst;
return GNUNET_NO;
}
@@ -89,29 +86,29 @@
* GNUNET_SYSERR to abort
*/
static int
-human_readable(void * unused,
- const GNUNET_PeerIdentity * reporter,
- const GNUNET_PeerIdentity * link) {
+human_readable (void *unused,
+ const GNUNET_PeerIdentity * reporter,
+ const GNUNET_PeerIdentity * link)
+{
GNUNET_EncName src;
GNUNET_EncName dst;
- if (check_seen(reporter, link))
+ if (check_seen (reporter, link))
return GNUNET_OK;
-
- GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
- if (link != NULL)
+
+ GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
+ if (link != NULL)
{
GNUNET_hash_to_enc (&link->hashPubKey, &dst);
- fprintf(stdout,
- _("`%s' connected to `%s'.\n"),
- (const char*) &src,
- (const char*) &dst);
+ fprintf (stdout,
+ _("`%s' connected to `%s'.\n"),
+ (const char *) &src, (const char *) &dst);
}
- else
+ else
{
- fprintf(stdout,
- _("`%s' is not connected to any peer.\n"),
- (const char*) &src);
+ fprintf (stdout,
+ _("`%s' is not connected to any peer.\n"),
+ (const char *) &src);
}
return GNUNET_OK;
}
@@ -127,26 +124,27 @@
* GNUNET_SYSERR to abort
*/
static int
-dot_format(void * unused,
- const GNUNET_PeerIdentity * reporter,
- const GNUNET_PeerIdentity * link) {
+dot_format (void *unused,
+ const GNUNET_PeerIdentity * reporter,
+ const GNUNET_PeerIdentity * link)
+{
GNUNET_EncName src;
GNUNET_EncName dst;
- if (check_seen(reporter, link))
+ if (check_seen (reporter, link))
return GNUNET_OK;
- GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
+ GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
if (link != NULL)
{
GNUNET_hash_to_enc (&link->hashPubKey, &dst);
printf (" \"%.*s\" -> \"%.*s\";\n",
- 4, (char *) &src, 4, (char *) &dst);
- }
+ 4, (char *) &src, 4, (char *) &dst);
+ }
else
{
printf (" %.*s;\n", 4, (char *) &src);
}
-
+
return GNUNET_OK;
}
@@ -161,23 +159,24 @@
* GNUNET_SYSERR to abort
*/
static int
-vcg_format(void * unused,
- const GNUNET_PeerIdentity * reporter,
- const GNUNET_PeerIdentity * link) {
+vcg_format (void *unused,
+ const GNUNET_PeerIdentity * reporter,
+ const GNUNET_PeerIdentity * link)
+{
GNUNET_EncName src;
GNUNET_EncName dst;
- if (check_seen(reporter, link))
+ if (check_seen (reporter, link))
return GNUNET_OK;
- GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
+ GNUNET_hash_to_enc (&reporter->hashPubKey, &src);
if (link != NULL)
{
GNUNET_hash_to_enc (&link->hashPubKey, &dst);
printf
- ("\tedge: { sourcename: \"%s\" targetname: \"%s\" }\n",
- (char *) &src, (char *) &dst);
+ ("\tedge: { sourcename: \"%s\" targetname: \"%s\" }\n",
+ (char *) &src, (char *) &dst);
}
- else
+ else
{
/* deferred -- vcg needs all node data in one line */
}
@@ -189,7 +188,7 @@
process (void *cls)
{
static GNUNET_PeerIdentity null_peer;
- GNUNET_PeerIdentity * current;
+ GNUNET_PeerIdentity *current;
struct GNUNET_ClientServerConnection *sock = cls;
GNUNET_TRACEKIT_ReportCallback report;
GNUNET_EncName enc;
@@ -199,13 +198,13 @@
int is_first;
report = NULL;
- switch (format)
+ switch (format)
{
case 0:
report = &human_readable;
break;
case 1:
- printf ("digraph G {\n");
+ printf ("digraph G {\n");
report = &dot_format;
break;
case 2:
@@ -213,74 +212,67 @@
printf ("graph: {\n");
break;
default:
- GNUNET_GE_BREAK(NULL, 0);
+ GNUNET_GE_BREAK (NULL, 0);
}
- GNUNET_TRACEKIT_run(sock,
- depth,
- priority,
- report,
- NULL);
+ GNUNET_TRACEKIT_run (sock, depth, priority, report, NULL);
/* final processing loop */
- for (i=0;i<count*2;i++)
+ for (i = 0; i < count * 2; i++)
{
if (0 == i % 2)
- current = &seen[i / 2].src;
+ current = &seen[i / 2].src;
else
- current = &seen[i / 2].dst;
- if (0 == memcmp(current,
- &null_peer,
- sizeof(GNUNET_PeerIdentity)) )
- continue;
+ current = &seen[i / 2].dst;
+ if (0 == memcmp (current, &null_peer, sizeof (GNUNET_PeerIdentity)))
+ continue;
is_first = GNUNET_YES;
- for (j=0;j<count*2;j++)
- if (0 == memcmp(current,
- (0 == i % 2) ? &seen[i/2].src : &seen[i/2].dst,
- sizeof(GNUNET_PeerIdentity)) )
- {
- is_first = GNUNET_NO;
- break;
- }
+ for (j = 0; j < count * 2; j++)
+ if (0 == memcmp (current,
+ (0 == i % 2) ? &seen[i / 2].src : &seen[i / 2].dst,
+ sizeof (GNUNET_PeerIdentity)))
+ {
+ is_first = GNUNET_NO;
+ break;
+ }
if (is_first != GNUNET_YES)
- continue; /* only each peer once */
+ continue; /* only each peer once */
is_source = GNUNET_NO;
- for (j=0;j<count;j++)
- {
- if (0 == memcmp(current,
- &seen[i].src,
- sizeof(GNUNET_PeerIdentity)) )
- {
- is_source = GNUNET_YES;
- break;
- }
- }
- switch (format)
- {
- case 0:
- break;
- case 1:
- if (is_source == GNUNET_NO)
- {
- printf (" \"%.*s\" [style=filled,color=\".7 .3 1.0\"];\n",
- 4, (char *) &enc);
- }
- break;
- case 2:
- if (is_source == GNUNET_NO)
- {
- printf
+ for (j = 0; j < count; j++)
+ {
+ if (0 == memcmp (current,
+ &seen[i].src, sizeof (GNUNET_PeerIdentity)))
+ {
+ is_source = GNUNET_YES;
+ break;
+ }
+ }
+ switch (format)
+ {
+ case 0:
+ break;
+ case 1:
+ if (is_source == GNUNET_NO)
+ {
+ printf (" \"%.*s\" [style=filled,color=\".7 .3 1.0\"];\n",
+ 4, (char *) &enc);
+ }
+ break;
+ case 2:
+ if (is_source == GNUNET_NO)
+ {
+ printf
("\tnode: { title: \"%s\" label: \"%.*s\" shape: \"ellipse\"
}\n",
(char *) &enc, 4, (char *) &enc);
- }
- else
- {
+ }
+ else
+ {
printf ("\tnode: { title: \"%s\" label: \"%.*s\" }\n",
(char *) &enc, 4, (char *) &enc);
- }
- break;
- }
+ }
+ break;
+ }
}
/* close syntax */
- switch (format)
+ switch (format)
{
case 0:
break;
@@ -295,56 +287,57 @@
}
#if 0
- for (i = 0; i < psCount; i++)
- {
- GNUNET_EncName enc;
+for (i = 0; i < psCount; i++)
+ {
+ GNUNET_EncName enc;
- match = GNUNET_NO;
- for (j = 0; j < prCount; j++)
- if (0 == memcmp (&peersResponding[j].hashPubKey,
- &peersSeen[i].hashPubKey, sizeof (GNUNET_HashCode)))
- {
- match = GNUNET_YES;
- break;
- }
- if (match == GNUNET_NO)
+ match = GNUNET_NO;
+ for (j = 0; j < prCount; j++)
+ if (0 == memcmp (&peersResponding[j].hashPubKey,
+ &peersSeen[i].hashPubKey, sizeof (GNUNET_HashCode)))
{
- GNUNET_hash_to_enc (&peersSeen[i].hashPubKey, &enc);
- switch (format)
- {
- case 1:
- break;
- case 2:
- printf
- ("\tnode: { title: \"%s\" label: \"%.*s\" shape: \"ellipse\"
}\n",
- (char *) &enc, 4, (char *) &enc);
- break;
- default:
- break;
- }
- }
- else
- {
- switch (format)
- {
- case 2:
- break;
- default:
- break;
- }
- }
- }
- if (psCount == 0)
- {
- switch (format)
- {
- case 2:
- printf ("\tnode: { title: \"NO CONNECTIONS\" }\n");
+ match = GNUNET_YES;
break;
- default:
- break;
}
- }
+ if (match == GNUNET_NO)
+ {
+ GNUNET_hash_to_enc (&peersSeen[i].hashPubKey, &enc);
+ switch (format)
+ {
+ case 1:
+ break;
+ case 2:
+ printf
+ ("\tnode: { title: \"%s\" label: \"%.*s\" shape: \"ellipse\"
}\n",
+ (char *) &enc, 4, (char *) &enc);
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ switch (format)
+ {
+ case 2:
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+if (psCount == 0)
+ {
+ switch (format)
+ {
+ case 2:
+ printf ("\tnode: { title: \"NO CONNECTIONS\" }\n");
+ break;
+ default:
+ break;
+ }
+ }
#endif
@@ -360,17 +353,17 @@
gettext_noop
("specify output format; 0 for human readable output, 1 for dot, 2 for
vcg"),
1,
- &GNUNET_getopt_configure_set_uint, &format} ,
+ &GNUNET_getopt_configure_set_uint, &format},
GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Start GNUnet transport
benchmarking tool.")), /* -h */
GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
{'P', "priority", "PRIORITY",
gettext_noop ("use PRIORITY for the priority of the trace request"), 1,
- &GNUNET_getopt_configure_set_uint, &priority, },
+ &GNUNET_getopt_configure_set_uint, &priority,},
GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
{'W', "wait", "DELAY",
gettext_noop ("wait DELAY seconds for replies"), 1,
- &GNUNET_getopt_configure_set_uint, &delay },
+ &GNUNET_getopt_configure_set_uint, &delay},
GNUNET_COMMAND_LINE_OPTION_END,
};
@@ -389,22 +382,22 @@
main (int argc, char *const *argv)
{
struct GNUNET_ClientServerConnection *sock;
- struct GNUNET_ThreadHandle * myThread;
+ struct GNUNET_ThreadHandle *myThread;
struct GNUNET_CronManager *cron;
- void * unused;
+ void *unused;
- if (-1 == GNUNET_init (argc,
- argv,
- "gnunet-tracekit",
- &cfgFilename, gnunettracekitOptions, &ectx, &cfg))
+ if (-1 == GNUNET_init (argc,
+ argv,
+ "gnunet-tracekit",
+ &cfgFilename, gnunettracekitOptions, &ectx, &cfg))
{
GNUNET_fini (ectx, cfg);
return -1;
}
- if (format > 2)
+ if (format > 2)
{
printf (_("Format specification invalid. "
- "Use 0 for user-readable, 1 for dot, 2 for vcg.\n"));
+ "Use 0 for user-readable, 1 for dot, 2 for vcg.\n"));
return -1;
}
@@ -415,8 +408,7 @@
GNUNET_fini (ectx, cfg);
return 1;
}
- myThread =
- GNUNET_thread_create (&process, sock, 128 * 1024);
+ myThread = GNUNET_thread_create (&process, sock, 128 * 1024);
if (myThread == NULL)
GNUNET_GE_DIE_STRERROR (ectx,
GNUNET_GE_FATAL | GNUNET_GE_IMMEDIATE |
@@ -431,7 +423,7 @@
GNUNET_client_connection_destroy (sock);
GNUNET_cron_stop (cron);
GNUNET_cron_destroy (cron);
- GNUNET_array_grow(seen, count, 0);
+ GNUNET_array_grow (seen, count, 0);
GNUNET_fini (ectx, cfg);
return 0;
}
Modified: GNUnet/src/include/ecrs_core.h
===================================================================
--- GNUnet/src/include/ecrs_core.h 2007-12-12 06:59:46 UTC (rev 5872)
+++ GNUnet/src/include/ecrs_core.h 2007-12-12 06:59:59 UTC (rev 5873)
@@ -240,16 +240,17 @@
* match the query
*/
int GNUNET_EC_file_block_encode (const DBlock * data,
- unsigned int len,
- const GNUNET_HashCode * query,
- GNUNET_DatastoreValue ** value);
+ unsigned int len,
+ const GNUNET_HashCode * query,
+ GNUNET_DatastoreValue ** value);
/**
* Get the query that will be used to query for
* a certain block of data.
*/
void GNUNET_EC_file_block_get_query (const DBlock * data,
- unsigned int len, GNUNET_HashCode * query);
+ unsigned int len,
+ GNUNET_HashCode * query);
/**
@@ -257,12 +258,13 @@
* a certain block of data.
*/
void GNUNET_EC_file_block_get_key (const DBlock * data,
- unsigned int len, GNUNET_HashCode * key);
+ unsigned int len, GNUNET_HashCode * key);
/**
* What is the type of the given block of data?
*/
-unsigned int GNUNET_EC_file_block_get_type (unsigned int size, const DBlock *
data);
+unsigned int GNUNET_EC_file_block_get_type (unsigned int size,
+ const DBlock * data);
/**
* What is the main query (the one that is used in
@@ -278,7 +280,8 @@
* the content type is not known
*/
int GNUNET_EC_file_block_check_and_get_query (unsigned int size,
- const DBlock * data, int verify, GNUNET_HashCode * query);
+ const DBlock * data, int verify,
+ GNUNET_HashCode * query);
/**
* Verify that the given Datum is a valid response
@@ -295,9 +298,11 @@
* query type
*/
int GNUNET_EC_is_block_applicable_for_query (unsigned int type,
- unsigned int size,
- const DBlock * data,
- const GNUNET_HashCode * knownDatumQuery,
- unsigned int keyCount, const GNUNET_HashCode * keys);
+ unsigned int size,
+ const DBlock * data,
+ const GNUNET_HashCode *
+ knownDatumQuery,
+ unsigned int keyCount,
+ const GNUNET_HashCode * keys);
#endif
Modified: GNUnet/src/include/gnunet_tracekit_lib.h
===================================================================
--- GNUnet/src/include/gnunet_tracekit_lib.h 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/include/gnunet_tracekit_lib.h 2007-12-12 06:59:59 UTC (rev
5873)
@@ -48,9 +48,11 @@
* @return GNUNET_OK to continue data gathering,
* GNUNET_SYSERR to abort
*/
-typedef int (*GNUNET_TRACEKIT_ReportCallback)(void * cls,
- const GNUNET_PeerIdentity *
reporter,
- const GNUNET_PeerIdentity * link);
+typedef int (*GNUNET_TRACEKIT_ReportCallback) (void *cls,
+ const GNUNET_PeerIdentity *
+ reporter,
+ const GNUNET_PeerIdentity *
+ link);
/**
* Ask gnunetd to perform a network topology trace
@@ -64,10 +66,9 @@
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
int GNUNET_TRACEKIT_run (struct GNUNET_ClientServerConnection *sock,
- unsigned int depth,
- unsigned int priority,
- GNUNET_TRACEKIT_ReportCallback report,
- void * cls);
+ unsigned int depth,
+ unsigned int priority,
+ GNUNET_TRACEKIT_ReportCallback report, void *cls);
#if 0 /* keep Emacsens' auto-indent happy */
{
Modified: GNUnet/src/include/gnunet_util_cron.h
===================================================================
--- GNUnet/src/include/gnunet_util_cron.h 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/include/gnunet_util_cron.h 2007-12-12 06:59:59 UTC (rev
5873)
@@ -47,7 +47,8 @@
struct GNUNET_CronManager;
-struct GNUNET_CronManager * GNUNET_cron_create (struct GNUNET_GE_Context
*ectx);
+struct GNUNET_CronManager *GNUNET_cron_create (struct GNUNET_GE_Context
+ *ectx);
void GNUNET_cron_destroy (struct GNUNET_CronManager *mgr);
Modified: GNUnet/src/include/gnunet_util_network.h
===================================================================
--- GNUnet/src/include/gnunet_util_network.h 2007-12-12 06:59:46 UTC (rev
5872)
+++ GNUnet/src/include/gnunet_util_network.h 2007-12-12 06:59:59 UTC (rev
5873)
@@ -330,9 +330,10 @@
* The OS socket should henceforth be no longer used
* directly. GNUNET_socket_destroy will close it.
*/
-struct GNUNET_SocketHandle *GNUNET_socket_create (struct GNUNET_GE_Context
*ectx,
- struct GNUNET_LoadMonitor *mon,
- int osSocket);
+struct GNUNET_SocketHandle *GNUNET_socket_create (struct GNUNET_GE_Context
+ *ectx,
+ struct GNUNET_LoadMonitor
+ *mon, int osSocket);
/**
* Close the socket (does NOT destroy it)
Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2007-12-12 06:59:46 UTC (rev 5872)
+++ GNUnet/src/server/handler.c 2007-12-12 06:59:59 UTC (rev 5873)
@@ -651,7 +651,7 @@
void
core_receive (GNUNET_TransportPacket * mp)
{
- if (threads_running != GNUNET_YES)
+ if (threads_running != GNUNET_YES)
{
GNUNET_free (mp->msg);
GNUNET_free (mp);
Modified: GNUnet/src/transports/udp.c
===================================================================
--- GNUnet/src/transports/udp.c 2007-12-12 06:59:46 UTC (rev 5872)
+++ GNUnet/src/transports/udp.c 2007-12-12 06:59:59 UTC (rev 5873)
@@ -533,8 +533,7 @@
sizeof
(GNUNET_MessageHeader) +
32, 65500,
- MESSAGE_SIZE,
- &mtu))
+ MESSAGE_SIZE, &mtu))
{
return NULL;
}
Modified: GNUnet/src/transports/udp6.c
===================================================================
--- GNUnet/src/transports/udp6.c 2007-12-12 06:59:46 UTC (rev 5872)
+++ GNUnet/src/transports/udp6.c 2007-12-12 06:59:59 UTC (rev 5873)
@@ -484,8 +484,7 @@
sizeof
(GNUNET_MessageHeader) +
32, 65500,
- MESSAGE_SIZE,
- &mtu))
+ MESSAGE_SIZE, &mtu))
{
return NULL;
}
Modified: GNUnet/src/util/network/io.c
===================================================================
--- GNUnet/src/util/network/io.c 2007-12-12 06:59:46 UTC (rev 5872)
+++ GNUnet/src/util/network/io.c 2007-12-12 06:59:59 UTC (rev 5873)
@@ -104,8 +104,8 @@
struct GNUNET_SocketHandle *
-GNUNET_socket_create (struct GNUNET_GE_Context *ectx, struct
GNUNET_LoadMonitor *mon,
- int osSocket)
+GNUNET_socket_create (struct GNUNET_GE_Context *ectx,
+ struct GNUNET_LoadMonitor *mon, int osSocket)
{
SocketHandle *ret;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5873 - in GNUnet/src: applications/fragmentation applications/fs applications/fs/ecrs applications/fs/lib applications/fs/module applications/identity applications/session applications/stats applications/testbed applications/testing applications/topology_default applications/tracekit include server transports util/network,
gnunet <=