[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35352 - in gnunet/src: datastore fs revocation set
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35352 - in gnunet/src: datastore fs revocation set |
Date: |
Sat, 7 Mar 2015 20:10:51 +0100 |
Author: grothoff
Date: 2015-03-07 20:10:51 +0100 (Sat, 07 Mar 2015)
New Revision: 35352
Modified:
gnunet/src/datastore/datastore_api.c
gnunet/src/fs/gnunet-service-fs_lc.c
gnunet/src/fs/gnunet-service-fs_pr.c
gnunet/src/revocation/gnunet-service-revocation.c
gnunet/src/set/gnunet-service-set_union.c
gnunet/src/set/set_api.c
Log:
-indentation and comment fixes
Modified: gnunet/src/datastore/datastore_api.c
===================================================================
--- gnunet/src/datastore/datastore_api.c 2015-03-07 18:52:04 UTC (rev
35351)
+++ gnunet/src/datastore/datastore_api.c 2015-03-07 19:10:51 UTC (rev
35352)
@@ -1409,13 +1409,15 @@
* cancel
*/
struct GNUNET_DATASTORE_QueueEntry *
-GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset,
+GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
+ uint64_t offset,
const struct GNUNET_HashCode * key,
enum GNUNET_BLOCK_Type type,
unsigned int queue_priority,
unsigned int max_queue_size,
struct GNUNET_TIME_Relative timeout,
- GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls)
+ GNUNET_DATASTORE_DatumProcessor proc,
+ void *proc_cls)
{
struct GNUNET_DATASTORE_QueueEntry *qe;
struct GetMessage *gm;
@@ -1427,8 +1429,13 @@
(unsigned int) type, GNUNET_h2s (key));
qc.rc.proc = proc;
qc.rc.proc_cls = proc_cls;
- qe = make_queue_entry (h, sizeof (struct GetMessage), queue_priority,
- max_queue_size, timeout, &process_result_message,
&qc);
+ qe = make_queue_entry (h,
+ sizeof (struct GetMessage),
+ queue_priority,
+ max_queue_size,
+ timeout,
+ &process_result_message,
+ &qc);
if (qe == NULL)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not queue request for `%s'\n",
@@ -1436,8 +1443,10 @@
return NULL;
}
#if INSANE_STATISTICS
- GNUNET_STATISTICS_update (h->stats, gettext_noop ("# GET requests executed"),
- 1, GNUNET_NO);
+ GNUNET_STATISTICS_update (h->stats,
+ gettext_noop ("# GET requests executed"),
+ 1,
+ GNUNET_NO);
#endif
gm = (struct GetMessage *) &qe[1];
gm->header.type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_GET);
Modified: gnunet/src/fs/gnunet-service-fs_lc.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_lc.c 2015-03-07 18:52:04 UTC (rev
35351)
+++ gnunet/src/fs/gnunet-service-fs_lc.c 2015-03-07 19:10:51 UTC (rev
35352)
@@ -327,7 +327,8 @@
return GNUNET_SYSERR;
}
GNUNET_STATISTICS_update (GSF_stats,
- gettext_noop ("# client searches received"), 1,
+ gettext_noop ("# client searches received"),
+ 1,
GNUNET_NO);
sc = (msize - sizeof (struct SearchMessage)) / sizeof (struct
GNUNET_HashCode);
sm = (const struct SearchMessage *) message;
@@ -349,7 +350,9 @@
(SEARCH_MESSAGE_OPTION_CONTINUED was always set) and that have a
matching query and type */
if ((GNUNET_YES != prd->has_started) &&
- (0 != memcmp (&prd->query, &sm->query, sizeof (struct
GNUNET_HashCode))) &&
+ (0 != memcmp (&prd->query,
+ &sm->query,
+ sizeof (struct GNUNET_HashCode))) &&
(prd->type == type))
break;
cr = cr->next;
@@ -359,7 +362,9 @@
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Have existing request, merging content-seen lists.\n");
- GSF_pending_request_update_ (cr->pr, (const struct GNUNET_HashCode *)
&sm[1], sc);
+ GSF_pending_request_update_ (cr->pr,
+ (const struct GNUNET_HashCode *) &sm[1],
+ sc);
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop
("# client searches updated (merged content seen
list)"),
@@ -372,7 +377,9 @@
GNUNET_NO);
cr = GNUNET_new (struct ClientRequest);
cr->lc = lc;
- GNUNET_CONTAINER_DLL_insert (lc->cr_head, lc->cr_tail, cr);
+ GNUNET_CONTAINER_DLL_insert (lc->cr_head,
+ lc->cr_tail,
+ cr);
options = GSF_PRO_LOCAL_REQUEST;
if (0 != (SEARCH_MESSAGE_OPTION_LOOPBACK_ONLY & ntohl (sm->options)))
options |= GSF_PRO_LOCAL_ONLY;
Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c 2015-03-07 18:52:04 UTC (rev
35351)
+++ gnunet/src/fs/gnunet-service-fs_pr.c 2015-03-07 19:10:51 UTC (rev
35352)
@@ -1275,11 +1275,13 @@
{
struct GSF_PendingRequest *pr = cls;
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
_("Datastore lookup already took %s!\n"),
- GNUNET_STRINGS_relative_time_to_string
(GNUNET_TIME_absolute_get_duration (pr->qe_start), GNUNET_YES));
+ GNUNET_STRINGS_relative_time_to_string
(GNUNET_TIME_absolute_get_duration (pr->qe_start),
+ GNUNET_YES));
pr->warn_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ &warn_delay_task,
pr);
}
@@ -1514,10 +1516,10 @@
((GNUNET_YES == GSF_test_get_load_too_high_ (0)) ||
(pr->public_data.results_found > 5 + 2 * pr->public_data.priority)))
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Load too high, done with request\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Load too high, done with request\n");
GNUNET_STATISTICS_update (GSF_stats,
- gettext_noop
- ("# Datastore lookups concluded (load too
high)"),
+ gettext_noop ("# Datastore lookups concluded
(load too high)"),
1,
GNUNET_NO);
goto check_error_and_continue;
@@ -1626,7 +1628,8 @@
pr->llc_cont_cls = cont_cls;
pr->qe_start = GNUNET_TIME_absolute_get ();
pr->warn_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ &warn_delay_task,
pr);
#if INSANE_STATISTICS
GNUNET_STATISTICS_update (GSF_stats,
Modified: gnunet/src/revocation/gnunet-service-revocation.c
===================================================================
--- gnunet/src/revocation/gnunet-service-revocation.c 2015-03-07 18:52:04 UTC
(rev 35351)
+++ gnunet/src/revocation/gnunet-service-revocation.c 2015-03-07 19:10:51 UTC
(rev 35352)
@@ -200,7 +200,8 @@
GNUNET_CRYPTO_hash (&qm->key,
sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey),
&hc);
- res = GNUNET_CONTAINER_multihashmap_contains (revocation_map, &hc);
+ res = GNUNET_CONTAINER_multihashmap_contains (revocation_map,
+ &hc);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
(GNUNET_NO == res)
? "Received revocation check for valid key `%s' from client\n"
@@ -215,7 +216,8 @@
client,
&qrm.header,
GNUNET_NO);
- GNUNET_SERVER_receive_done (client, GNUNET_OK);
+ GNUNET_SERVER_receive_done (client,
+ GNUNET_OK);
}
@@ -237,10 +239,14 @@
struct GNUNET_MQ_Envelope *e;
struct RevokeMessage *cp;
- e = GNUNET_MQ_msg (cp, GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE);
+ e = GNUNET_MQ_msg (cp,
+ GNUNET_MESSAGE_TYPE_REVOCATION_REVOKE);
*cp = *rm;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Flooding revocation to `%s'\n",
GNUNET_i2s (target));
- GNUNET_MQ_send (pe->mq, e);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Flooding revocation to `%s'\n",
+ GNUNET_i2s (target));
+ GNUNET_MQ_send (pe->mq,
+ e);
return GNUNET_OK;
}
@@ -309,7 +315,8 @@
if (GNUNET_OK !=
GNUNET_SET_add_element (revocation_set,
&e,
- NULL, NULL))
+ NULL,
+ NULL))
{
GNUNET_break (0);
return GNUNET_OK;
@@ -349,7 +356,8 @@
if (GNUNET_SYSERR == (ret = publicize_rm (rm)))
{
GNUNET_break_op (0);
- GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ GNUNET_SERVER_receive_done (client,
+ GNUNET_SYSERR);
return;
}
rrm.header.size = htons (sizeof (struct RevocationResponseMessage));
@@ -361,7 +369,8 @@
client,
&rrm.header,
GNUNET_NO);
- GNUNET_SERVER_receive_done (client, GNUNET_OK);
+ GNUNET_SERVER_receive_done (client,
+ GNUNET_OK);
}
@@ -387,7 +396,6 @@
}
-
/**
* Callback for set operation results. Called for each element in the
* result set. Each element contains a revocation, which we should
@@ -416,7 +424,7 @@
if (0 != element->element_type)
{
GNUNET_STATISTICS_update (stats,
- "# unsupported revocations received via set
union",
+ gettext_noop ("# unsupported revocations
received via set union"),
1, GNUNET_NO);
return;
}
@@ -425,7 +433,7 @@
&peer_entry->id,
&rm->header);
GNUNET_STATISTICS_update (stats,
- "# revocation messages received via set union",
+ gettext_noop ("# revocation messages received
via set union"),
1, GNUNET_NO);
break;
case GNUNET_SET_STATUS_FAILURE:
@@ -434,16 +442,18 @@
GNUNET_i2s (&peer_entry->id));
peer_entry->so = NULL;
GNUNET_STATISTICS_update (stats,
- "# revocation set unions failed",
- 1, GNUNET_NO);
+ gettext_noop ("# revocation set unions failed"),
+ 1,
+ GNUNET_NO);
break;
case GNUNET_SET_STATUS_HALF_DONE:
break;
case GNUNET_SET_STATUS_DONE:
peer_entry->so = NULL;
GNUNET_STATISTICS_update (stats,
- "# revocation set unions completed",
- 1, GNUNET_NO);
+ gettext_noop ("# revocation set unions
completed"),
+ 1,
+ GNUNET_NO);
break;
default:
GNUNET_break (0);
@@ -502,7 +512,9 @@
struct GNUNET_HashCode my_hash;
struct GNUNET_HashCode peer_hash;
- if (0 == memcmp(peer, &my_identity, sizeof (my_identity)))
+ if (0 == memcmp(peer,
+ &my_identity,
+ sizeof (my_identity)))
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -510,22 +522,21 @@
GNUNET_i2s (peer));
peer_entry = GNUNET_CONTAINER_multipeermap_get (peers,
peer);
- if (NULL == peer_entry)
- {
- peer_entry = GNUNET_new (struct PeerEntry);
- peer_entry->id = *peer;
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multipeermap_put (peers, peer,
- peer_entry,
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
- }
- else
- {
- GNUNET_assert (NULL == peer_entry->mq);
- }
+ GNUNET_assert (NULL == peer_entry);
+ peer_entry = GNUNET_new (struct PeerEntry);
+ peer_entry->id = *peer;
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONTAINER_multipeermap_put (peers,
+ &peer_entry->id,
+ peer_entry,
+
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
peer_entry->mq = GNUNET_CORE_mq_create (core_api, peer);
- GNUNET_CRYPTO_hash (&my_identity, sizeof (my_identity), &my_hash);
- GNUNET_CRYPTO_hash (peer, sizeof (*peer), &peer_hash);
+ GNUNET_CRYPTO_hash (&my_identity,
+ sizeof (my_identity),
+ &my_hash);
+ GNUNET_CRYPTO_hash (peer,
+ sizeof (*peer),
+ &peer_hash);
if (0 < GNUNET_CRYPTO_hash_cmp (&my_hash,
&peer_hash))
{
@@ -537,7 +548,10 @@
&transmit_task_cb,
peer_entry);
}
- GNUNET_STATISTICS_update (stats, "# peers connected", 1, GNUNET_NO);
+ GNUNET_STATISTICS_update (stats,
+ "# peers connected",
+ 1,
+ GNUNET_NO);
}
@@ -554,23 +568,23 @@
{
struct PeerEntry *pos;
- if (0 == memcmp(peer, &my_identity, sizeof (my_identity)))
- return;
+ if (0 == memcmp (peer,
+ &my_identity,
+ sizeof (my_identity)))
+ return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peer `%s' disconnected from us\n",
GNUNET_i2s (peer));
- pos = GNUNET_CONTAINER_multipeermap_get (peers, peer);
- if (NULL == pos)
- {
- GNUNET_break (0);
- return;
- }
+ pos = GNUNET_CONTAINER_multipeermap_get (peers,
+ peer);
+ GNUNET_assert (NULL != pos);
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multipeermap_remove (peers, peer,
+ GNUNET_CONTAINER_multipeermap_remove (peers,
+ peer,
pos));
GNUNET_MQ_destroy (pos->mq);
- if (pos->transmit_task != NULL)
+ if (NULL != pos->transmit_task)
{
GNUNET_SCHEDULER_cancel (pos->transmit_task);
pos->transmit_task = NULL;
@@ -581,7 +595,10 @@
pos->so = NULL;
}
GNUNET_free (pos);
- GNUNET_STATISTICS_update (stats, "# peers connected", -1, GNUNET_NO);
+ GNUNET_STATISTICS_update (stats,
+ "# peers connected",
+ -1,
+ GNUNET_NO);
}
@@ -855,9 +872,11 @@
}
GNUNET_free (fn);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
NULL);
- peers = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_NO);
+ peers = GNUNET_CONTAINER_multipeermap_create (128,
+ GNUNET_YES);
GNUNET_SERVER_add_handlers (srv, handlers);
/* Connect to core service and register core handlers */
core_api = GNUNET_CORE_connect (cfg, /* Main configuration */
Modified: gnunet/src/set/gnunet-service-set_union.c
===================================================================
--- gnunet/src/set/gnunet-service-set_union.c 2015-03-07 18:52:04 UTC (rev
35351)
+++ gnunet/src/set/gnunet-service-set_union.c 2015-03-07 19:10:51 UTC (rev
35352)
@@ -234,8 +234,7 @@
* @param cls closure
* @param key current key code
* @param value value in the hash map
- * @return #GNUNET_YES if we should continue to
- * iterate,
+ * @return #GNUNET_YES if we should continue to iterate,
* #GNUNET_NO if not.
*/
static int
@@ -546,6 +545,7 @@
if (NULL == op->state->key_to_element)
{
unsigned int len;
+
len = GNUNET_CONTAINER_multihashmap_size (op->spec->set->elements);
op->state->key_to_element = GNUNET_CONTAINER_multihashmap32_create (len +
1);
GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements,
@@ -592,8 +592,9 @@
if (buckets_in_message > MAX_BUCKETS_PER_MESSAGE)
buckets_in_message = MAX_BUCKETS_PER_MESSAGE;
- ev = GNUNET_MQ_msg_extra (msg, buckets_in_message * IBF_BUCKET_SIZE,
- GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF);
+ ev = GNUNET_MQ_msg_extra (msg,
+ buckets_in_message * IBF_BUCKET_SIZE,
+ GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF);
msg->reserved = 0;
msg->order = ibf_order;
msg->offset = htons (buckets_sent);
@@ -627,7 +628,8 @@
SE_STRATA_COUNT * IBF_BUCKET_SIZE *
SE_IBF_SIZE,
GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE);
strata_estimator_write (op->state->se, &strata_msg[1]);
- GNUNET_MQ_send (op->mq, ev);
+ GNUNET_MQ_send (op->mq,
+ ev);
op->state->phase = PHASE_EXPECT_IBF;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"sent SE, expecting IBF\n");
@@ -1065,13 +1067,15 @@
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_SET_ResultMessage *rm;
struct GNUNET_SET_Element *element;
+
element = &ke->element->element;
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"sending element (size %u) to client (full set)\n",
element->size);
GNUNET_assert (0 != op->spec->client_request_id);
- ev = GNUNET_MQ_msg_extra (rm, element->size,
GNUNET_MESSAGE_TYPE_SET_RESULT);
+ ev = GNUNET_MQ_msg_extra (rm,
+ element->size,
+ GNUNET_MESSAGE_TYPE_SET_RESULT);
if (NULL == ev)
{
GNUNET_MQ_discard (ev);
@@ -1280,7 +1284,8 @@
}
msg->operation = htonl (GNUNET_SET_OPERATION_UNION);
msg->app_id = op->spec->app_id;
- GNUNET_MQ_send (op->mq, ev);
+ GNUNET_MQ_send (op->mq,
+ ev);
if (NULL != opaque_context)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1429,14 +1434,17 @@
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_SET_ResultMessage *msg;
- ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_RESULT);
+ ev = GNUNET_MQ_msg (msg,
+ GNUNET_MESSAGE_TYPE_SET_RESULT);
msg->request_id = htonl (op->spec->client_request_id);
msg->result_status = htons (GNUNET_SET_STATUS_FAILURE);
msg->element_type = htons (0);
- GNUNET_MQ_send (op->spec->set->client_mq, ev);
+ GNUNET_MQ_send (op->spec->set->client_mq,
+ ev);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"other peer disconnected prematurely\n");
- _GSS_operation_destroy (op, GNUNET_YES);
+ _GSS_operation_destroy (op,
+ GNUNET_YES);
return;
}
// else: the session has already been concluded
Modified: gnunet/src/set/set_api.c
===================================================================
--- gnunet/src/set/set_api.c 2015-03-07 18:52:04 UTC (rev 35351)
+++ gnunet/src/set/set_api.c 2015-03-07 19:10:51 UTC (rev 35352)
@@ -324,7 +324,8 @@
{
/* status is not #GNUNET_SET_STATUS_OK => there's no attached element,
* and this is the last result message we get */
- GNUNET_MQ_assoc_remove (set->mq, ntohl (msg->request_id));
+ GNUNET_MQ_assoc_remove (set->mq,
+ ntohl (msg->request_id));
GNUNET_CONTAINER_DLL_remove (set->ops_head,
set->ops_tail,
oh);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35352 - in gnunet/src: datastore fs revocation set,
gnunet <=