- Upload restart improving

...
This commit is contained in:
tonikelope 2019-12-31 16:15:16 +01:00
parent 8952f9e644
commit d886e2678e
11 changed files with 125 additions and 112 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>6.93</version>
<version>6.94</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -169,7 +169,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
try {
if (!_exit && !_upload.isStopped()) {
if (!_exit) {
RandomAccessFile f = new RandomAccessFile(_upload.getFile_name(), "r");
@ -179,7 +179,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
LOG.log(Level.INFO, "{0} Uploading chunk {1} from worker {2} {3}...", new Object[]{Thread.currentThread().getName(), chunk_id, _id, _upload.getFile_name()});
while (!_exit && !_upload.isStopped() && tot_bytes_up < chunk_size && (reads = cis.read(buffer)) != -1) {
while (!_exit && tot_bytes_up < chunk_size && (reads = cis.read(buffer)) != -1) {
out.write(buffer, 0, reads);
_upload.getPartialProgress().add((long) reads);
@ -198,7 +198,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
}
}
if (!_upload.isStopped() && !_exit) {
if (!_exit) {
if ((http_status = con.getResponseCode()) != 200) {
@ -208,6 +208,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
if (_upload.getProgress() == _upload.getFile_size()) {
_upload.getView().printStatusNormal("Waiting for completion handler ... ***DO NOT EXIT MEGABASTERD NOW***");
_upload.getView().getPause_button().setEnabled(false);
}
String httpresponse;

View File

@ -812,7 +812,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
} else if (_status_error != null) {
@ -831,7 +831,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
} else {
@ -858,7 +858,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
} catch (Exception ex) {
@ -925,7 +925,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
}
});
if (_status_error != null && _auto_retry_on_error) {
if (_status_error != null && !_canceled && _auto_retry_on_error) {
THREAD_POOL.execute(() -> {
for (int i = 3; !_closed && i > 0; i--) {
final int j = i;
@ -1438,8 +1438,6 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
file_info = MegaCrypterAPI.getMegaFileMetadata(link, panel, getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8"))) : null);
}
_auto_retry_on_error = true;
} catch (APIException ex) {
error = true;
@ -1496,6 +1494,8 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
if (!_exit && !error) {
_auto_retry_on_error = true;
swingInvoke(() -> {
getView().getStop_button().setText(LabelTranslatorSingleton.getInstance().translate("CANCEL DOWNLOAD"));
getView().getStop_button().setVisible(false);
@ -1527,8 +1527,6 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
dl_url = MegaCrypterAPI.getMegaFileDownloadUrl(link, _file_pass, _file_noexpire, _ma.getSid(), getMain_panel().getMega_proxy_server() != null ? (getMain_panel().getMega_proxy_server().getPort() + ":" + Bin2BASE64(("megacrypter:" + getMain_panel().getMega_proxy_server().getPassword()).getBytes("UTF-8")) + ":" + MiscTools.getMyPublicIP()) : null);
}
_auto_retry_on_error = true;
} catch (APIException ex) {
error = true;
@ -1567,7 +1565,9 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
} while (!_exit && error);
if (!error) {
if (!_exit && !error) {
_auto_retry_on_error = true;
swingInvoke(() -> {
getView().getStop_button().setText(LabelTranslatorSingleton.getInstance().translate("CANCEL DOWNLOAD"));

View File

@ -135,8 +135,8 @@ public class LabelTranslatorSingleton {
_addTranslation("New streaming", "Nuevo streaming");
_addTranslation("Split file", "Partir un archivo");
_addTranslation("Merge file", "Juntar las partes de un archivo");
_addTranslation("Remove all no running downloads", "Cancelar las descargas en espera");
_addTranslation("Remove all no running uploads", "Cancelar las subidas en espera");
_addTranslation("Remove all no running downloads", "Cancelar las descargas no activas");
_addTranslation("Remove all no running uploads", "Cancelar las subidas no activas");
_addTranslation("Edit", "Edición");
_addTranslation("Settings", "Ajustes");
_addTranslation("Help", "Ayuda");
@ -184,6 +184,7 @@ public class LabelTranslatorSingleton {
_addTranslation("Please, paste a Mega/MegaCrypter/ELC link!", "Por favor, escribe un enlace de Mega/MegaCrypter/ELC");
_addTranslation("Yes", "");
_addTranslation("Cancel", "Cancelar");
_addTranslation("UNEXPECTED ERROR!", "¡ERROR INESPERADO!");
_addTranslation("It seems MegaBasterd is streaming video. Do you want to exit?", "Parece que MegaBasterd está retransmitiendo vídeo. ¿Quieres continuar?");
_addTranslation("It seems MegaBasterd is provisioning down/uploads.\n\nIf you exit now, unprovisioned down/uploads will be lost.\n\nDo you want to continue?", "Parece que MegaBasterd está provisionando transferencias.\n\nSi sales ahora, todas las transferencias no provisionadas se perderán.\n\n¿Quieres continuar?");
_addTranslation("It seems MegaBasterd is just finishing uploading some files.\n\nIF YOU EXIT NOW, THOSE UPLOADS WILL FAIL.\n\nDo you want to continue?", "Parece que MegaBasterd está finalizando unas subidas.\n\nSI SALES AHORA, ESAS SUBIDAS FALLARÁN.\n\n¿Quieres continuar?");
@ -191,9 +192,9 @@ public class LabelTranslatorSingleton {
_addTranslation("Only SAVED settings and accounts will be exported. (If you are unsure, it is better to save your current settings and then export them).\n\nDo you want to continue?", "Sólamente los ajustes GUARDADOS se exportarán. (Si no estás seguro, es mejor que guardes antes tus ajustes y que después vuelvas aquí). ¿Quieres continuar?");
_addTranslation("Master password will be reset and all your accounts will be removed. (THIS CAN'T BE UNDONE)\n\nDo you want to continue?", "La contraseña maestra será reseteada y todas tus cuentas serán eliminadas. (ESTO NO SE PUEDE DESHACER).\n\n¿Quieres continuar?");
_addTranslation("ALL YOUR SETTINGS, ACCOUNTS AND TRANSFERENCES WILL BE REMOVED. (THIS CAN'T BE UNDONE)\n\nDo you want to continue?", "TODOS TUS AJUSTES, CUENTAS Y TRANSFERENCIAS SERÁN ELIMINADAS. (ESTO NO SE PUEDE DESHACER)\n\n¿Quieres continuar?");
_addTranslation("Remove all preprocessing, provisioning and waiting downloads?", "¿Eliminar todas las descargas que no están en ejecución?");
_addTranslation("Remove all no running downloads?", "¿Eliminar todas las descargas que no están en ejecución?");
_addTranslation("Warning!", "¡Atención!");
_addTranslation("Remove all preprocessing, provisioning and waiting uploads?", "¿Eliminar todas las subidas que no están en ejecución?");
_addTranslation("Remove all no running uploads?", "¿Eliminar todas las subidas que no están en ejecución?");
_addTranslation("Please, enter your master password", "Por favor, ingresa tu contraseña maestra");
_addTranslation("WARNING: if you forget this password, you will have to insert all your accounts again.", "AVISO: si olvidas esta contraseña, tendrás que volver a insertar todas tus cuentas.");
_addTranslation("New pass:", "Nueva contraseña:");

View File

@ -54,7 +54,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "6.93";
public static final String VERSION = "6.94";
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
public static final int STREAMER_PORT = 1337;
@ -952,8 +952,6 @@ public final class MainPanel {
}
System.out.println(old_version_major + " " + old_version_minor);
if (!old_version.equals("0.0") && (Integer.parseInt(version_major) > Integer.parseInt(old_version_major) || (Integer.parseInt(version_major) == Integer.parseInt(old_version_major) && Integer.parseInt(version_minor) > Integer.parseInt(old_version_minor)))) {
Object[] options = {"No",
LabelTranslatorSingleton.getInstance().translate("Yes")};
@ -1086,7 +1084,10 @@ public final class MainPanel {
}
try {
DBTools.truncateDownloadsQueue();
DBTools.insertDownloadsQueue(downloads_queue);
DBTools.truncateUploadsQueue();
DBTools.insertUploadsQueue(uploads_queue);
} catch (SQLException ex) {
Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex);
@ -1163,8 +1164,6 @@ public final class MainPanel {
if (!getResume_downloads()) {
setResume_downloads(true);
swingInvoke(() -> {
getView().getStatus_down_label().setText(LabelTranslatorSingleton.getInstance().translate("Checking if there are previous downloads, please wait..."));
});
@ -1172,36 +1171,34 @@ public final class MainPanel {
final MainPanel tthis = this;
THREAD_POOL.execute(() -> {
int conta_downloads = 0;
int conta_downloads = 0, tot_downloads = -1;
try {
ArrayList<String> downloads_queue = DBTools.selectDownloadsQueue();
HashMap<String, HashMap<String, Object>> res = selectDownloads();
tot_downloads = res.size();
for (String url : downloads_queue) {
HashMap<String, Object> o = res.remove(url);
if (o != null) {
try {
String email = (String) o.get("email");
String email = (String) o.get("email");
MegaAPI ma = new MegaAPI();
MegaAPI ma = new MegaAPI();
if (!tthis.isUse_mega_account_down() || (_mega_accounts.get(email) != null && (ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null)) {
if (!tthis.isUse_mega_account_down() || (_mega_accounts.get(email) != null && (ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null)) {
Download download = new Download(tthis, ma, (String) url, (String) o.get("path"), (String) o.get("filename"), (String) o.get("filekey"), (Long) o.get("filesize"), (String) o.get("filepass"), (String) o.get("filenoexpire"), _use_slots_down, false, (String) o.get("custom_chunks_dir"), false);
Download download = new Download(tthis, ma, (String) url, (String) o.get("path"), (String) o.get("filename"), (String) o.get("filekey"), (Long) o.get("filesize"), (String) o.get("filepass"), (String) o.get("filenoexpire"), _use_slots_down, false, (String) o.get("custom_chunks_dir"), false);
getDownload_manager().getTransference_provision_queue().add(download);
getDownload_manager().getTransference_provision_queue().add(download);
conta_downloads++;
}
} catch (Exception ex) {
Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, ex.getMessage());
conta_downloads++;
}
}
}
@ -1209,31 +1206,34 @@ public final class MainPanel {
for (Map.Entry<String, HashMap<String, Object>> entry : res.entrySet()) {
try {
String email = (String) entry.getValue().get("email");
String email = (String) entry.getValue().get("email");
MegaAPI ma = new MegaAPI();
MegaAPI ma = new MegaAPI();
if (!tthis.isUse_mega_account_down() || (_mega_accounts.get(email) != null && (ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null)) {
if (!tthis.isUse_mega_account_down() || (_mega_accounts.get(email) != null && (ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null)) {
Download download = new Download(tthis, ma, (String) entry.getKey(), (String) entry.getValue().get("path"), (String) entry.getValue().get("filename"), (String) entry.getValue().get("filekey"), (Long) entry.getValue().get("filesize"), (String) entry.getValue().get("filepass"), (String) entry.getValue().get("filenoexpire"), _use_slots_down, false, (String) entry.getValue().get("custom_chunks_dir"), false);
Download download = new Download(tthis, ma, (String) entry.getKey(), (String) entry.getValue().get("path"), (String) entry.getValue().get("filename"), (String) entry.getValue().get("filekey"), (Long) entry.getValue().get("filesize"), (String) entry.getValue().get("filepass"), (String) entry.getValue().get("filenoexpire"), _use_slots_down, false, (String) entry.getValue().get("custom_chunks_dir"), false);
getDownload_manager().getTransference_provision_queue().add(download);
getDownload_manager().getTransference_provision_queue().add(download);
conta_downloads++;
}
} catch (Exception ex) {
Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, ex.getMessage());
conta_downloads++;
}
}
} catch (SQLException ex) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
} catch (Exception ex2) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex2);
}
if (conta_downloads > 0) {
if (conta_downloads == tot_downloads) {
setResume_downloads(true);
}
_download_manager.setSort_wait_start_queue(false);
getDownload_manager().secureNotify();
swingInvoke(() -> {
@ -1325,8 +1325,6 @@ public final class MainPanel {
if (!getResume_uploads()) {
setResume_uploads(true);
swingInvoke(() -> {
getView().getStatus_up_label().setText(LabelTranslatorSingleton.getInstance().translate("Checking if there are previous uploads, please wait..."));
});
@ -1334,46 +1332,44 @@ public final class MainPanel {
final MainPanel tthis = this;
THREAD_POOL.execute(() -> {
int conta_uploads = 0, tot_uploads = -1;
try {
int conta_uploads = 0;
ArrayList<String> uploads_queue = DBTools.selectUploadsQueue();
HashMap<String, HashMap<String, Object>> res = selectUploads();
tot_uploads = res.size();
for (String filename : uploads_queue) {
HashMap<String, Object> o = res.remove(filename);
if (o != null) {
try {
String email = (String) o.get("email");
String email = (String) o.get("email");
if (_mega_accounts.get(email) != null) {
if (_mega_accounts.get(email) != null) {
MegaAPI ma;
MegaAPI ma;
if ((ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null) {
if ((ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null) {
Upload upload = new Upload(tthis, ma, (String) filename, (String) o.get("parent_node"), (String) o.get("ul_key") != null ? bin2i32a(BASE642Bin((String) o.get("ul_key"))) : null, (String) o.get("url"), (String) o.get("root_node"), BASE642Bin((String) o.get("share_key")), (String) o.get("folder_link"), false);
Upload upload = new Upload(tthis, ma, (String) filename, (String) o.get("parent_node"), (String) o.get("ul_key") != null ? bin2i32a(BASE642Bin((String) o.get("ul_key"))) : null, (String) o.get("url"), (String) o.get("root_node"), BASE642Bin((String) o.get("share_key")), (String) o.get("folder_link"), false);
getUpload_manager().getTransference_provision_queue().add(upload);
conta_uploads++;
} else {
break;
}
getUpload_manager().getTransference_provision_queue().add(upload);
conta_uploads++;
} else {
deleteUpload((String) o.get("filename"), email);
throw new Exception("Mega Login Error!");
}
} catch (Exception ex) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
} else {
deleteUpload((String) o.get("filename"), email);
tot_uploads--;
}
}
}
@ -1382,49 +1378,53 @@ public final class MainPanel {
for (Map.Entry<String, HashMap<String, Object>> entry : res.entrySet()) {
try {
String email = (String) entry.getValue().get("email");
String email = (String) entry.getValue().get("email");
if (_mega_accounts.get(email) != null) {
if (_mega_accounts.get(email) != null) {
MegaAPI ma;
MegaAPI ma;
if ((ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null) {
if ((ma = checkMegaAccountLoginAndShowMasterPassDialog(tthis, getView(), email)) != null) {
Upload upload = new Upload(tthis, ma, (String) entry.getKey(), (String) entry.getValue().get("parent_node"), (String) entry.getValue().get("ul_key") != null ? bin2i32a(BASE642Bin((String) entry.getValue().get("ul_key"))) : null, (String) entry.getValue().get("url"), (String) entry.getValue().get("root_node"), BASE642Bin((String) entry.getValue().get("share_key")), (String) entry.getValue().get("folder_link"), false);
Upload upload = new Upload(tthis, ma, (String) entry.getKey(), (String) entry.getValue().get("parent_node"), (String) entry.getValue().get("ul_key") != null ? bin2i32a(BASE642Bin((String) entry.getValue().get("ul_key"))) : null, (String) entry.getValue().get("url"), (String) entry.getValue().get("root_node"), BASE642Bin((String) entry.getValue().get("share_key")), (String) entry.getValue().get("folder_link"), false);
getUpload_manager().getTransference_provision_queue().add(upload);
conta_uploads++;
} else {
break;
}
getUpload_manager().getTransference_provision_queue().add(upload);
conta_uploads++;
} else {
deleteUpload((String) entry.getValue().get("filename"), email);
throw new Exception("Mega Login Error!");
}
} catch (Exception ex) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
} else {
deleteUpload((String) entry.getValue().get("filename"), email);
tot_uploads--;
}
}
if (conta_uploads > 0) {
_upload_manager.setSort_wait_start_queue(false);
getUpload_manager().secureNotify();
swingInvoke(() -> {
getView().getjTabbedPane1().setSelectedIndex(1);
});
}
swingInvoke(() -> {
getView().getStatus_up_label().setText("");
});
} catch (SQLException ex) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
} catch (Exception ex2) {
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex2);
}
if (conta_uploads > 0) {
if (conta_uploads == tot_uploads) {
setResume_uploads(true);
}
_upload_manager.setSort_wait_start_queue(false);
getUpload_manager().secureNotify();
swingInvoke(() -> {
getView().getjTabbedPane1().setSelectedIndex(1);
});
}
swingInvoke(() -> {
getView().getStatus_up_label().setText("");
});
});
}
}

View File

@ -1258,7 +1258,7 @@ public final class MainPanelView extends javax.swing.JFrame {
LabelTranslatorSingleton.getInstance().translate("Yes")};
int n = showOptionDialog(_main_panel.getView(),
LabelTranslatorSingleton.getInstance().translate("Remove all preprocessing, provisioning and waiting downloads?"),
LabelTranslatorSingleton.getInstance().translate("Remove all no running downloads?"),
LabelTranslatorSingleton.getInstance().translate("Warning!"), YES_NO_CANCEL_OPTION, QUESTION_MESSAGE,
null,
options,
@ -1310,7 +1310,7 @@ public final class MainPanelView extends javax.swing.JFrame {
LabelTranslatorSingleton.getInstance().translate("Yes")};
int n = showOptionDialog(_main_panel.getView(),
LabelTranslatorSingleton.getInstance().translate("Remove all preprocessing, provisioning and waiting uploads?"),
LabelTranslatorSingleton.getInstance().translate("Remove all no running uploads?"),
LabelTranslatorSingleton.getInstance().translate("Warning!"), YES_NO_CANCEL_OPTION, QUESTION_MESSAGE,
null,
options,

View File

@ -953,11 +953,11 @@ public class MegaAPI implements Serializable {
folder_nodes.put((String) node.get("h"), the_node);
} catch (Exception e) {
System.out.println("WARNING: node key is not valid " + (String) node.get("k"));
LOG.log(Level.WARNING, "WARNING: node key is not valid " + (String) node.get("k"));
}
} else {
System.out.println("WARNING: node key is not valid " + (String) node.get("k"));
LOG.log(Level.WARNING, "WARNING: node key is not valid " + (String) node.get("k"));
}
}

View File

@ -545,7 +545,6 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
_main_panel.getView().repaint();
});
}
private String _genStatus() {
@ -556,7 +555,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
int rem = _transference_remove_queue.size();
int wait = _transference_waitstart_queue.size();
int wait = _transference_waitstart_queue.size() + _transference_waitstart_aux_queue.size();
int run = _transference_running_list.size();

View File

@ -70,7 +70,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
private final String _root_node;
private final byte[] _share_key;
private final String _folder_link;
private final boolean _restart;
private boolean _restart;
private volatile boolean _closed;
private volatile boolean _canceled;
private volatile String _temp_mac_data;
@ -81,7 +81,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_notified = false;
_priority = priority;
_frozen = main_panel.isInit_paused();
_provision_ok = true;
_provision_ok = false;
_status_error = null;
_auto_retry_on_error = true;
_canceled = false;
@ -117,10 +117,10 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_notified = false;
_priority = upload.isPriority();
_provision_ok = true;
_provision_ok = false;
_status_error = null;
_auto_retry_on_error = true;
_canceled = false;
_canceled = upload.isCanceled();
_closed = false;
_restart = true;
_main_panel = upload.getMain_panel();
@ -128,8 +128,8 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_file_name = upload.getFile_name();
_parent_node = upload.getParent_node();
_progress_lock = new Object();
_ul_key = null;
_ul_url = null;
_ul_key = upload.getUl_key();
_ul_url = upload.getUl_url();
_root_node = upload.getRoot_node();
_share_key = upload.getShare_key();
_folder_link = upload.getFolder_link();
@ -146,7 +146,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_view = new UploadView(this);
_progress_meter = new ProgressMeter(this);
_file_meta_mac = null;
_temp_mac_data = null;
_temp_mac_data = upload.getTemp_mac_data();
}
public boolean isPriority() {
@ -685,7 +685,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
if (!_exit) {
if (_ul_url == null || _restart) {
if (_ul_url == null) {
int conta_error = 0;
@ -727,12 +727,16 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
DBTools.updateUploadUrl(_file_name, _ma.getFull_email(), _ul_url);
_auto_retry_on_error = true;
} catch (SQLException ex) {
LOG.log(Level.SEVERE, ex.getMessage());
}
}
}
_canceled = false;
if (!_exit && _ul_url != null) {
int[] file_iv = {_ul_key[4], _ul_key[5], 0, 0};
@ -946,7 +950,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
} else if (_status_error != null) {
@ -965,7 +969,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
} else if (_canceled) {
@ -978,7 +982,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
getView().hideAllExceptStatus();
getView().printStatusNormal("UNKNOWN ERROR!");
getView().printStatusNormal("UNEXPECTED ERROR!");
}
if (_status_error == null && !_canceled) {
@ -988,6 +992,12 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
} catch (SQLException ex) {
LOG.log(Level.SEVERE, ex.getMessage());
}
} else {
try {
DBTools.updateUploadProgress(getFile_name(), getMa().getFull_email(), getProgress(), getTemp_mac_data() != null ? getTemp_mac_data() : null);
} catch (SQLException ex) {
Logger.getLogger(Upload.class.getName()).log(Level.SEVERE, null, ex);
}
}
getMain_panel().getUpload_manager().getTransference_running_list().remove(this);
@ -1014,7 +1024,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
}
});
if (_status_error != null && _auto_retry_on_error) {
if (_status_error != null && !_canceled && _auto_retry_on_error) {
THREAD_POOL.execute(() -> {
for (int i = 3; !_closed && i > 0; i--) {
final int j = i;

View File

@ -71,7 +71,9 @@ public class UploadManager extends TransferenceManager {
increment_total_progress(-1 * u.getProgress());
delete_up.add(new String[]{u.getFile_name(), ((Upload) u).getMa().getFull_email()});
if (!u.isCanceled()) {
delete_up.add(new String[]{u.getFile_name(), ((Upload) u).getMa().getFull_email()});
}
}
try {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 191 KiB