Cancel donwload: scaffold

This commit is contained in:
2026-06-02 15:38:30 +03:00
parent 4aca8fb5a4
commit 1ce2cccf59
4 changed files with 10 additions and 3 deletions
+1
View File
@@ -40,6 +40,7 @@ enum state {
S_PREP_SERVER_MESSAGE,
S_PRINT_SERVER_MESSAGE,
S_FILE_LIST,
S_WAIT_SERVER_READY,
S_WAIT_PASS,
/* S_FILE_SELECT, */
S_DOWNLOAD_FILE,
+1 -3
View File
@@ -35,9 +35,7 @@ void dwn_pr_modal_cb(w_cb_args_t *args) {
server_send_string(app->query_args, "cancel\n");
FILE_CLEAN(app);
d->needs_destroy = true;
app->query_args->state = S_FILE_LIST;
server_send_string(app->query_args, "file list %d %d\n", fui->max_lines,
fui->current_page);
app->query_args->state = S_WAIT_SERVER_READY;
}
}
+2
View File
@@ -216,6 +216,8 @@ int process_query(app_t *app) {
case S_PREP_SERVER_MESSAGE:
process_command(app, server_print_message_cb);
break;
case S_WAIT_SERVER_READY:
/* TODO: implement */
default:
break;
}
+6
View File
@@ -93,6 +93,8 @@ int server_print_message_cb(app_t *app, char *line, int l_len) {
return 0;
}
/* TODO: function that do all extraction stuff and compares the buf with a given world (in arg) */
int process_server_command(char *line, int l_len, app_t *app) {
int ws_pos = l_len;
query_args_t *q_args = app->query_args;
@@ -189,6 +191,10 @@ void ask_uname_and_password(params_t *params) {
}
}
void wait_server_ready(params_t *params) {
}
void ask_register(params_t *params, char *email) {
size_t lsize;
char *bufptr = NULL;