diff options
author | Julius Bünger <buenger@mytum.de> | 2015-01-07 14:06:10 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2015-01-07 14:06:10 +0000 |
commit | 53a4829c9f97de9a06a7ad56a76d6600d4069393 (patch) | |
tree | 6cf51f90cd3217699005ae322db1d85e27ed70b3 /src/rps | |
parent | f7779acffd50d74b0fd309dd962f96c012034339 (diff) | |
download | gnunet-53a4829c9f97de9a06a7ad56a76d6600d4069393.tar.gz gnunet-53a4829c9f97de9a06a7ad56a76d6600d4069393.zip |
changed logging + cosmetic changes
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 9f4c767e4..5efc062bb 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -518,14 +518,13 @@ handle_peer_push (void *cls, | |||
518 | void **channel_ctx, | 518 | void **channel_ctx, |
519 | const struct GNUNET_MessageHeader *msg) | 519 | const struct GNUNET_MessageHeader *msg) |
520 | { | 520 | { |
521 | LOG (GNUNET_ERROR_TYPE_DEBUG, "PUSH received\n"); | ||
522 | |||
523 | const struct GNUNET_PeerIdentity *peer; | 521 | const struct GNUNET_PeerIdentity *peer; |
524 | 522 | ||
525 | // TODO check the proof of work | 523 | // (check the proof of work) |
526 | 524 | ||
527 | peer = (const struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER); | 525 | peer = (const struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER); |
528 | // FIXME wait for cadet to change this function | 526 | // FIXME wait for cadet to change this function |
527 | LOG (GNUNET_ERROR_TYPE_DEBUG, "PUSH received (%s)\n", GNUNET_i2s (peer)); | ||
529 | 528 | ||
530 | /* Add the sending peer to the push_list */ | 529 | /* Add the sending peer to the push_list */ |
531 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding peer to push_list of size %u\n", push_list_size); | 530 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding peer to push_list of size %u\n", push_list_size); |
@@ -562,24 +561,24 @@ handle_peer_pull_request (void *cls, | |||
562 | // allow only one request per time interval ? | 561 | // allow only one request per time interval ? |
563 | // otherwise remove from peerlist? | 562 | // otherwise remove from peerlist? |
564 | 563 | ||
565 | peer = (struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info(channel, GNUNET_CADET_OPTION_PEER); | 564 | peer = (struct GNUNET_PeerIdentity *) GNUNET_CADET_channel_get_info (channel, GNUNET_CADET_OPTION_PEER); |
566 | // FIXME wait for cadet to change this function | 565 | // FIXME wait for cadet to change this function |
567 | LOG(GNUNET_ERROR_TYPE_DEBUG, "PULL REQUEST from peer %s received\n", GNUNET_i2s(peer)); | 566 | LOG (GNUNET_ERROR_TYPE_DEBUG, "PULL REQUEST from peer %s received\n", GNUNET_i2s (peer)); |
568 | 567 | ||
569 | //mq = GNUNET_CADET_mq_create(channel); // without mq? | 568 | //mq = GNUNET_CADET_mq_create(channel); // without mq? |
570 | mq = get_mq(peer_map, peer); | 569 | mq = get_mq (peer_map, peer); |
571 | 570 | ||
572 | //in_msg = (struct GNUNET_RPS_P2P_PullRequestMessage *) msg; | 571 | //in_msg = (struct GNUNET_RPS_P2P_PullRequestMessage *) msg; |
573 | // TODO how many peers do we actually send? | 572 | // TODO how many peers do we actually send? |
574 | // GNUNET_ntohll(in_msg->num_peers) | 573 | // GNUNET_ntohll(in_msg->num_peers) |
575 | ev = GNUNET_MQ_msg_extra(out_msg, | 574 | ev = GNUNET_MQ_msg_extra (out_msg, |
576 | gossip_list_size * sizeof(struct GNUNET_PeerIdentity), | 575 | gossip_list_size * sizeof (struct GNUNET_PeerIdentity), |
577 | GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY); | 576 | GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY); |
578 | out_msg->num_peers = GNUNET_htonll(gossip_list_size); | 577 | out_msg->num_peers = GNUNET_htonll (gossip_list_size); |
579 | memcpy(&out_msg[1], gossip_list, | 578 | memcpy (&out_msg[1], gossip_list, |
580 | gossip_list_size * sizeof(struct GNUNET_PeerIdentity)); | 579 | gossip_list_size * sizeof (struct GNUNET_PeerIdentity)); |
581 | 580 | ||
582 | GNUNET_MQ_send(mq, ev); | 581 | GNUNET_MQ_send (mq, ev); |
583 | 582 | ||
584 | return GNUNET_OK; | 583 | return GNUNET_OK; |
585 | } | 584 | } |
@@ -601,7 +600,7 @@ handle_peer_pull_reply (void *cls, | |||
601 | void **channel_ctx, | 600 | void **channel_ctx, |
602 | const struct GNUNET_MessageHeader *msg) | 601 | const struct GNUNET_MessageHeader *msg) |
603 | { | 602 | { |
604 | LOG(GNUNET_ERROR_TYPE_DEBUG, "PULL REPLY received\n"); | 603 | LOG (GNUNET_ERROR_TYPE_DEBUG, "PULL REPLY received\n"); |
605 | 604 | ||
606 | struct GNUNET_RPS_P2P_PullReplyMessage *in_msg; | 605 | struct GNUNET_RPS_P2P_PullReplyMessage *in_msg; |
607 | struct GNUNET_PeerIdentity *peers; | 606 | struct GNUNET_PeerIdentity *peers; |
@@ -620,9 +619,9 @@ handle_peer_pull_reply (void *cls, | |||
620 | return GNUNET_SYSERR; | 619 | return GNUNET_SYSERR; |
621 | } | 620 | } |
622 | peers = (struct GNUNET_PeerIdentity *) &msg[1]; | 621 | peers = (struct GNUNET_PeerIdentity *) &msg[1]; |
623 | for ( i = 0 ; i < GNUNET_ntohll(in_msg->num_peers) ; i++ ) | 622 | for ( i = 0 ; i < GNUNET_ntohll (in_msg->num_peers) ; i++ ) |
624 | { | 623 | { |
625 | GNUNET_array_append(pull_list, pull_list_size, peers[i]); | 624 | GNUNET_array_append (pull_list, pull_list_size, peers[i]); |
626 | } | 625 | } |
627 | 626 | ||
628 | return GNUNET_OK; | 627 | return GNUNET_OK; |