[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34905 - gnunet/src/rps
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34905 - gnunet/src/rps |
Date: |
Fri, 16 Jan 2015 15:18:22 +0100 |
Author: ch3
Date: 2015-01-16 15:18:22 +0100 (Fri, 16 Jan 2015)
New Revision: 34905
Modified:
gnunet/src/rps/gnunet-service-rps.c
gnunet/src/rps/rps.h
Log:
send empty push/pull-request messages
Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-01-16 12:32:02 UTC (rev 34904)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-01-16 14:18:22 UTC (rev 34905)
@@ -688,10 +688,9 @@
// (check the proof of work)
- // TODO accept empty message
- if (ntohs(msg->size) != sizeof (struct GNUNET_RPS_P2P_PushMessage))
+ if (ntohs(msg->size) != sizeof (struct GNUNET_MessageHeader))
{
- GNUNET_break_op (0); // At the moment our own implementation seems to
break that.
+ GNUNET_break_op (0);
return GNUNET_SYSERR;
}
@@ -727,10 +726,8 @@
struct GNUNET_MQ_Envelope *ev;
struct GNUNET_RPS_P2P_PullReplyMessage *out_msg;
- // assert that msg->size is 0
- // TODO accept empty message
- if (ntohs(msg->size) != sizeof (struct GNUNET_RPS_P2P_PullRequestMessage))
+ if (ntohs(msg->size) != sizeof (struct GNUNET_MessageHeader))
{
GNUNET_break_op (0); // At the moment our own implementation seems to
break that.
return GNUNET_SYSERR;
@@ -823,14 +820,13 @@
uint64_t i;
//unsigned int *n_arr;
unsigned int n_peers; /* Number of peers we send pushes/pulls to */
- struct GNUNET_RPS_P2P_PushMessage *push_msg;
- struct GNUNET_RPS_P2P_PullRequestMessage *pull_msg; // FIXME Send empty
message
+ struct GNUNET_MessageHeader *push_msg;
+ struct GNUNET_MessageHeader *pull_msg;
struct GNUNET_MQ_Envelope *ev;
const struct GNUNET_PeerIdentity *peer;
struct GNUNET_MQ_Handle *mq;
- // TODO print lists, ...
- // TODO randomise and spread calls herein over time
+ // TODO log lists, ...
/* Would it make sense to have one shuffeled gossip list and then
@@ -853,7 +849,6 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending PUSH to peer %s of gossiped
list.\n", GNUNET_i2s (peer));
ev = GNUNET_MQ_msg (push_msg, GNUNET_MESSAGE_TYPE_RPS_PP_PUSH);
- push_msg = NULL;
// FIXME sometimes it returns a pointer to a freed mq
mq = get_mq (peer_map, peer);
GNUNET_MQ_send (mq, ev);
@@ -876,7 +871,7 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending PULL request to peer %s of
gossiped list.\n", GNUNET_i2s (peer));
ev = GNUNET_MQ_msg (pull_msg, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST);
- pull_msg = NULL;
+ //pull_msg = NULL;
mq = get_mq (peer_map, peer);
GNUNET_MQ_send (mq, ev);
}
Modified: gnunet/src/rps/rps.h
===================================================================
--- gnunet/src/rps/rps.h 2015-01-16 12:32:02 UTC (rev 34904)
+++ gnunet/src/rps/rps.h 2015-01-16 14:18:22 UTC (rev 34905)
@@ -53,41 +53,8 @@
uint64_t placeholder;
};
-/**
- * P2P Message to request PeerIDs from other peer.
- */
-struct GNUNET_RPS_P2P_PullRequestMessage
-{
- /**
- * Header including size and type in NBO
- */
- struct GNUNET_MessageHeader header;
- /* This probably stays empty as we just
- * infrom the peer of our existence */
- uint64_t placeholder;
-};
-/**
- * P2P Message to send PeerIDs to other peer.
- */
-struct GNUNET_RPS_P2P_PullReplyMessage
-{
- /**
- * Header including size and type in NBO
- */
- struct GNUNET_MessageHeader header;
-
- /**
- * Number of PeerIDs sent
- */
- uint32_t num_peers GNUNET_PACKED;
-
- /* Followed by num_peers * GNUNET_PeerIdentity */
-};
-
-
-
/***********************************************************************
* Client-Service Messages
***********************************************************************/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34905 - gnunet/src/rps,
gnunet <=