Cancel donwload: scaffold
This commit is contained in:
@@ -40,6 +40,7 @@ enum state {
|
|||||||
S_PREP_SERVER_MESSAGE,
|
S_PREP_SERVER_MESSAGE,
|
||||||
S_PRINT_SERVER_MESSAGE,
|
S_PRINT_SERVER_MESSAGE,
|
||||||
S_FILE_LIST,
|
S_FILE_LIST,
|
||||||
|
S_WAIT_SERVER_READY,
|
||||||
S_WAIT_PASS,
|
S_WAIT_PASS,
|
||||||
/* S_FILE_SELECT, */
|
/* S_FILE_SELECT, */
|
||||||
S_DOWNLOAD_FILE,
|
S_DOWNLOAD_FILE,
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ void dwn_pr_modal_cb(w_cb_args_t *args) {
|
|||||||
server_send_string(app->query_args, "cancel\n");
|
server_send_string(app->query_args, "cancel\n");
|
||||||
FILE_CLEAN(app);
|
FILE_CLEAN(app);
|
||||||
d->needs_destroy = true;
|
d->needs_destroy = true;
|
||||||
app->query_args->state = S_FILE_LIST;
|
app->query_args->state = S_WAIT_SERVER_READY;
|
||||||
server_send_string(app->query_args, "file list %d %d\n", fui->max_lines,
|
|
||||||
fui->current_page);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,8 @@ int process_query(app_t *app) {
|
|||||||
case S_PREP_SERVER_MESSAGE:
|
case S_PREP_SERVER_MESSAGE:
|
||||||
process_command(app, server_print_message_cb);
|
process_command(app, server_print_message_cb);
|
||||||
break;
|
break;
|
||||||
|
case S_WAIT_SERVER_READY:
|
||||||
|
/* TODO: implement */
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ int server_print_message_cb(app_t *app, char *line, int l_len) {
|
|||||||
return 0;
|
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 process_server_command(char *line, int l_len, app_t *app) {
|
||||||
int ws_pos = l_len;
|
int ws_pos = l_len;
|
||||||
query_args_t *q_args = app->query_args;
|
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) {
|
void ask_register(params_t *params, char *email) {
|
||||||
size_t lsize;
|
size_t lsize;
|
||||||
char *bufptr = NULL;
|
char *bufptr = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user