aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/gnunet/dht/DistributedHashTable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/gnunet/dht/DistributedHashTable.java')
-rw-r--r--src/main/java/org/gnunet/dht/DistributedHashTable.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/gnunet/dht/DistributedHashTable.java b/src/main/java/org/gnunet/dht/DistributedHashTable.java
index 27bac92..1ff0912 100644
--- a/src/main/java/org/gnunet/dht/DistributedHashTable.java
+++ b/src/main/java/org/gnunet/dht/DistributedHashTable.java
@@ -66,6 +66,7 @@ public class DistributedHashTable {
66 public int type; 66 public int type;
67 public Continuation cont; 67 public Continuation cont;
68 public long uid; 68 public long uid;
69 private int options;
69 70
70 public PutRequest() { 71 public PutRequest() {
71 this.uid = nextUID++; 72 this.uid = nextUID++;
@@ -80,6 +81,7 @@ public class DistributedHashTable {
80 cpm.expiration = expiration.asMessage(); 81 cpm.expiration = expiration.asMessage();
81 cpm.type = type; 82 cpm.type = type;
82 cpm.uid = uid; 83 cpm.uid = uid;
84 cpm.options = options;
83 return new Envelope(cpm); 85 return new Envelope(cpm);
84 } 86 }
85 87
@@ -95,6 +97,7 @@ public class DistributedHashTable {
95 public int type; 97 public int type;
96 public int replication; 98 public int replication;
97 public byte[] xquery; 99 public byte[] xquery;
100 public int options;
98 101
99 public GetRequest() { 102 public GetRequest() {
100 uid = DistributedHashTable.this.nextUID++; 103 uid = DistributedHashTable.this.nextUID++;
@@ -108,6 +111,7 @@ public class DistributedHashTable {
108 gm.xquery = xquery == null ? new byte[0] : xquery; 111 gm.xquery = xquery == null ? new byte[0] : xquery;
109 gm.key = key; 112 gm.key = key;
110 gm.uniqueId = uid; 113 gm.uniqueId = uid;
114 gm.options = options;
111 return new Envelope(gm); 115 return new Envelope(gm);
112 } 116 }
113 public void onCancel() { 117 public void onCancel() {
@@ -269,6 +273,10 @@ public class DistributedHashTable {
269 pr.expiration = expiration; 273 pr.expiration = expiration;
270 pr.type = type; 274 pr.type = type;
271 pr.cont = cont; 275 pr.cont = cont;
276 pr.options = 0;
277 for (RouteOption routeOption : routeOptions) {
278 pr.options |= routeOption.val;
279 }
272 280
273 putRequests.addRequest(pr.uid, pr); 281 putRequests.addRequest(pr.uid, pr);
274 } 282 }
@@ -297,6 +305,10 @@ public class DistributedHashTable {
297 getRequest.replication = type; 305 getRequest.replication = type;
298 getRequest.xquery = xquery; 306 getRequest.xquery = xquery;
299 getRequest.replication = replication; 307 getRequest.replication = replication;
308 getRequest.options = 0;
309 for (RouteOption routeOption : routeOptions) {
310 getRequest.options |= routeOption.val;
311 }
300 312
301 return getRequests.addRequest(getRequest.uid, getRequest); 313 return getRequests.addRequest(getRequest.uid, getRequest);
302 } 314 }