aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-01 09:01:19 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-01 09:01:19 +0000
commitc74a1de848b89cca562f23de03180b310ff992ac (patch)
tree9a1c0642b6c3d526de079f418ecacc3547a1dc80 /src/dht
parent716959c44727dd2c04871df383b9cca511286113 (diff)
downloadgnunet-c74a1de848b89cca562f23de03180b310ff992ac.tar.gz
gnunet-c74a1de848b89cca562f23de03180b310ff992ac.zip
use NBO for expiration time in xvine
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-wdht_neighbours.c16
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c20
2 files changed, 13 insertions, 23 deletions
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
index 2e9ae04ca..96bf46a1f 100644
--- a/src/dht/gnunet-service-wdht_neighbours.c
+++ b/src/dht/gnunet-service-wdht_neighbours.c
@@ -510,7 +510,7 @@ struct PeerGetResultMessage
510 struct GNUNET_MessageHeader header; 510 struct GNUNET_MessageHeader header;
511 511
512 /** 512 /**
513 * The type for the data. 513 * The type for the data in NBO.
514 */ 514 */
515 uint32_t type GNUNET_PACKED; 515 uint32_t type GNUNET_PACKED;
516 516
@@ -521,19 +521,9 @@ struct PeerGetResultMessage
521 uint32_t put_path_length GNUNET_PACKED; 521 uint32_t put_path_length GNUNET_PACKED;
522 522
523 /** 523 /**
524 * Length of the GET path that follows (if tracked).
525 */
526 uint32_t get_path_length GNUNET_PACKED;
527
528 /**
529 * Peer which queried for get and should get the result.
530 */
531 struct GNUNET_PeerIdentity querying_peer;
532
533 /**
534 * When does the content expire? 524 * When does the content expire?
535 */ 525 */
536 struct GNUNET_TIME_Absolute expiration_time; 526 struct GNUNET_TIME_AbsoluteNBO expiration_time;
537 527
538 /** 528 /**
539 * The key of the corresponding GET request. 529 * The key of the corresponding GET request.
@@ -542,8 +532,6 @@ struct PeerGetResultMessage
542 532
543 /* put path (if tracked) */ 533 /* put path (if tracked) */
544 534
545 /* get path (if tracked) */
546
547 /* Payload */ 535 /* Payload */
548 536
549}; 537};
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 8339f9ce1..2cf9217a9 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -285,7 +285,7 @@ struct PeerGetResultMessage
285 /** 285 /**
286 * When does the content expire? 286 * When does the content expire?
287 */ 287 */
288 struct GNUNET_TIME_Absolute expiration_time; 288 struct GNUNET_TIME_AbsoluteNBO expiration_time;
289 289
290 /** 290 /**
291 * The key of the corresponding GET request. 291 * The key of the corresponding GET request.
@@ -2182,11 +2182,11 @@ find_local_best_known_next_hop (uint64_t destination_finger_value,
2182void 2182void
2183GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key, 2183GDS_NEIGHBOURS_send_put (const struct GNUNET_HashCode *key,
2184 enum GNUNET_BLOCK_Type block_type, 2184 enum GNUNET_BLOCK_Type block_type,
2185 enum GNUNET_DHT_RouteOption options, 2185 enum GNUNET_DHT_RouteOption options,
2186 uint32_t desired_replication_level, 2186 uint32_t desired_replication_level,
2187 struct GNUNET_PeerIdentity best_known_dest, 2187 struct GNUNET_PeerIdentity best_known_dest,
2188 struct GNUNET_HashCode intermediate_trail_id, 2188 struct GNUNET_HashCode intermediate_trail_id,
2189 struct GNUNET_PeerIdentity *target_peer, 2189 struct GNUNET_PeerIdentity *target_peer,
2190 uint32_t hop_count, 2190 uint32_t hop_count,
2191 uint32_t put_path_length, 2191 uint32_t put_path_length,
2192 struct GNUNET_PeerIdentity *put_path, 2192 struct GNUNET_PeerIdentity *put_path,
@@ -2558,7 +2558,7 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key,
2558 get_result->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT); 2558 get_result->header.type = htons (GNUNET_MESSAGE_TYPE_XDHT_P2P_GET_RESULT);
2559 get_result->key = *key; 2559 get_result->key = *key;
2560 get_result->querying_peer = *source_peer; 2560 get_result->querying_peer = *source_peer;
2561 get_result->expiration_time = expiration; 2561 get_result->expiration_time = GNUNET_TIME_absolute_hton (expiration);
2562 get_result->get_path_length = htonl (get_path_length); 2562 get_result->get_path_length = htonl (get_path_length);
2563 get_result->put_path_length = htonl (put_path_length); 2563 get_result->put_path_length = htonl (put_path_length);
2564 paths = (struct GNUNET_PeerIdentity *)&get_result[1]; 2564 paths = (struct GNUNET_PeerIdentity *)&get_result[1];
@@ -4098,7 +4098,8 @@ handle_dht_p2p_get_result (void *cls, const struct GNUNET_PeerIdentity *peer,
4098 4098
4099 if (0 == (GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &(get_path[0])))) 4099 if (0 == (GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &(get_path[0]))))
4100 { 4100 {
4101 GDS_CLIENTS_handle_reply (get_result->expiration_time, &(get_result->key), 4101 GDS_CLIENTS_handle_reply (GNUNET_TIME_absolute_ntoh (get_result->expiration_time),
4102 &(get_result->key),
4102 getlen, get_path, putlen, 4103 getlen, get_path, putlen,
4103 put_path, get_result->type, payload_size, payload); 4104 put_path, get_result->type, payload_size, payload);
4104 return GNUNET_YES; 4105 return GNUNET_YES;
@@ -4121,7 +4122,8 @@ handle_dht_p2p_get_result (void *cls, const struct GNUNET_PeerIdentity *peer,
4121 GDS_NEIGHBOURS_send_get_result (&(get_result->key), get_result->type, 4122 GDS_NEIGHBOURS_send_get_result (&(get_result->key), get_result->type,
4122 &get_path[current_path_index - 1], 4123 &get_path[current_path_index - 1],
4123 &(get_result->querying_peer), putlen, put_path, 4124 &(get_result->querying_peer), putlen, put_path,
4124 getlen, get_path, get_result->expiration_time, 4125 getlen, get_path,
4126 GNUNET_TIME_absolute_ntoh (get_result->expiration_time),
4125 payload, payload_size); 4127 payload, payload_size);
4126 return GNUNET_YES; 4128 return GNUNET_YES;
4127 } 4129 }