Browse Source

Don't start ident server if previously failed

Change-Id: I1c222daecda5d2209f33906bfa1196f74ae72906
Reviewed-on: http://gerrit.dmdirc.com/2264
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 12 years ago
parent
commit
9e05653098
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      src/com/dmdirc/addons/identd/IdentdServer.java

+ 7
- 1
src/com/dmdirc/addons/identd/IdentdServer.java View File

49
     /** The plugin that owns us. */
49
     /** The plugin that owns us. */
50
     private final IdentdPlugin myPlugin;
50
     private final IdentdPlugin myPlugin;
51
 
51
 
52
+    /** Have we failed to start this server previously? */
53
+    private boolean failed = false;
54
+
52
     /**
55
     /**
53
      * Create the IdentdServer.
56
      * Create the IdentdServer.
54
      */
57
      */
116
      * Start the ident server
119
      * Start the ident server
117
      */
120
      */
118
     public void startServer() {
121
     public void startServer() {
119
-        if (myThread == null) {
122
+        if (!failed && myThread == null) {
120
             try {
123
             try {
121
                 final int identPort = myPlugin.getConfig().getOptionInt(
124
                 final int identPort = myPlugin.getConfig().getOptionInt(
122
                         myPlugin.getDomain(), "advanced.port");
125
                         myPlugin.getDomain(), "advanced.port");
125
                 myThread.start();
128
                 myThread.start();
126
             } catch (IOException e) {
129
             } catch (IOException e) {
127
                 Logger.userError(ErrorLevel.HIGH, "Unable to start identd server: " + e.getMessage());
130
                 Logger.userError(ErrorLevel.HIGH, "Unable to start identd server: " + e.getMessage());
131
+                if (e.getMessage().equals("Permission denied")) {
132
+                    failed = true;
133
+                }
128
             }
134
             }
129
         }
135
         }
130
     }
136
     }

Loading…
Cancel
Save