From f00de4e0d5ba4c14dc09ff84263563a7abc45cd9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 29 Apr 2006 23:18:18 +0000 Subject: [PATCH] version 0.4.6: improved handling of closed connections; fix bug in node-hostname-changing --- src/de/todesbaum/jsite/application/ProjectInserter.java | 13 ++++++++++--- src/de/todesbaum/jsite/gui/NodeManagerPage.java | 1 + src/de/todesbaum/jsite/main/Version.java | 2 +- src/de/todesbaum/util/freenet/fcp2/Connection.java | 3 +++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 03072f8..d525ddb 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -48,7 +48,7 @@ import de.todesbaum.util.io.StreamCopier; /** * @author David Roden <droden@gmail.com> - * @version $Id: ProjectInserter.java 440 2006-03-30 09:31:25Z bombe $ + * @version $Id: ProjectInserter.java 486 2006-04-27 10:58:34Z bombe $ */ public class ProjectInserter implements FileScannerListener, Runnable { @@ -240,12 +240,19 @@ public class ProjectInserter implements FileScannerListener, Runnable { /* create connection to node */ Connection connection = freenetInterface.getConnection("project-insert-" + counter++); + boolean connected = false; + Throwable cause = null; try { - connection.connect(); + connected = connection.connect(); } catch (IOException e1) { - fireProjectInsertFinished(false, e1); + cause = e1; + } + + if (!connected) { + fireProjectInsertFinished(false, cause); return; } + Client client = new Client(connection); /* create containers */ diff --git a/src/de/todesbaum/jsite/gui/NodeManagerPage.java b/src/de/todesbaum/jsite/gui/NodeManagerPage.java index 9b1c80a..1309fbf 100644 --- a/src/de/todesbaum/jsite/gui/NodeManagerPage.java +++ b/src/de/todesbaum/jsite/gui/NodeManagerPage.java @@ -212,6 +212,7 @@ public class NodeManagerPage extends TWizardPage implements ListSelectionListene } else if ("node-hostname".equals(documentName)) { node.setHostname(documentText); nodeList.repaint(); + fireNodesUpdated(getNodes()); } } diff --git a/src/de/todesbaum/jsite/main/Version.java b/src/de/todesbaum/jsite/main/Version.java index 98829d2..47f7ebc 100644 --- a/src/de/todesbaum/jsite/main/Version.java +++ b/src/de/todesbaum/jsite/main/Version.java @@ -25,7 +25,7 @@ package de.todesbaum.jsite.main; */ public class Version { - private static final String VERSION = "0.4.5"; + private static final String VERSION = "0.4.6"; public static final String getVersion() { return VERSION; diff --git a/src/de/todesbaum/util/freenet/fcp2/Connection.java b/src/de/todesbaum/util/freenet/fcp2/Connection.java index 15757d0..1eeded0 100644 --- a/src/de/todesbaum/util/freenet/fcp2/Connection.java +++ b/src/de/todesbaum/util/freenet/fcp2/Connection.java @@ -231,6 +231,9 @@ public class Connection { } nodeSocket = null; } + synchronized (this) { + notify(); + } fireConnectionTerminated(); } -- 2.7.4