亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? file.c

?? 一個很有名的瀏覽器
?? C
字號:
/* Internal "file" protocol implementation *//* $Id: file.c,v 1.185.2.4 2005/04/06 09:27:40 jonas Exp $ */#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h> /* OS/2 needs this after sys/types.h */#ifdef HAVE_FCNTL_H#include <fcntl.h> /* OS/2 needs this after sys/types.h */#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#include "elinks.h"#include "cache/cache.h"#include "config/options.h"#include "encoding/encoding.h"#include "intl/gettext/libintl.h"#include "modules/module.h"#include "protocol/file/cgi.h"#include "protocol/file/file.h"#include "protocol/uri.h"#include "sched/connection.h"#include "util/conv.h"#include "util/file.h"#include "util/memory.h"#include "util/string.h"static struct option_info file_options[] = {	INIT_OPT_TREE("protocol", N_("Local files"),		"file", 0,		N_("Options specific to local browsing.")),#ifdef CONFIG_CGI	INIT_OPT_TREE("protocol.file", N_("Local CGI"),		"cgi", 0,		N_("Local CGI specific options.")),	INIT_OPT_STRING("protocol.file.cgi", N_("Path"),		"path", 0, "",		N_("Colon separated list of directories, where CGI scripts are stored.")),	INIT_OPT_BOOL("protocol.file.cgi", N_("Allow local CGI"),		"policy", 0, 0,		N_("Whether to execute local CGI scripts.")),#endif /* CONFIG_CGI */	INIT_OPT_BOOL("protocol.file", N_("Allow reading special files"),		"allow_special_files", 0, 0,		N_("Whether to allow reading from non-regular files.\n"		"Note this can be dangerous; reading /dev/urandom or\n"		"/dev/zero can ruin your day!")),	INIT_OPT_BOOL("protocol.file", N_("Show hidden files in directory listing"),		"show_hidden_files", 0, 1,		N_("When set to false, files with name starting with a dot will be\n"		   "hidden in local directories listing.")),	INIT_OPT_BOOL("protocol.file", N_("Try encoding extensions"),		"try_encoding_extensions", 0, 1,		N_("When set, if we can't open a file named 'filename', we'll try\n"		"to open 'filename' with some encoding extension appended\n"		"(ie. 'filename.gz'); it depends on the supported encodings.")),	NULL_OPTION_INFO,};struct module file_protocol_module = struct_module(	/* name: */		N_("File"),	/* options: */		file_options,	/* hooks: */		NULL,	/* submodules: */	NULL,	/* data: */		NULL,	/* init: */		NULL,	/* done: */		NULL);/* Directory listing *//* Based on the @entry attributes and file-/dir-/linkname is added to the @data * fragment. */static inline voidadd_dir_entry(struct directory_entry *entry, struct string *page,	      int pathlen, unsigned char *dircolor){	unsigned char *lnk = NULL;	struct string html_encoded_name;	struct string uri_encoded_name;	if (!init_string(&html_encoded_name)) return;	if (!init_string(&uri_encoded_name)) {		done_string(&html_encoded_name);		return;	}	encode_uri_string(&uri_encoded_name, entry->name + pathlen, 1);	add_html_to_string(&html_encoded_name, entry->name + pathlen,			   strlen(entry->name) - pathlen);	/* add_to_string(&fragment, &fragmentlen, "   "); */	add_html_to_string(page, entry->attrib, strlen(entry->attrib));	add_to_string(page, "<a href=\"");	add_string_to_string(page, &uri_encoded_name);	if (entry->attrib[0] == 'd') {		add_char_to_string(page, '/');#ifdef FS_UNIX_SOFTLINKS	} else if (entry->attrib[0] == 'l') {		struct stat st;		unsigned char buf[MAX_STR_LEN];		int readlen = readlink(entry->name, buf, MAX_STR_LEN);		if (readlen > 0 && readlen != MAX_STR_LEN) {			buf[readlen] = '\0';			lnk = straconcat(" -> ", buf, NULL);		}		if (!stat(entry->name, &st) && S_ISDIR(st.st_mode))			add_char_to_string(page, '/');#endif	}	add_to_string(page, "\">");	if (entry->attrib[0] == 'd' && *dircolor) {		/* The <b> is for the case when use_document_colors is off. */		string_concat(page, "<font color=\"", dircolor, "\"><b>", NULL);	}	add_string_to_string(page, &html_encoded_name);	done_string(&uri_encoded_name);	done_string(&html_encoded_name);	if (entry->attrib[0] == 'd' && *dircolor) {		add_to_string(page, "</b></font>");	}	add_to_string(page, "</a>");	if (lnk) {		add_html_to_string(page, lnk, strlen(lnk));		mem_free(lnk);	}	add_char_to_string(page, '\n');}/* First information such as permissions is gathered for each directory entry. * Finally the sorted entries are added to the @data->fragment one by one. */static inline voidadd_dir_entries(struct directory_entry *entries, unsigned char *dirpath,		struct string *page){	unsigned char dircolor[8];	int dirpathlen = strlen(dirpath);	int i;	/* Setup @dircolor so it's easy to check if we should color dirs. */	if (get_opt_bool("document.browse.links.color_dirs")) {		color_to_string(get_opt_color("document.colors.dirs"),				(unsigned char *) &dircolor);	} else {		dircolor[0] = 0;	}	for (i = 0; entries[i].name; i++) {		add_dir_entry(&entries[i], page, dirpathlen, dircolor);		mem_free(entries[i].attrib);		mem_free(entries[i].name);	}	/* We may have allocated space for entries but added none. */	mem_free_if(entries);}/* Generates a HTML page listing the content of @directory with the path * @dirpath. *//* Returns a connection state. S_OK if all is well. */static inline enum connection_statelist_directory(unsigned char *dirpath, struct string *page){	int show_hidden_files = get_opt_bool("protocol.file.show_hidden_files");	unsigned char *slash = dirpath;	unsigned char *pslash = ++slash;	struct directory_entry *entries;	errno = 0;	entries = get_directory_entries(dirpath, show_hidden_files);	if (!entries) {		if (errno) return -errno;		return S_OUT_OF_MEM;	}	if (!init_string(page)) return S_OUT_OF_MEM;	add_to_string(page, "<html>\n<head><title>");	add_html_to_string(page, dirpath, strlen(dirpath));	add_to_string(page, "</title>\n<base href=\"");	encode_uri_string(page, dirpath, strlen(dirpath));	add_to_string(page, "\" />\n</head>\n<body>\n<h2>Directory /");	/* Make the directory path with links to each subdir. */	while ((slash = strchr(slash, '/'))) {		*slash = 0;		add_to_string(page, "<a href=\"");		/* FIXME: htmlesc? At least we should escape quotes. --pasky */		add_to_string(page, dirpath);		add_to_string(page, "/\">");		add_html_to_string(page, pslash, strlen(pslash));		add_to_string(page, "</a>/");		*slash = '/';		pslash = ++slash;	}	add_to_string(page, "</h2>\n<pre>");	add_dir_entries(entries, dirpath, page);	add_to_string(page, "</pre>\n<hr>\n</body>\n</html>\n");	return S_OK;}/* To reduce redundant error handling code [calls to abort_conn_with_state()] * most of the function is build around conditions that will assign the error * code to @state if anything goes wrong. The rest of the function will then just * do the necessary cleanups. If all works out we end up with @state being S_OK * resulting in a cache entry being created with the fragment data generated by * either reading the file content or listing a directory. */voidfile_protocol_handler(struct connection *connection){	unsigned char *redirect_location = NULL;	struct string page, name;	enum connection_state state;	unsigned char *type = NULL;	if (get_cmd_opt_bool("anonymous")) {		/* FIXME: Better connection_state ;-) */		abort_conn_with_state(connection, S_BAD_URL);		return;	}#ifdef CONFIG_CGI	if (!execute_cgi(connection)) return;#endif /* CONFIG_CGI */	/* This function works on already simplified file-scheme URI pre-chewed	 * by transform_file_url(). By now, the function contains no hostname	 * part anymore, possibly relative path is converted to an absolute one	 * and uri->data is just the final path to file/dir we should try to	 * show. */	if (!init_string(&name)	    || !add_uri_to_string(&name, connection->uri, URI_PATH)) {		done_string(&name);		abort_conn_with_state(connection, S_OUT_OF_MEM);		return;	}	decode_uri_string(&name);	if (file_is_dir(name.source)) {		/* In order for global history and directory listing to		 * function properly the directory url must end with a		 * directory separator. */		if (name.source[0] && !dir_sep(name.source[name.length - 1])) {			redirect_location = "/";			state = S_OK;		} else {			state = list_directory(name.source, &page);			type = "text/html";		}	} else {		state = read_encoded_file(&name, &page);		/* FIXME: If state is now S_ENCODE_ERROR we should try loading		 * the file undecoded. --jonas */	}	done_string(&name);	if (state == S_OK) {		struct cache_entry *cached;		/* Try to add fragment data to the connection cache if either		 * file reading or directory listing worked out ok. */		cached = connection->cached = get_cache_entry(connection->uri);		if (!connection->cached) {			if (!redirect_location) done_string(&page);			state = S_OUT_OF_MEM;		} else if (redirect_location) {			if (!redirect_cache(cached, redirect_location, 1, 0))				state = S_OUT_OF_MEM;		} else {			if (!cached->content_type) {				unsigned char *ctype = null_or_stracpy(type);				/* Not so gracefully handle failed memory				 * allocation. */				if (type && !ctype)					state = S_OUT_OF_MEM;				else					cached->incomplete = 0;				/* Setup file read or directory listing for				 * viewing. */				mem_free_set(&cached->content_type, ctype);			} else {				cached->incomplete = 0;			}			add_fragment(cached, 0, page.source, page.length);			truncate_entry(cached, page.length, 1);			done_string(&page);		}	}	abort_conn_with_state(connection, state);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线| 91福利小视频| 色香蕉成人二区免费| 91精品国产高清一区二区三区 | 尤物在线观看一区| 国产综合色产在线精品| 欧美性大战久久久久久久| 国产亚洲欧洲一区高清在线观看| 亚洲最色的网站| 岛国精品在线观看| 精品福利二区三区| 午夜国产不卡在线观看视频| 99久久国产综合精品女不卡| 精品国产电影一区二区| 无码av免费一区二区三区试看| heyzo一本久久综合| 久久久久久久综合| 久久er精品视频| 欧美精品精品一区| 亚洲综合一二区| 91网址在线看| 亚洲欧洲国产日本综合| 国产91综合一区在线观看| 欧美电影免费观看高清完整版| 亚洲一区二区av电影| 色视频一区二区| 亚洲毛片av在线| 91在线精品秘密一区二区| 国产日韩成人精品| 国内成人精品2018免费看| 欧美大片顶级少妇| 国产一区二区主播在线| 精品久久久久香蕉网| 激情伊人五月天久久综合| 日韩三级av在线播放| 视频在线观看91| 欧美一区二区三区爱爱| 亚洲国产成人精品视频| 欧美日韩精品综合在线| 视频一区二区三区入口| 欧美大胆人体bbbb| 久久av老司机精品网站导航| 欧美电影免费观看高清完整版在线 | 成人美女视频在线看| 欧美激情一区二区| av亚洲产国偷v产偷v自拍| 亚洲欧洲精品天堂一级| 日本道色综合久久| 日韩高清不卡一区二区三区| 欧美变态tickling挠脚心| 国产综合久久久久影院| 国产精品色哟哟| 在线中文字幕一区| 日产国产高清一区二区三区| 2020国产精品久久精品美国| 国产成人精品影视| 1024成人网色www| 欧美综合亚洲图片综合区| 五月婷婷综合网| 精品久久久久久亚洲综合网| 粉嫩一区二区三区在线看| 亚洲美女屁股眼交3| 欧美肥胖老妇做爰| 国产成人精品午夜视频免费| 亚洲美女视频一区| 日韩欧美一区二区不卡| 成人av中文字幕| 视频一区视频二区在线观看| 国产清纯在线一区二区www| 色视频一区二区| 精品综合免费视频观看| 国产精品不卡在线观看| 欧美在线视频日韩| 国产精品一区二区黑丝| 艳妇臀荡乳欲伦亚洲一区| 欧美成人艳星乳罩| 色菇凉天天综合网| 极品销魂美女一区二区三区| 亚洲欧美激情小说另类| 欧美成人精品福利| 在线视频亚洲一区| 国产一区三区三区| 婷婷综合另类小说色区| 国产精品进线69影院| 日韩小视频在线观看专区| 91免费观看在线| 国产九色精品成人porny| 午夜欧美在线一二页| 国产精品毛片久久久久久| 欧美一区二区观看视频| 欧美性一区二区| 成人手机在线视频| 久久99九九99精品| 三级欧美韩日大片在线看| 亚洲人亚洲人成电影网站色| 国产亚洲精品精华液| 日韩亚洲欧美综合| 欧美电影在哪看比较好| 91久久香蕉国产日韩欧美9色| 国产精品99久久久久久似苏梦涵| 首页国产欧美久久| 亚洲小说春色综合另类电影| 综合欧美亚洲日本| 国产精品高潮久久久久无| 久久色.com| 日韩精品一区二区三区视频播放 | 美女被吸乳得到大胸91| 午夜久久电影网| 亚洲一区二区欧美日韩| 一区二区三区资源| 亚洲激情五月婷婷| 国产精品三级久久久久三级| 久久精品一区二区三区av| 亚洲精品一区二区三区精华液 | 久久影院视频免费| 日韩欧美的一区| 精品国产伦一区二区三区免费| 欧美日韩一区二区不卡| 在线观看欧美精品| 欧美日韩一区二区在线视频| 欧美日韩中文字幕一区二区| 欧美揉bbbbb揉bbbbb| 欧美二区在线观看| 日韩欧美国产综合| 精品国产精品网麻豆系列 | 欧美一区二区在线看| 欧美一区二区三区啪啪| 日韩一区二区免费高清| 久久一区二区视频| 国产三级精品在线| 综合久久久久综合| 亚洲sss视频在线视频| 日本午夜精品一区二区三区电影| 免费在线观看成人| 国产精品亚洲视频| 91老司机福利 在线| 欧美日韩精品欧美日韩精品一| 538在线一区二区精品国产| 日韩精品专区在线| 中文字幕欧美三区| 亚洲第一主播视频| 国产乱码精品一区二区三| 成人爱爱电影网址| 欧美日本韩国一区| 久久蜜桃一区二区| 亚洲嫩草精品久久| 青草av.久久免费一区| 国产成人综合网| 欧美在线免费观看视频| 日韩免费观看2025年上映的电影 | 欧美人伦禁忌dvd放荡欲情| 日韩一区二区三区免费观看 | 欧美一级高清片| 国产精品区一区二区三区| 亚洲一级在线观看| 国产不卡在线一区| 在线看日韩精品电影| 欧美r级在线观看| 中文字幕一区二区三区在线观看| 性做久久久久久免费观看| 国产一区二区三区视频在线播放| 91视频一区二区| 欧美mv日韩mv亚洲| 樱花影视一区二区| 国产呦精品一区二区三区网站| 日本道色综合久久| 国产欧美日韩在线观看| 日本欧美一区二区在线观看| av不卡一区二区三区| 欧美成人精品1314www| 亚洲一区在线视频| 成人一区二区三区| 欧美一级久久久| 亚洲一区二区美女| 99久久精品免费观看| 2021久久国产精品不只是精品 | 国产精品剧情在线亚洲| 麻豆精品一二三| 欧美午夜电影在线播放| 国产精品全国免费观看高清 | 麻豆国产一区二区| 欧美主播一区二区三区| 国产精品全国免费观看高清| 国内精品在线播放| 777a∨成人精品桃花网| 一区二区三区在线播| a美女胸又www黄视频久久| 国产偷v国产偷v亚洲高清| 美女脱光内衣内裤视频久久网站| 欧美午夜精品久久久久久超碰| 最新欧美精品一区二区三区| 国产精品538一区二区在线| 欧美成人r级一区二区三区| 香蕉av福利精品导航| 欧美视频三区在线播放| 伊人婷婷欧美激情| 色婷婷综合久久久久中文一区二区 | 一区二区三区小说| 91久久精品一区二区三区| 亚洲色图制服诱惑 |