[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1181 - GNUnet/src/applications/advertising
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1181 - GNUnet/src/applications/advertising |
Date: |
Thu, 30 Jun 2005 15:28:01 -0700 (PDT) |
Author: grothoff
Date: 2005-06-30 15:27:59 -0700 (Thu, 30 Jun 2005)
New Revision: 1181
Modified:
GNUnet/src/applications/advertising/advertising.c
Log:
improve advertising
Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c 2005-06-30 22:14:15 UTC
(rev 1180)
+++ GNUnet/src/applications/advertising/advertising.c 2005-06-30 22:27:59 UTC
(rev 1181)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing
authors)
+ (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other
contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -485,7 +485,7 @@
typedef struct {
unsigned int delay;
- p2p_HEADER * msg;
+ HELO_Message * msg;
int prob;
} FCC;
@@ -493,10 +493,14 @@
FCC * fcc) {
if (randomi(fcc->prob) != 0)
return; /* only forward with a certain chance */
+ if (equalsHashCode512(&peer->hashPubKey,
+ &fcc->msg->senderIdentity))
+ return; /* do not bounce the HELO of a peer back
+ to the same peer! */
if (stats != NULL)
stats->change(stat_HELO_fwd, 1);
coreAPI->unicast(peer,
- fcc->msg,
+ &fcc->msg->header,
0, /* priority */
fcc->delay);
}
@@ -554,7 +558,7 @@
NULL);
if (count > 0) {
fcc.delay = (*probability) * HELO_BROADCAST_FREQUENCY; /* send before the
next round */
- fcc.msg = &helo->header;
+ fcc.msg = helo;
fcc.prob = count;
coreAPI->forAllConnectedNodes((PerNodeCallback) &forwardCallback,
&fcc);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1181 - GNUnet/src/applications/advertising,
grothoff <=