[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20590 - in gnunet-java: src/org/gnunet/util tools
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20590 - in gnunet-java: src/org/gnunet/util tools |
Date: |
Sun, 18 Mar 2012 15:28:55 +0100 |
Author: dold
Date: 2012-03-18 15:28:55 +0100 (Sun, 18 Mar 2012)
New Revision: 20590
Modified:
gnunet-java/src/org/gnunet/util/Client.java
gnunet-java/src/org/gnunet/util/Resolver.java
gnunet-java/tools/build
Log:
fixed bug in the resolver
Modified: gnunet-java/src/org/gnunet/util/Client.java
===================================================================
--- gnunet-java/src/org/gnunet/util/Client.java 2012-03-18 13:51:21 UTC (rev
20589)
+++ gnunet-java/src/org/gnunet/util/Client.java 2012-03-18 14:28:55 UTC (rev
20590)
@@ -61,10 +61,6 @@
* The list of possible IP addresses the service can be reached by.
*/
private LinkedList<InetAddress> addressList = new
LinkedList<InetAddress>();
- /**
- * True if we are requesting or receiving IP addresses from the resolver
- */
- private boolean resolveActive = false;
/**
* The task that is currently used by the resolve mechanism.
@@ -379,11 +375,10 @@
@Override
public void onFinished() {
+ resolveHandle = null;
if (addressList.isEmpty()) {
logger.debug("address could not be resolved");
initiateResolve();
- } else {
- resolveActive = false;
}
}
@@ -393,7 +388,7 @@
}
public void initiateResolve() {
- if (resolveActive) {
+ if (resolveHandle != null) {
return;
}
resolveHandle = Resolver.getInstance().resolveHostname(connectionHost,
RelativeTime.FOREVER, new AddressHandler());
Modified: gnunet-java/src/org/gnunet/util/Resolver.java
===================================================================
--- gnunet-java/src/org/gnunet/util/Resolver.java 2012-03-18 13:51:21 UTC
(rev 20589)
+++ gnunet-java/src/org/gnunet/util/Resolver.java 2012-03-18 14:28:55 UTC
(rev 20590)
@@ -248,22 +248,34 @@
private boolean resolveActive = false;
public ResolveHandle resolveHostname(String hostname, RelativeTime
timeout, final AddressCallback cb) {
- ResolveHandle rh = new ResolveHandle();
+ final ResolveHandle rh = new ResolveHandle();
rh.hostname = hostname;
rh.deadline = timeout.toAbsolute();
rh.cb = cb;
// try if hostname is numeric IP or loopback
if (hostname.equalsIgnoreCase("localhost")) {
- cb.onAddress(getInet6Localhost());
- cb.onAddress(getInet4Localhost());
- rh.finished = true;
- cb.onFinished();
+ Scheduler.add(new Scheduler.Task() {
+ @Override
+ public void run(Scheduler.RunContext ctx) {
+ cb.onAddress(getInet6Localhost());
+ cb.onAddress(getInet4Localhost());
+ rh.finished = true;
+ cb.onFinished();
+ }
+ });
+
return rh;
}
if (hostname.equalsIgnoreCase("ip6-localhost")) {
- cb.onAddress(getInet6Localhost());
- rh.finished = true;
- cb.onFinished();
+ Scheduler.add(new Scheduler.Task() {
+ @Override
+ public void run(Scheduler.RunContext ctx) {
+ cb.onAddress(getInet6Localhost());
+ rh.finished = true;
+ cb.onFinished();
+ }
+ });
+
return rh;
}
Modified: gnunet-java/tools/build
===================================================================
--- gnunet-java/tools/build 2012-03-18 13:51:21 UTC (rev 20589)
+++ gnunet-java/tools/build 2012-03-18 14:28:55 UTC (rev 20590)
@@ -8,14 +8,12 @@
# collect all source files
SOURCES=`find "$BASEDIR/src/" "$BASEDIR/test/" -name "*.java"`
-mkdir -p $BASEDIR/bin/
+mkdir -p $BASEDIR/build
-javac $JFLAGS -cp "$BASEDIR/bin/:$BASEDIR/lib/*" -d $BASEDIR/bin/ $SOURCES
+javac $JFLAGS -cp "$BASEDIR/build/:$BASEDIR/lib/*" -d $BASEDIR/build/ $SOURCES
cd "$BASEDIR/src/"
-# collect resources from src/ and copy to bin/
+# collect resources from src/ and copy to build/
find "." \( -name "*.txt" -o -name "*.properties" \) \
- -exec cp --parents '{}' "../bin" \;
-
-cd -
+ -exec cp --parents '{}' "../build" \;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20590 - in gnunet-java: src/org/gnunet/util tools,
gnunet <=