[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4929 - GNUnet/src/applications/advertising
From: |
gnunet |
Subject: |
[GNUnet-SVN] r4929 - GNUnet/src/applications/advertising |
Date: |
Mon, 4 Jun 2007 22:35:39 -0600 (MDT) |
Author: grothoff
Date: 2007-06-04 22:35:38 -0600 (Mon, 04 Jun 2007)
New Revision: 4929
Modified:
GNUnet/src/applications/advertising/advertising.c
Log:
do never drop self-hellos due to load
Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c 2007-06-05 04:18:47 UTC
(rev 4928)
+++ GNUnet/src/applications/advertising/advertising.c 2007-06-05 04:35:38 UTC
(rev 4929)
@@ -144,7 +144,8 @@
* @return SYSERR on error, OK on success
*/
static int
-receivedhello(const MESSAGE_HEADER * message) {
+receivedhello(const PeerIdentity * sender,
+ const MESSAGE_HEADER * message) {
TSession * tsession;
P2P_hello_MESSAGE * copy;
PeerIdentity foreignId;
@@ -234,7 +235,8 @@
ntohs(msg->protocol),
NO);
if (NULL != copy) {
- if ( (ntohs(copy->senderAddressSize) ==
+ if ( (sender != NULL) &&
+ (ntohs(copy->senderAddressSize) ==
ntohs(msg->senderAddressSize)) &&
(0 == memcmp(&msg->MTU,
©->MTU,
@@ -711,7 +713,8 @@
static int
ehelloHandler(const PeerIdentity * sender,
const MESSAGE_HEADER * message) {
- if (OK == receivedhello(message)) {
+ if (OK == receivedhello(sender,
+ message)) {
/* if the hello was ok, update traffic preference
for the peer (depending on how much we like
to learn about other peers) */
@@ -728,7 +731,8 @@
phelloHandler(const PeerIdentity * sender,
const MESSAGE_HEADER * message,
TSession * session) {
- receivedhello(message);
+ receivedhello(sender,
+ message);
return OK;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4929 - GNUnet/src/applications/advertising,
gnunet <=