import static android.os.SystemClock.sleep;
import static net.ktnx.mobileledger.utils.Logger.debug;
+/* TODO: get rid of the custom session/cookie and auth code?
+ * (the last problem with the POST was the missing content-length header)
+ * This will resolve itself when hledger-web 1.14+ is released with Debian/stable,
+ * at which point the HTML form emulation can be dropped entirely
+ */
+
public class SendTransactionTask extends AsyncTask<LedgerTransaction, Void, Void> {
private final TaskCallback taskCallback;
protected String error;
if (!send_1_15_OK()) {
Logger.debug("network", "Version 1.5 request failed. Trying with 1.14");
if (!send_1_14_OK()) {
- Logger.debug("network", "Version 1.14 failed too. Trying HTML form emulation");
+ Logger.debug("network",
+ "Version 1.14 failed too. Trying HTML form emulation");
legacySendOkWithRetry();
}
else {
while (!legacySendOK()) {
tried++;
if (tried >= 2)
- throw new IOException(
- String.format("aborting after %d tries", tried));
+ throw new IOException(String.format("aborting after %d tries", tried));
sleep(100);
}
}
import static net.ktnx.mobileledger.utils.Logger.debug;
/*
- * TODO: nicer progress while transaction is submitted
* TODO: reports
- * TODO: get rid of the custom session/cookie and auth code?
- * (the last problem with the POST was the missing content-length header)
* */
public class NewTransactionActivity extends ProfileThemedActivity implements TaskCallback,