2004-12-16 jrandom

* Catch another oddball case for a reset connection in the streaming lib.
    * Add a dumpprofile.jsp page, called with ?peer=base64OfPeerHash, which
      dumps the current state of that peer's profile.  Instead of the full
      base64, you can pass in however many characters you have and it will
      return the first match found.
This commit is contained in:
jrandom
2004-12-16 10:21:23 +00:00
committed by zzz
parent 3cb727561c
commit d969dd2d8d
8 changed files with 62 additions and 18 deletions

View File

@ -32,6 +32,7 @@ public class Connection {
private long _lastSendTime;
private long _lastSendId;
private boolean _resetReceived;
private boolean _resetSent;
private boolean _connected;
private boolean _hardDisconnected;
private MessageInputStream _inputStream;
@ -178,6 +179,7 @@ public class Connection {
*
*/
void sendReset() {
_resetSent = true;
if ( (_remotePeer == null) || (_sendStreamId == null) ) return;
PacketLocal reply = new PacketLocal(_context, _remotePeer);
reply.setFlag(Packet.FLAG_RESET);
@ -380,6 +382,7 @@ public class Connection {
public boolean getIsConnected() { return _connected; }
public boolean getHardDisconnected() { return _hardDisconnected; }
public boolean getResetSent() { return _resetSent; }
void disconnect(boolean cleanDisconnect) {
disconnect(cleanDisconnect, true);

View File

@ -34,7 +34,7 @@ class SchedulerHardDisconnected extends SchedulerImpl {
public boolean accept(Connection con) {
if (con == null) return false;
long timeSinceClose = _context.clock().now() - con.getCloseSentOn();
boolean ok = (con.getHardDisconnected()) &&
boolean ok = (con.getHardDisconnected() || con.getResetSent()) &&
(timeSinceClose < Connection.DISCONNECT_TIMEOUT);
return ok;
}