ELinks 0.18.0
task.c File Reference

Sessions task management. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/menu.h"
#include "bfu/dialog.h"
#include "cache/cache.h"
#include "dialogs/menu.h"
#include "dialogs/status.h"
#include "document/document.h"
#include "document/html/parser.h"
#include "document/refresh.h"
#include "document/view.h"
#include "intl/libintl.h"
#include "main/event.h"
#include "main/timer.h"
#include "network/connection.h"
#include "osdep/newwin.h"
#include "protocol/protocol.h"
#include "protocol/uri.h"
#include "terminal/terminal.h"
#include "terminal/window.h"
#include "session/download.h"
#include "session/location.h"
#include "session/session.h"
#include "session/task.h"
#include "viewer/text/view.h"
Include dependency graph for task.c:

Data Structures

struct  task

Enumerations

enum  do_move { DO_MOVE_ABORT , DO_MOVE_DISPLAY , DO_MOVE_DONE }

Functions

static void loading_callback (struct download *, struct session *)
static void free_task (struct session *ses)
void abort_preloading (struct session *ses, int interrupt)
void ses_load (struct session *ses, struct uri *uri, char *target_frame, struct location *target_location, cache_mode_T cache_mode, enum task_type task_type)
static void post_yes (void *task_)
static void post_no (void *task_)
static int check_malicious_uri (struct uri *uri)
 Check if the URI is obfuscated (bug 382).
void ses_goto (struct session *ses, struct uri *uri, char *target_frame, struct location *target_location, cache_mode_T cache_mode, enum task_type task_type, int redir)
struct view_stateses_forward (struct session *ses, int loaded_in_frame)
 If loaded_in_frame is set, this was called just to indicate a move inside a frameset, and we basically just reset the appropriate frame's view_state in that case.
static void ses_imgmap (struct session *ses)
static enum do_move do_redirect (struct session *ses, struct download **download_p, struct cache_entry *cached)
static enum do_move do_move (struct session *ses, struct download **download_p)
static void do_follow_url (struct session *ses, struct uri *uri, char *target, enum task_type task, cache_mode_T cache_mode, int do_referrer)
static void follow_url (struct session *ses, struct uri *uri, char *target, enum task_type task, cache_mode_T cache_mode, int referrer)
void goto_uri (struct session *ses, struct uri *uri)
void goto_uri_frame (struct session *ses, struct uri *uri, char *target, cache_mode_T cache_mode)
void delayed_goto_uri_frame (void *data)
void map_selected (struct terminal *term, void *ld_, void *ses_)
void goto_url (struct session *ses, char *url)
struct uriget_hooked_uri (const char *uristring_, struct session *ses, char *cwd)
void goto_url_with_hook (struct session *ses, const char *url)
int goto_url_home (struct session *ses)
void goto_imgmap (struct session *ses, struct uri *uri, char *target)

Detailed Description

Sessions task management.

Enumeration Type Documentation

◆ do_move

enum do_move
Enumerator
DO_MOVE_ABORT 
DO_MOVE_DISPLAY 
DO_MOVE_DONE 

Function Documentation

◆ abort_preloading()

void abort_preloading ( struct session * ses,
int interrupt )

◆ check_malicious_uri()

int check_malicious_uri ( struct uri * uri)
static

Check if the URI is obfuscated (bug 382).

The problem is said to occur when a URI designed to pass access a specific location with a supplied username, contains misleading chars prior to the @ symbol.

An attacker can exploit this issue by supplying a malicious URI pointing to a page designed to mimic that of a trusted site, and tricking a victim who follows a link into believing they are actually at the trusted location.

Only the user ID (and not also the password) is checked because only the user ID is displayed in the status bar.

◆ delayed_goto_uri_frame()

void delayed_goto_uri_frame ( void * data)

◆ do_follow_url()

void do_follow_url ( struct session * ses,
struct uri * uri,
char * target,
enum task_type task,
cache_mode_T cache_mode,
int do_referrer )
static

◆ do_move()

enum do_move do_move ( struct session * ses,
struct download ** download_p )
static

◆ do_redirect()

enum do_move do_redirect ( struct session * ses,
struct download ** download_p,
struct cache_entry * cached )
static

◆ follow_url()

void follow_url ( struct session * ses,
struct uri * uri,
char * target,
enum task_type task,
cache_mode_T cache_mode,
int referrer )
static

◆ free_task()

void free_task ( struct session * ses)
static

◆ get_hooked_uri()

struct uri * get_hooked_uri ( const char * uristring_,
struct session * ses,
char * cwd )

◆ goto_imgmap()

void goto_imgmap ( struct session * ses,
struct uri * uri,
char * target )

◆ goto_uri()

void goto_uri ( struct session * ses,
struct uri * uri )

◆ goto_uri_frame()

void goto_uri_frame ( struct session * ses,
struct uri * uri,
char * target,
cache_mode_T cache_mode )

◆ goto_url()

void goto_url ( struct session * ses,
char * url )

◆ goto_url_home()

int goto_url_home ( struct session * ses)

◆ goto_url_with_hook()

void goto_url_with_hook ( struct session * ses,
const char * url )

◆ loading_callback()

void loading_callback ( struct download * download,
struct session * ses )
static

◆ map_selected()

void map_selected ( struct terminal * term,
void * ld_,
void * ses_ )

◆ post_no()

void post_no ( void * task_)
static

◆ post_yes()

void post_yes ( void * task_)
static

◆ ses_forward()

struct view_state * ses_forward ( struct session * ses,
int loaded_in_frame )

If loaded_in_frame is set, this was called just to indicate a move inside a frameset, and we basically just reset the appropriate frame's view_state in that case.

When clicking on a link inside a frame, the frame URI is somehow updated and added to the files-to-load queue, then ses_forward() is called with loaded_in_frame unset, duplicating the whole frameset's location, then later the file-to-load callback calls it for the particular frame with loaded_in_frame set.

◆ ses_goto()

void ses_goto ( struct session * ses,
struct uri * uri,
char * target_frame,
struct location * target_location,
cache_mode_T cache_mode,
enum task_type task_type ,
int redir )

◆ ses_imgmap()

void ses_imgmap ( struct session * ses)
static

◆ ses_load()

void ses_load ( struct session * ses,
struct uri * uri,
char * target_frame,
struct location * target_location,
cache_mode_T cache_mode,
enum task_type task_type task_type  )