diff options
-rw-r--r-- | ISSUES | 104 | ||||
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | izpack-installer.xml | 8 | ||||
-rw-r--r-- | src/org/gnunet/nse/NetworkSizeEstimation.java | 2 | ||||
-rw-r--r-- | src/org/gnunet/requests/RequestQueue.java | 1 | ||||
-rw-r--r-- | src/org/gnunet/transport/BlacklistCallback.java | 9 | ||||
-rw-r--r-- | src/org/gnunet/transport/HelloUpdateCallback.java | 9 | ||||
-rw-r--r-- | src/org/gnunet/transport/PeerIterateCallback.java | 9 | ||||
-rw-r--r-- | src/org/gnunet/transport/RequestConnectMessage.java | 25 | ||||
-rw-r--r-- | src/org/gnunet/transport/StartMessage.java | 32 | ||||
-rw-r--r-- | src/org/gnunet/transport/Transport.java | 103 | ||||
-rw-r--r-- | src/org/gnunet/transport/TryConnectCallback.java | 9 | ||||
-rw-r--r-- | src/org/gnunet/util/Client.java | 5 | ||||
-rw-r--r-- | src/org/gnunet/util/Scheduler.java | 8 |
14 files changed, 323 insertions, 3 deletions
@@ -109,3 +109,107 @@ https://gnunet.org/node/2015 | |||
109 | * WoT: | 109 | * WoT: |
110 | * GPG itself has no API, but there's http://www.gnupg.org/related_software/gpgme/ | 110 | * GPG itself has no API, but there's http://www.gnupg.org/related_software/gpgme/ |
111 | * whole PKI in java http://www.ejbca.org/download.html | 111 | * whole PKI in java http://www.ejbca.org/download.html |
112 | |||
113 | |||
114 | |||
115 | ---------------------------------------------------------- | ||
116 | |||
117 | * currently trying to rule out a heisenbug in gnunet-java | ||
118 | * turns up only sometimes, never when running tests individually | ||
119 | * stacktraces are just wrong: | ||
120 | |||
121 | java.lang.AssertionError: notifyTransmitReady called on disconnected client | ||
122 | at org.gnunet.util.Client.notifyTransmitReady(Client.java:152) | ||
123 | at org.gnunet.requests.RequestQueue.handleNextTransmit(RequestQueue.java:102) | ||
124 | at org.gnunet.requests.RequestQueue.add(RequestQueue.java:158) | ||
125 | at org.gnunet.statistics.Statistics.set(Statistics.java:277) | ||
126 | at org.gnunet.statistics.StatisticsTest$17.run(StatisticsTest.java:263) | ||
127 | at org.gnunet.util.Scheduler$TaskConfiguration.run(Scheduler.java:200) | ||
128 | at org.gnunet.util.Scheduler$TaskConfiguration.access$1100(Scheduler.java:115) | ||
129 | at org.gnunet.util.Scheduler.runReady(Scheduler.java:505) | ||
130 | at org.gnunet.util.Scheduler.run(Scheduler.java:481) | ||
131 | at org.gnunet.util.Scheduler.run(Scheduler.java:447) | ||
132 | at org.gnunet.nse.NSETest.test_nse(NSETest.java:52) | ||
133 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | ||
134 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | ||
135 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | ||
136 | at java.lang.reflect.Method.invoke(Method.java:616) | ||
137 | |||
138 | the NSE-test case somehow calls statistics ... that would be only possible if | ||
139 | the tasks got mixed up, e.g. because of static variables in Scheduler | ||
140 | |||
141 | |||
142 | => Confirmed, test cases, even from different classes, get called in the same environment! | ||
143 | |||
144 | |||
145 | |||
146 | |||
147 | about the release last week: | ||
148 | actually gnunet-java-0.9.4.jar should have the name gnunet-java-installer-0.9.4, as there would | ||
149 | be confusion with the library gnunet-java.jar | ||
150 | |||
151 | |||
152 | * consensus: | ||
153 | * how do we handle the "endgame" phase of a consensus session? | ||
154 | * clients can call conclude(), no new values will be accepted until enough peers | ||
155 | have been reconciled with | ||
156 | * how do we manage memory/values for reconciled values? | ||
157 | * memory does not seem sufficient if we want to use a file / database / etc. | ||
158 | * should consensus itself handle timestamps of set elements? | ||
159 | * conclude() would need that | ||
160 | * deletion of elements should not be supported, should it? | ||
161 | * would be possible with anti-messages, see the gossiping overview paper | ||
162 | * handling multiple peers: when to partition? | ||
163 | * i.e. sometimes we can't satisfy | ||
164 | * scheduling of exchanges / when should we reconcile with whom? | ||
165 | |||
166 | |||
167 | * should consensus have a fixed bytestring length, or handle variable lengths? | ||
168 | * probably the former as it is simpler | ||
169 | * later could be done by just reconciling hashes, not the data itself | ||
170 | |||
171 | * should there be the ability to remove/add peer to a consensus session? | ||
172 | * I don't think so | ||
173 | |||
174 | * what size should the consensus_id be? | ||
175 | |||
176 | |||
177 | * how should the command line tool work? | ||
178 | * either we introduce sessions with local UIDs, or we have to provide the list of peers every time | ||
179 | |||
180 | |||
181 | * more literature: | ||
182 | * http://www.ics.uci.edu/~eppstein/pubs/EppGooUye-SIGCOMM-11.pdf | ||
183 | * more recent (2011), they are aware of the minsky/trachtenberg CPI approach | ||
184 | * but only compare themselves with the BASIC-RECON approach, not PARTITION-RECON | ||
185 | * claim to resolve differences between two hosts in one round, | ||
186 | with computational and communication costs linear in the size of the symm. difference | ||
187 | * does an estimate of set difference size with the first message => not very nice for p2p | ||
188 | * make extensive use of invertible bloom filters | ||
189 | * but no public implementation available :( | ||
190 | |||
191 | * http://www.ics.uci.edu/~eppstein/pubs/EppGooUye-SIGCOMM-11.pdf | ||
192 | * also from 2011, estimates difference size with bloom filters, uses CPI, and is still computationally expensive | ||
193 | |||
194 | |||
195 | |||
196 | * found a TR with the same title by minsky/trachtenberg, also add it to biblio? | ||
197 | * http://dspace.library.cornell.edu/bitstream/1813/5788/1/2000-1796.pdf | ||
198 | |||
199 | |||
200 | transport: | ||
201 | * offer_hello: why a task, not a callback? | ||
202 | * blacklist: why do we pass a config handle, not a transport handle? | ||
203 | |||
204 | |||
205 | |||
206 | |||
207 | |||
208 | * automake stuff: | ||
209 | * INCLUDES is deprecated: | ||
210 | http://www.gnu.org/software/automake/manual/automake.html#Program-Variables | ||
211 | INCLUDES | ||
212 | This does the same job as AM_CPPFLAGS (or any per-target _CPPFLAGS variable if it is used). It is an older name for the same functionality. This variable is deprecated; we suggest using AM_CPPFLAGS and per-target _CPPFLAGS instead. | ||
213 | |||
214 | |||
215 | |||
diff --git a/build.gradle b/build.gradle index f5ade14..2dd1717 100644 --- a/build.gradle +++ b/build.gradle | |||
@@ -108,7 +108,7 @@ task installer (type: Exec) { | |||
108 | outputs.file("$installerFile") | 108 | outputs.file("$installerFile") |
109 | } | 109 | } |
110 | 110 | ||
111 | installer.dependsOn "build" | 111 | installer.dependsOn "build","javadoc" |
112 | 112 | ||
113 | installer.outputs.upToDateWhen { false } | 113 | installer.outputs.upToDateWhen { false } |
114 | 114 | ||
diff --git a/izpack-installer.xml b/izpack-installer.xml index a9eb9cd..c79f1be 100644 --- a/izpack-installer.xml +++ b/izpack-installer.xml | |||
@@ -73,6 +73,14 @@ | |||
73 | <include name="javadoc/**" /> | 73 | <include name="javadoc/**" /> |
74 | </fileset> | 74 | </fileset> |
75 | </pack> | 75 | </pack> |
76 | <pack name="source code" required="no"> | ||
77 | <description> | ||
78 | The source code of gnunet-java | ||
79 | </description> | ||
80 | <fileset dir="." targetdir="$INSTALL_PATH/share/gnunet-java"> | ||
81 | <include name="gnunet-java-0.9.4-src.tar.gz" /> | ||
82 | </fileset> | ||
83 | </pack> | ||
76 | </packs> | 84 | </packs> |
77 | 85 | ||
78 | </installation> | 86 | </installation> |
diff --git a/src/org/gnunet/nse/NetworkSizeEstimation.java b/src/org/gnunet/nse/NetworkSizeEstimation.java index 1aeca00..366ab80 100644 --- a/src/org/gnunet/nse/NetworkSizeEstimation.java +++ b/src/org/gnunet/nse/NetworkSizeEstimation.java | |||
@@ -139,7 +139,7 @@ public class NetworkSizeEstimation { | |||
139 | */ | 139 | */ |
140 | public void disconnect() { | 140 | public void disconnect() { |
141 | disconnected = true; | 141 | disconnected = true; |
142 | client.disconnect(); | 142 | |
143 | } | 143 | } |
144 | 144 | ||
145 | public static void main(String[] args) { | 145 | public static void main(String[] args) { |
diff --git a/src/org/gnunet/requests/RequestQueue.java b/src/org/gnunet/requests/RequestQueue.java index 7987f57..e514303 100644 --- a/src/org/gnunet/requests/RequestQueue.java +++ b/src/org/gnunet/requests/RequestQueue.java | |||
@@ -78,6 +78,7 @@ public class RequestQueue { | |||
78 | * Handle next request. | 78 | * Handle next request. |
79 | */ | 79 | */ |
80 | private void handleNextTransmit() { | 80 | private void handleNextTransmit() { |
81 | |||
81 | if (clogged) { | 82 | if (clogged) { |
82 | return; | 83 | return; |
83 | } | 84 | } |
diff --git a/src/org/gnunet/transport/BlacklistCallback.java b/src/org/gnunet/transport/BlacklistCallback.java new file mode 100644 index 0000000..a9da35f --- /dev/null +++ b/src/org/gnunet/transport/BlacklistCallback.java | |||
@@ -0,0 +1,9 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | /** | ||
4 | * ... | ||
5 | * | ||
6 | * @author Florian Dold | ||
7 | */ | ||
8 | public class BlacklistCallback { | ||
9 | } | ||
diff --git a/src/org/gnunet/transport/HelloUpdateCallback.java b/src/org/gnunet/transport/HelloUpdateCallback.java new file mode 100644 index 0000000..d5253b7 --- /dev/null +++ b/src/org/gnunet/transport/HelloUpdateCallback.java | |||
@@ -0,0 +1,9 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | /** | ||
4 | * ... | ||
5 | * | ||
6 | * @author Florian Dold | ||
7 | */ | ||
8 | public class HelloUpdateCallback { | ||
9 | } | ||
diff --git a/src/org/gnunet/transport/PeerIterateCallback.java b/src/org/gnunet/transport/PeerIterateCallback.java new file mode 100644 index 0000000..da9a3ae --- /dev/null +++ b/src/org/gnunet/transport/PeerIterateCallback.java | |||
@@ -0,0 +1,9 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | /** | ||
4 | * ... | ||
5 | * | ||
6 | * @author Florian Dold | ||
7 | */ | ||
8 | public class PeerIterateCallback { | ||
9 | } | ||
diff --git a/src/org/gnunet/transport/RequestConnectMessage.java b/src/org/gnunet/transport/RequestConnectMessage.java new file mode 100644 index 0000000..9bd7a5b --- /dev/null +++ b/src/org/gnunet/transport/RequestConnectMessage.java | |||
@@ -0,0 +1,25 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | import org.gnunet.construct.NestedMessage; | ||
4 | import org.gnunet.construct.UInt32; | ||
5 | import org.gnunet.construct.UnionCase; | ||
6 | import org.gnunet.util.GnunetMessage; | ||
7 | import org.gnunet.util.PeerIdentity; | ||
8 | |||
9 | /** | ||
10 | * ... | ||
11 | * | ||
12 | * @author Florian Dold | ||
13 | */ | ||
14 | @UnionCase(374) | ||
15 | public class RequestConnectMessage implements GnunetMessage.Body { | ||
16 | @UInt32 | ||
17 | public int reserved; | ||
18 | |||
19 | /** | ||
20 | * Identity of the peer we would like to connect to. | ||
21 | */ | ||
22 | @NestedMessage | ||
23 | public PeerIdentity peer; | ||
24 | |||
25 | } | ||
diff --git a/src/org/gnunet/transport/StartMessage.java b/src/org/gnunet/transport/StartMessage.java new file mode 100644 index 0000000..2169565 --- /dev/null +++ b/src/org/gnunet/transport/StartMessage.java | |||
@@ -0,0 +1,32 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | import org.gnunet.construct.NestedMessage; | ||
4 | import org.gnunet.construct.UInt32; | ||
5 | import org.gnunet.construct.UnionCase; | ||
6 | import org.gnunet.util.GnunetMessage; | ||
7 | import org.gnunet.util.PeerIdentity; | ||
8 | |||
9 | /** | ||
10 | * ... | ||
11 | * | ||
12 | * @author Florian Dold | ||
13 | */ | ||
14 | @UnionCase(360) | ||
15 | public class StartMessage implements GnunetMessage.Body { | ||
16 | /** | ||
17 | * 0: no options | ||
18 | * 1: The 'self' field should be checked | ||
19 | * 2: this client is interested in payload traffic | ||
20 | */ | ||
21 | @UInt32 | ||
22 | public int options; | ||
23 | |||
24 | /** | ||
25 | * Identity we think we have. If it does not match, the | ||
26 | * receiver should print out an error message and disconnect. | ||
27 | */ | ||
28 | @NestedMessage | ||
29 | public PeerIdentity self; | ||
30 | |||
31 | |||
32 | } | ||
diff --git a/src/org/gnunet/transport/Transport.java b/src/org/gnunet/transport/Transport.java new file mode 100644 index 0000000..f79c340 --- /dev/null +++ b/src/org/gnunet/transport/Transport.java | |||
@@ -0,0 +1,103 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | import org.gnunet.hello.HelloMessage; | ||
4 | import org.gnunet.util.*; | ||
5 | |||
6 | /** | ||
7 | * ... | ||
8 | * | ||
9 | * @author Florian Dold | ||
10 | */ | ||
11 | public class Transport { | ||
12 | |||
13 | public Transport(Configuration cfg) { | ||
14 | |||
15 | } | ||
16 | |||
17 | /** | ||
18 | * Ask the transport service to establish a connection to | ||
19 | * the given peer. | ||
20 | * | ||
21 | * @param target who we should try to connect to | ||
22 | * @param cb callback to be called when request was transmitted to transport | ||
23 | * service | ||
24 | * @return a GNUNET_TRANSPORT_TryConnectHandle handle or | ||
25 | * NULL on failure (cb will not be called) | ||
26 | */ | ||
27 | Cancelable tryConnect(PeerIdentity target, TryConnectCallback cb) { | ||
28 | throw new UnsupportedOperationException(); | ||
29 | } | ||
30 | |||
31 | |||
32 | /** | ||
33 | * Obtain the HELLO message for this peer. | ||
34 | * | ||
35 | * @param rec function to call with the HELLO, sender will be our peer | ||
36 | * identity; message and sender will be NULL on timeout | ||
37 | * (handshake with transport service pending/failed). | ||
38 | * cost estimate will be 0. | ||
39 | * @return handle to cancel the operation | ||
40 | */ | ||
41 | Cancelable getHello(HelloUpdateCallback rec) { | ||
42 | throw new UnsupportedOperationException(); | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * Offer the transport service the HELLO of another peer. Note that | ||
47 | * the transport service may just ignore this message if the HELLO is | ||
48 | * malformed or useless due to our local configuration. | ||
49 | * | ||
50 | * @param hello the hello message | ||
51 | * @param cont continuation to call when HELLO has been sent, | ||
52 | * tc reason GNUNET_SCHEDULER_REASON_TIMEOUT for fail | ||
53 | * tc reasong GNUNET_SCHEDULER_REASON_READ_READY for success | ||
54 | * @return a GNUNET_TRANSPORT_OfferHelloHandle handle or NULL on failure, | ||
55 | * in case of failure cont will not be called | ||
56 | */ | ||
57 | |||
58 | Cancelable offerHello(HelloMessage hello, | ||
59 | Scheduler.Task cont) { | ||
60 | throw new UnsupportedOperationException(); | ||
61 | } | ||
62 | |||
63 | /** | ||
64 | * Install a blacklist callback. The service will be queried for all | ||
65 | * existing connections as well as any fresh connections to check if | ||
66 | * they are permitted. If the blacklisting callback is unregistered, | ||
67 | * all hosts that were denied in the past will automatically be | ||
68 | * whitelisted again. Cancelling the blacklist handle is also the | ||
69 | * only way to re-enable connections from peers that were previously | ||
70 | * blacklisted. | ||
71 | * | ||
72 | * @param cfg configuration to use | ||
73 | * @param cb callback to invoke to check if connections are allowed | ||
74 | * @return NULL on error, otherwise handle for cancellation | ||
75 | */ | ||
76 | static Cancelable blacklist(Configuration cfg, | ||
77 | BlacklistCallback cb) { | ||
78 | throw new UnsupportedOperationException(); | ||
79 | } | ||
80 | |||
81 | /** | ||
82 | * Return all the known addresses for a specific peer or all peers. | ||
83 | * Returns continuously all address if one_shot is set to GNUNET_NO | ||
84 | * <p/> | ||
85 | * CHANGE: Returns the address(es) that we are currently using for this | ||
86 | * peer. Upon completion, the 'AddressLookUpCallback' is called one more | ||
87 | * time with 'NULL' for the address and the peer. After this, the operation must no | ||
88 | * longer be explicitly canceled. | ||
89 | * | ||
90 | * @param cfg configuration to use | ||
91 | * @param peer peer identity to look up the addresses of, CHANGE: allow NULL for all (connected) peers | ||
92 | * @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL), | ||
93 | * GNUNET_NO to monitor the set of addresses used (continuously, must be explicitly canceled) | ||
94 | * @param timeout how long is the lookup allowed to take at most (irrelevant if one_shot is set to GNUNET_NO) | ||
95 | * @param peer_address_callback function to call with the results | ||
96 | */ | ||
97 | Cancelable | ||
98 | peer_get_active_addresses(Configuration cfg, PeerIdentity peer, int one_shot, | ||
99 | RelativeTime timeout, PeerIterateCallback peer_address_callback) { | ||
100 | throw new UnsupportedOperationException(); | ||
101 | } | ||
102 | } | ||
103 | |||
diff --git a/src/org/gnunet/transport/TryConnectCallback.java b/src/org/gnunet/transport/TryConnectCallback.java new file mode 100644 index 0000000..93c0f76 --- /dev/null +++ b/src/org/gnunet/transport/TryConnectCallback.java | |||
@@ -0,0 +1,9 @@ | |||
1 | package org.gnunet.transport; | ||
2 | |||
3 | /** | ||
4 | * ... | ||
5 | * | ||
6 | * @author Florian Dold | ||
7 | */ | ||
8 | public class TryConnectCallback { | ||
9 | } | ||
diff --git a/src/org/gnunet/util/Client.java b/src/org/gnunet/util/Client.java index 2dc6493..182c797 100644 --- a/src/org/gnunet/util/Client.java +++ b/src/org/gnunet/util/Client.java | |||
@@ -148,7 +148,10 @@ public class Client { | |||
148 | if (notifyTransmitReadyDelayed) { | 148 | if (notifyTransmitReadyDelayed) { |
149 | throw new AssertionError("notifyTransmitReady called twice!"); | 149 | throw new AssertionError("notifyTransmitReady called twice!"); |
150 | } | 150 | } |
151 | if (connection != null && connection.isConnected()) { | 151 | if (connection == null) { |
152 | throw new AssertionError("notifyTransmitReady called on disconnected client"); | ||
153 | } | ||
154 | if (connection.isConnected()) { | ||
152 | return connection.notifyTransmitReady(0, timeout, transmitter); | 155 | return connection.notifyTransmitReady(0, timeout, transmitter); |
153 | } else { | 156 | } else { |
154 | notifyTransmitReadyDelayed = true; | 157 | notifyTransmitReadyDelayed = true; |
diff --git a/src/org/gnunet/util/Scheduler.java b/src/org/gnunet/util/Scheduler.java index a10efaf..2e90bd3 100644 --- a/src/org/gnunet/util/Scheduler.java +++ b/src/org/gnunet/util/Scheduler.java | |||
@@ -63,6 +63,8 @@ public class Scheduler { | |||
63 | 63 | ||
64 | private static Selector selector = null; | 64 | private static Selector selector = null; |
65 | 65 | ||
66 | private static boolean scheduler_running = false; | ||
67 | |||
66 | 68 | ||
67 | static { | 69 | static { |
68 | try { | 70 | try { |
@@ -455,6 +457,12 @@ public class Scheduler { | |||
455 | * @param initialTask the initial task to run immediately | 457 | * @param initialTask the initial task to run immediately |
456 | */ | 458 | */ |
457 | public static void run(Task initialTask) { | 459 | public static void run(Task initialTask) { |
460 | if (scheduler_running) { | ||
461 | throw new AssertionError("can't call run recursively"); | ||
462 | } | ||
463 | |||
464 | scheduler_running = true; | ||
465 | |||
458 | if (initialTask != null) { | 466 | if (initialTask != null) { |
459 | addContinuation(initialTask, EnumSet.of(Reason.STARTUP)); | 467 | addContinuation(initialTask, EnumSet.of(Reason.STARTUP)); |
460 | } | 468 | } |