1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

Factor new function ses_load out of ses_goto.

This commit is contained in:
Miciah Dashiel Butler Masters 2005-11-14 08:46:17 +00:00 committed by Miciah Dashiel Butler Masters
parent 16c0afb56c
commit 93d6d959a5

View File

@ -67,6 +67,23 @@ struct task {
struct session_task session_task;
};
static void
ses_load(struct session *ses, struct uri *uri, unsigned char *target_frame,
struct location *target_location, enum cache_mode cache_mode,
enum task_type task_type)
{
ses->loading.callback = (download_callback_T *) loading_callback;
ses->loading.data = ses;
ses->loading_uri = uri;
ses->task.type = task_type;
ses->task.target.frame = target_frame;
ses->task.target.location = target_location;
load_uri(ses->loading_uri, ses->referrer, &ses->loading,
PRI_MAIN, cache_mode, -1);
}
static void
post_yes(struct task *task)
{
@ -201,17 +218,8 @@ ses_goto(struct session *ses, struct uri *uri, unsigned char *target_frame,
}
if (!confirm_submit) {
ses->loading.callback = (download_callback_T *) loading_callback;
ses->loading.data = ses;
ses->loading_uri = get_uri_reference(uri);
ses->task.type = task_type;
ses->task.target.frame = target_frame;
ses->task.target.location = target_location;
load_uri(ses->loading_uri, ses->referrer, &ses->loading,
PRI_MAIN, cache_mode, -1);
ses_load(ses, get_uri_reference(uri), target_frame,
target_location, cache_mode, task_type);
return;
}