final ProtocolDataUnit protocolDataUnit = connection.receive();
LOGGER.trace("1" + protocolDataUnit);
if (protocolDataUnit.getBasicHeaderSegment().getParser() instanceof Ready2TransferParser) {
LOGGER.trace("2");
final Ready2TransferParser parser = (Ready2TransferParser) protocolDataUnit.getBasicHeaderSegment().getParser();
final int targetTransferTag = parser.getTargetTransferTag();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("R2T has TTT set to " + targetTransferTag);
}
final int desiredDataTransferLength = parser.getDesiredDataTransferLength();
if (desiredDataTransferLength > connection.getSettingAsInt(OperationalTextKey.MAX_BURST_LENGTH)) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error("MaxBurstLength limit is exceed.");
}
throw new InternetSCSIException("MaxBurstLength limit is exceed.");
}
connection.nextState(new WriteSecondBurstState(connection, iterator, targetTransferTag, desiredDataTransferLength, dataSequenceNumber, bufferOffset));
super.stateFollowing = true;
// return true;
return;
} else if (protocolDataUnit.getBasicHeaderSegment().getParser() instanceof SCSIResponseParser) {
final SCSIResponseParser parser = (SCSIResponseParser) protocolDataUnit.getBasicHeaderSegment().getParser();
if (!iterator.hasNext() && parser.getStatus() == SCSIStatus.GOOD) {
connection.getSession().incrementInitiatorTaskTag();
// return false;
super.stateFollowing = false;
return;
}