Logger.error(this, "Unable to read global salt (checksum failed)");
}
requestStarters.setGlobalSalt(salt);
int requestCount = ois.readInt();
for(int i=0;i<requestCount;i++) {
ClientRequest request = null;
RequestIdentifier reqID = readRequestIdentifier(ois);
if(reqID != null && context.persistentRoot.hasRequest(reqID)) {
Logger.warning(this, "Not reading request because already have it");
skipChecksummedObject(ois, length); // Request itself
skipChecksummedObject(ois, length); // Recovery data
continue;
}
try {
if(!noSerialize) {
request = (ClientRequest) readChecksummedObject(ois, length);
if(request != null) {
if(reqID != null) {
if(!reqID.sameIdentifier(request.getRequestIdentifier())) {
Logger.error(this, "Request does not match request identifier, discarding");
request = null;
} else {
loaded.addPartiallyLoadedRequest(reqID, request, RequestLoadStatus.LOADED);
}
}
}
} else
skipChecksummedObject(ois, length);
} catch (ChecksumFailedException e) {
Logger.error(this, "Failed to load request (checksum failed)");
System.err.println("Failed to load a request (checksum failed)");
} catch (Throwable t) {
// Some more serious problem. Try to load the rest anyway.
Logger.error(this, "Failed to load request: "+t, t);
System.err.println("Failed to load a request: "+t);
t.printStackTrace();
}
if(request == null || logMINOR) {
try {
ClientRequest restored = readRequestFromRecoveryData(ois, length, reqID);
if(request == null && restored != null) {
request = restored;
boolean loadedFully = restored.fullyResumed();
loaded.addPartiallyLoadedRequest(reqID, request,
loadedFully ? RequestLoadStatus.RESTORED_FULLY : RequestLoadStatus.RESTORED_RESTARTED);
}
} catch (ChecksumFailedException e) {
if(request == null) {