Minor improvements and fixes
This commit is contained in:
@ -145,7 +145,7 @@ public abstract class AbstractConnection {
|
||||
updateIvCache(inv.getInventory());
|
||||
List<InventoryVector> missing = ctx.getInventory().getMissing(inv.getInventory(), streams);
|
||||
missing.removeAll(commonRequestedObjects);
|
||||
LOG.debug("Received inventory with " + originalSize + " elements, of which are "
|
||||
LOG.trace("Received inventory with " + originalSize + " elements, of which are "
|
||||
+ missing.size() + " missing.");
|
||||
send(new GetData.Builder().inventory(missing).build());
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ public class ConnectionInfo extends AbstractConnection {
|
||||
reader.cleanup();
|
||||
reader = null;
|
||||
}
|
||||
payloadOut = null;
|
||||
}
|
||||
|
||||
public boolean isSyncFinished() {
|
||||
|
@ -239,8 +239,8 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
|
||||
}
|
||||
e.getValue().cancel();
|
||||
e.getValue().attach(null);
|
||||
it.remove();
|
||||
e.getKey().disconnect();
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
try {
|
||||
@ -387,12 +387,20 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
|
||||
distribution.put(connection, new LinkedList<InventoryVector>());
|
||||
}
|
||||
}
|
||||
if (distribution.isEmpty()){
|
||||
return;
|
||||
}
|
||||
InventoryVector next = iterator.next();
|
||||
ConnectionInfo previous = null;
|
||||
do {
|
||||
for (ConnectionInfo connection : distribution.keySet()) {
|
||||
if (connection == previous || previous == null) {
|
||||
next = iterator.next();
|
||||
if (iterator.hasNext()) {
|
||||
previous = connection;
|
||||
next = iterator.next();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (connection.knowsOf(next)) {
|
||||
List<InventoryVector> ivs = distribution.get(connection);
|
||||
|
Reference in New Issue
Block a user