diff --git a/apps/BOB/src/net/i2p/BOB/BOB.java b/apps/BOB/src/net/i2p/BOB/BOB.java index 022172341..ca2d6f878 100644 --- a/apps/BOB/src/net/i2p/BOB/BOB.java +++ b/apps/BOB/src/net/i2p/BOB/BOB.java @@ -35,9 +35,73 @@ import net.i2p.client.I2PClient; import net.i2p.client.streaming.RetransmissionTimer; import net.i2p.util.Log; import net.i2p.util.SimpleTimer; - /** - * + * + * ################################################################################
+ * ############################.#..........#..#..........##########################
+ * #######################......................................###################
+ * ####################...........................#.......#........################
+ * #################..................##...................#.........##############
+ * ###############................###...####.....#..###.....#.........#############
+ * #############...........###..#..###...#####...###.##........#.......############
+ * ###########................#......##...#####...##..##.......#..#........########
+ * ##########.........................#....##.##..#...##.....................######
+ * #########...................................#....#.........................#####
+ * ########.........................................#...............#..........####
+ * ########.........................................#..........#######..........###
+ * #######.................................................############..........##
+ * #######..........................................####################.........##
+ * #######............####################......########################.........##
+ * ######.............###############################################.##.........##
+ * ######............################################################..##........##
+ * ######............################################################..##........##
+ * ######.............##############################################..##.........##
+ * ######............##############################################...##..........#
+ * ######............#..###########################################...##..........#
+ * ######.............#############################################....#..........#
+ * #######...........###############################################..##.........##
+ * #######...........#####.#.#.#.########################.....#.####...##........##
+ * ######............#..............##################.................##.........#
+ * ######................####.........###############........#####......##........#
+ * ######..............####..#.........############.......##.#.######...##.......##
+ * ######.................#.####.........########...........##....###...##.......##
+ * #######....#....###...................#######...............#...###..##.......##
+ * #######.........###..###.....###.......######.##.#####.........####..##.......##
+ * #######.....#...##############.........############......###########.###......##
+ * #######....##...##########.......##...##############......#.############.....###
+ * ########....#..########......######...##################################....####
+ * ########....##.####################...##################################....####
+ * ########..#.##..###################..##################################..#..####
+ * ##########..###..#################...##################################...#.####
+ * #########....##...##############....########..#####.################.##..#.#####
+ * ############.##....##########.......#########.###.......###########..#.#########
+ * ###############.....#######...#.......########.....##.....######.....###########
+ * ###############......###....##..........##.......######....#.........#.#########
+ * ##############............##..................##########..............##########
+ * ##############..............................##########..#.............##########
+ * ###############.......##..................#####..............####....###########
+ * ###############.......#####.......#.............####.....#######.....###########
+ * ################...#...####......##################.....########....############
+ * ################...##..#####.........####.##.....#....##########....############
+ * ##################..##..####...........#####.#....############.....#############
+ * ##################......#####.................################....##############
+ * ###################.....####..........##########..###########....###############
+ * ####################..#..#..........................########.....###############
+ * #####################.##.......###.................########....#################
+ * ######################.........#.......#.##.###############....#################
+ * #############.#######...............#####################....###################
+ * ###..#.....##...####..........#.....####################....####################
+ * ####......##........................##################....######################
+ * #.##...###..............###.........###############......#######################
+ * #...###..##............######...........................########################
+ * ##.......###..........##########....#...#...........############################
+ * ##.........##.......############################################################
+ * ###........##.....##############################################################
+ * ####.............###############################################################
+ * ######.........#################################################################
+ * #########....###################################################################
+ * ################################################################################
+ *
* BOB, main command socket listener, launches the command parser engine. * * @author sponge @@ -89,16 +153,19 @@ public class BOB { // This is here just to ensure there is no interference with our threadgroups. SimpleTimer Y = RetransmissionTimer.getInstance(); i = Y.hashCode(); - - try { - props.load(new FileInputStream(configLocation)); - } catch(FileNotFoundException fnfe) { - warn("Unable to load up the BOB config file " + configLocation + ", Using defaults."); - warn(fnfe.toString()); - save = true; - } catch(IOException ioe) { - warn("IOException on BOB config file " + configLocation + ", using defaults."); - warn(ioe.toString()); + { + try { + FileInputStream fi = new FileInputStream(configLocation); + props.load(fi); + fi.close(); + } catch(FileNotFoundException fnfe) { + warn("Unable to load up the BOB config file " + configLocation + ", Using defaults."); + warn(fnfe.toString()); + save = true; + } catch(IOException ioe) { + warn("IOException on BOB config file " + configLocation + ", using defaults."); + warn(ioe.toString()); + } } // Global router and client API configurations that are missing are set to defaults here. if(!props.containsKey(I2PClient.PROP_TCP_HOST)) { @@ -131,7 +198,9 @@ public class BOB { if(save) { try { warn("Writing new defaults file " + configLocation); - props.store(new FileOutputStream(configLocation), configLocation); + FileOutputStream fo = new FileOutputStream(configLocation); + props.store(fo, configLocation); + fo.close(); } catch(IOException ioe) { warn("IOException on BOB config file " + configLocation + ", " + ioe); } diff --git a/apps/BOB/src/net/i2p/BOB/doCMDS.java b/apps/BOB/src/net/i2p/BOB/doCMDS.java index 2fb363b18..e6c7b6fd7 100644 --- a/apps/BOB/src/net/i2p/BOB/doCMDS.java +++ b/apps/BOB/src/net/i2p/BOB/doCMDS.java @@ -151,7 +151,7 @@ public class doCMDS implements Runnable { */ doCMDS(Socket server, Properties props, nickname database, Log _log) { this.server = server; - this.props = props; + this.props = new Properties(props); this.database = database; this._log = _log; }