Changeset facbb8c9


Ignore:
Timestamp:
Jun 18, 2011 4:33:47 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
bda6d78
Parents:
c655d23
Message:
  • IRC Server: Send a message back if the tunnel is up but the server is down
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCServer.java

    rc655d23 rfacbb8c9  
    6464    private static final long HEADER_TIMEOUT = 60*1000;
    6565   
     66    private final static byte[] ERR_UNAVAILABLE =
     67        (":ircserver.i2p 499 you :" +
     68         "This I2P IRC server is unvailable. It may be down or undergoing maintenance. " +
     69         "Please try again later." +
     70         "\r\n")
     71         .getBytes();
     72
    6673    /**
    6774     * @throws IllegalArgumentException if the I2PTunnel does not contain
     
    126133            new I2PTunnelRunner(s, socket, slock, null, modifiedRegistration.getBytes(), null);
    127134        } catch (SocketException ex) {
    128             // TODO send the equivalent of a 503?
     135            try {
     136                // Send a response so the user doesn't just see a disconnect
     137                // and blame his router or the network.
     138                socket.getOutputStream().write(ERR_UNAVAILABLE);
     139            } catch (IOException ioe) {}
    129140            try {
    130141                socket.close();
Note: See TracChangeset for help on using the changeset viewer.