Changeset 1ecf437


Ignore:
Timestamp:
Aug 27, 2009 3:52:14 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7736545f
Parents:
593d4dc
Message:
  • Client:
    • Fail if no date handshake after 30s or no leaseset after 5m, rather than hanging forever.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/I2PSessionImpl.java

    r593d4dc r1ecf437  
    284284            sendMessage(new GetDateMessage());
    285285            if (_log.shouldLog(Log.DEBUG)) _log.debug(getPrefix() + "After getDate / begin waiting for a response");
     286            int waitcount = 0;
    286287            while (!_dateReceived) {
     288                if (waitcount++ > 30)
     289                    throw new IOException("no date handshake");
    287290                try {
    288291                    synchronized (_dateReceivedLock) {
     
    299302
    300303            // wait until we have created a lease set
     304            waitcount = 0;
    301305            while (_leaseSet == null) {
     306                if (waitcount++ > 5*60)
     307                    throw new IOException("no leaseset");
    302308                synchronized (_leaseSetWait) {
    303309                    try {
Note: See TracChangeset for help on using the changeset viewer.