[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16641 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16641 - gnunet/src/mesh |
Date: |
Tue, 30 Aug 2011 15:03:41 +0200 |
Author: grothoff
Date: 2011-08-30 15:03:41 +0200 (Tue, 30 Aug 2011)
New Revision: 16641
Modified:
gnunet/src/mesh/mesh.h
gnunet/src/mesh/mesh_api_new.c
Log:
communicate operation timeouts
Modified: gnunet/src/mesh/mesh.h
===================================================================
--- gnunet/src/mesh/mesh.h 2011-08-30 13:00:56 UTC (rev 16640)
+++ gnunet/src/mesh/mesh.h 2011-08-30 13:03:41 UTC (rev 16641)
@@ -146,6 +146,13 @@
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
/**
+ * When should this request time out (the service abort trying to find
+ * a matching peer)? The request should naturally also be aborted
+ * if the corresponding client disconnects.
+ */
+ struct GNUNET_TIME_AbsoluteNBO timeout;
+
+ /**
* Peer to connect/disconnect.
*/
struct GNUNET_PeerIdentity peer;
@@ -168,6 +175,13 @@
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
/**
+ * When should this request time out (the service abort trying to find
+ * a matching peer)? The request should naturally also be aborted
+ * if the corresponding client disconnects.
+ */
+ struct GNUNET_TIME_AbsoluteNBO timeout;
+
+ /**
* Type specification
*/
GNUNET_MESH_ApplicationType type GNUNET_PACKED;
Modified: gnunet/src/mesh/mesh_api_new.c
===================================================================
--- gnunet/src/mesh/mesh_api_new.c 2011-08-30 13:00:56 UTC (rev 16640)
+++ gnunet/src/mesh/mesh_api_new.c 2011-08-30 13:03:41 UTC (rev 16641)
@@ -892,6 +892,7 @@
msg->header.size = htons (sizeof (struct GNUNET_MESH_PeerControl));
msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_ADD);
msg->tunnel_id = htonl (tunnel->tid);
+ msg->timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute
(timeout));
memcpy (&msg->peer, peer, sizeof (struct GNUNET_PeerIdentity));
send_packet (tunnel->mesh, &msg->header);
@@ -939,6 +940,7 @@
msg.header.size = htons (sizeof (struct GNUNET_MESH_PeerControl));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_DEL);
msg.tunnel_id = htonl (tunnel->tid);
+ msg.timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_UNIT_FOREVER_ABS);
memcpy (&msg.peer, peer, sizeof (struct GNUNET_PeerIdentity));
send_packet (tunnel->mesh, &msg.header);
}
@@ -963,9 +965,9 @@
msg.header.size = htons (sizeof (struct GNUNET_MESH_ConnectPeerByType));
msg.header.type = htons
(GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_BY_TYPE);
msg.tunnel_id = htonl (tunnel->tid);
+ msg.timeout = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute
(timeout));
msg.type = htonl (app_type);
send_packet (tunnel->mesh, &msg.header);
- // TODO: remember timeout
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16641 - gnunet/src/mesh,
gnunet <=