[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2647 - in GNUnet/src: applications/advertising application
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2647 - in GNUnet/src: applications/advertising applications/pingpong include |
Date: |
Sun, 23 Apr 2006 06:40:10 -0700 (PDT) |
Author: grothoff
Date: 2006-04-23 06:40:07 -0700 (Sun, 23 Apr 2006)
New Revision: 2647
Modified:
GNUnet/src/applications/advertising/advertising.c
GNUnet/src/applications/pingpong/pingpong.c
GNUnet/src/include/gnunet_pingpong_service.h
Log:
fixing mantis 1038
Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c 2006-04-23 13:14:55 UTC
(rev 2646)
+++ GNUnet/src/applications/advertising/advertising.c 2006-04-23 13:40:07 UTC
(rev 2647)
@@ -81,6 +81,9 @@
static int stat_hello_fwd;
+static int stat_plaintextPingSent;
+
+
/**
* Which types of cron-jobs are currently scheduled
* with cron?
@@ -107,7 +110,9 @@
return preference;
}
-static void callAddHost(P2P_hello_MESSAGE * helo) {
+static void callAddHost(void * cls) {
+ P2P_hello_MESSAGE * helo = cls;
+
identity->addHost(helo);
FREE(helo);
}
@@ -280,7 +285,7 @@
msg,
P2P_hello_MESSAGE_size(msg));
ping = pingpong->pingUser(&msg->senderIdentity,
- (CronJob)&callAddHost,
+ &callAddHost,
copy,
YES);
if (ping == NULL) {
@@ -321,6 +326,10 @@
buffer,
heloEnd)) )
res = SYSERR;
+ if (res == OK) {
+ if (stats != NULL)
+ stats->change(stat_plaintextPingSent, 1);
+ }
FREE(buffer);
if (SYSERR == transport->disconnect(tsession))
res = SYSERR;
@@ -720,6 +729,8 @@
stat_hello_in = stats->create(gettext_noop("# Peer advertisements
received"));
stat_hello_out = stats->create(gettext_noop("# Self advertisments
transmitted"));
stat_hello_fwd = stats->create(gettext_noop("# Foreign advertisements
forwarded"));
+ stat_plaintextPingSent
+ = stats->create(gettext_noop("# plaintext PING messages sent"));
}
LOG(LOG_DEBUG,
Modified: GNUnet/src/applications/pingpong/pingpong.c
===================================================================
--- GNUnet/src/applications/pingpong/pingpong.c 2006-04-23 13:14:55 UTC (rev
2646)
+++ GNUnet/src/applications/pingpong/pingpong.c 2006-04-23 13:40:07 UTC (rev
2647)
@@ -427,37 +427,6 @@
}
/**
- * Ping a host an call a method if a reply comes back.
- *
- * @param receiver the peer that should be PINGed
- * @param usePlaintext send the PING in plaintext (YES/NO)
- * @param method the method to call if a PONG comes back
- * @param data an argument to pass to the method.
- * @returns OK on success, SYSERR on error
- */
-static int pingPlaintext(const PeerIdentity * receiver,
- CronJob method,
- void * data,
- TSession * session) {
- P2P_pingpong_MESSAGE * pmsg;
-
- pmsg = (P2P_pingpong_MESSAGE*) createPing(receiver,
- method,
- data,
- YES);
- if (pmsg == NULL)
- return SYSERR;
- if (stats != NULL)
- stats->change(stat_plaintextPingSent, 1);
- coreAPI->sendPlaintext(session,
- (char*)pmsg,
- sizeof(P2P_pingpong_MESSAGE));
- FREE(pmsg);
- return OK;
-}
-
-
-/**
* Initialize the pingpong module.
*/
Pingpong_ServiceAPI *
@@ -515,7 +484,6 @@
&plaintextPongReceived);
ret.ping = &initiatePing;
ret.pingUser = &createPing;
- ret.pingPlaintext = &pingPlaintext;
return &ret;
}
Modified: GNUnet/src/include/gnunet_pingpong_service.h
===================================================================
--- GNUnet/src/include/gnunet_pingpong_service.h 2006-04-23 13:14:55 UTC
(rev 2646)
+++ GNUnet/src/include/gnunet_pingpong_service.h 2006-04-23 13:40:07 UTC
(rev 2647)
@@ -37,22 +37,6 @@
/**
* Ping a host an call a method if a reply comes back. Uses
- * a plaintext ping transmitted using the given session.
- *
- * @param receiver the peer that should be PINGed
- * @param method the method to call if a PONG comes back
- * @param data an argument to pass to the method, if not
- * NULL and the ping does not come back, ping will FREE data!
- * @param session the session to use to send the ping
- * @returns OK on success, SYSERR on error
- */
- int (*pingPlaintext)(const PeerIdentity * receiver,
- CronJob method,
- void * data,
- TSession * session);
-
- /**
- * Ping a host an call a method if a reply comes back. Uses
* an encrypted ping routed using the core.
*
* @param receiver the peer that should be PINGed
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2647 - in GNUnet/src: applications/advertising applications/pingpong include,
grothoff <=