Fix IND$FILE
Build and Test j3270 / Build JAR & Run Tests (push) Successful in 45s

This commit is contained in:
2026-08-26 00:04:30 +00:00
parent bcfd4ba2e0
commit ebc0b5ae6f
4 changed files with 91 additions and 21 deletions
@@ -121,6 +121,21 @@ public class FileTransfer implements FTCut.FTCutListener, FTDft.FTDftListener {
if (state == FTState.RUNNING || state == FTState.AWAIT_ACK) {
log.info("User cancelled transfer");
setState(FTState.ABORT_WAIT); // Signal handlers to abort at next chance
// Start a safety timeout in case the host does not send further packets to trigger abort
cancelTimeout();
timeoutTimer = new Timer("FTCancelTimeout", true);
timeoutTimer.schedule(new TimerTask() {
@Override
public void run() {
SwingUtilities.invokeLater(() -> {
if (state != FTState.NONE) {
log.warning("Transfer cancel timeout — force resetting state");
completeTransfer("Transfer cancelled by user.");
callback.onTransferAborted("Cancelled by user.");
}
});
}
}, 3000);
} else if (state != FTState.NONE) {
log.info("Forcing cancel from state " + state);
completeTransfer("Transfer cancelled.");