1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

Merge branch 'elinks-0.12' into elinks-0.13

This commit is contained in:
Kalle Olavi Niemitalo 2008-03-01 17:28:37 +02:00 committed by Kalle Olavi Niemitalo
commit af9ed54c0f
21 changed files with 119 additions and 61 deletions

View File

@ -54,7 +54,7 @@ ASCIIDOC_FLAGS = @ASCIIDOC_FLAGS@
AWK = @AWK@
CATALOGS = @CATALOGS@
CC = @CC@
CG_COMMIT_ID = @CG_COMMIT_ID@
GIT = @GIT@
CONFDIR = @CONFDIR@
DOXYGEN = @DOXYGEN@
GLIBC21 = @GLIBC21@

2
NEWS
View File

@ -321,6 +321,8 @@ To be released as 0.11.4.
* critical bugs 613, 714, 961: ``assertion list_empty(form_controls)
failed''
* critical bug 945: don't crash if a Lua script calls e.g. error(nil)
* critical bug 1003: don't crash if a smart URI rewrite template gets
too few parameters
* major bug 956: don't reuse pointers to SpiderMonkey objects that may
have been collected as garbage. This fix causes bug 954.
* CVE-2007-2027: check if the program path contains "src/" before

View File

@ -61,7 +61,7 @@ AC_PATH_PROGS(AWK, "$AWK")
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id")
AC_PATH_PROGS(GIT, "git")
AC_PATH_PROGS(SPARSE, "sparse")
CONFIG_ASCIIDOC="no"

View File

@ -17,4 +17,4 @@ Description: advanced text-mode WWW browser
language, IPV6 and has many other features. ELinks is linked against
GNUTLS to prevent license issues.
.
Homepage: http://elinks.or.cz/
Homepage: http://elinks.cz/

View File

@ -1,7 +1,7 @@
This package was debianized by Peter Gervai <grin@tolna.net> on
Mon, 29 Nov 1999 12:16:46 +0100.
It was downloaded from http://elinks.or.cz/
It was downloaded from http://elinks.cz/
Upstream Author: Petr Baudis <pasky@ucw.cz>

View File

@ -4,8 +4,8 @@ version=2
# Line continuations are performed with \
# The master download directory
http://elinks.or.cz/download/elinks-([\d]+.*).tar.bz2
http://elinks.cz/download/elinks-([\d]+.*).tar.bz2
# This is a variant HTTP format with more possibilities:
# Homepage Pattern [Version [Action]]
#http://elinks.or.cz/download/ elinks-([\d]+.*).tar.bz2 debian uupdate
#http://elinks.cz/download/ elinks-([\d]+.*).tar.bz2 debian uupdate

View File

@ -19,6 +19,8 @@ cd "$GIT_DIR"
echo "[grafthistory] Downloading the history"
mkdir -p objects/pack
cd objects/pack
echo "ELinks history converted from CVS. Keep this pack separate to speed up git gc." \
> pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.keep
# pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx is 3163784 bytes long.
# Downloading it takes less than 6 seconds here, whereas generating it
# with git index-pack takes over 4 minutes (750 MHz Duron, git 1.5.4.1).

View File

@ -39,7 +39,7 @@ h1 {
color: lightgoldenrod !important;
}
/* The following specifies colors used in the HTML highligting. */
/* The following specifies colors used in the HTML highlighting. */
document { color: yellow }
element { color: lightgreen }
entity-reference { color: red }

View File

@ -28,6 +28,13 @@ squote=@squote@
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
# No interlinking between elinks manpages
[otherman-inlinemacro]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
# For manpages use less verbose linking
ifdef::doctype-manpage[]
[link-inlinemacro]
@ -54,7 +61,9 @@ squote='
# Use the man:[] macro to link between elinks manpages
[man-inlinemacro]
{eval:re.match("elinks", "{target}") != None}<a href="{target}.{0}.html">{target}({0})</a>
{eval:re.match("elinks", "{target}") == None}<b>{target}({0})</b>
<a href="{target}.{0}.html">{target}({0})</a>
[otherman-inlinemacro]
<b>{target}({0})</b>
endif::backend-xhtml11[]

View File

@ -78,7 +78,7 @@ HOME::
WWW_HOME::
Homepage location (as in man:lynx[1]).
Homepage location (as in otherman:lynx[1]).
FILES
-----
@ -167,8 +167,8 @@ was done by Jonas Fonseca mailto:fonseca@diku.dk[].
SEE ALSO
--------
man:elinkskeys[5], man:elinks.conf[5], man:links[1], man:lynx[1], man:w3m[1],
man:wget[1]
man:elinkskeys[5], man:elinks.conf[5], otherman:links[1], otherman:lynx[1],
otherman:w3m[1], otherman:wget[1]
////////////////////////////////////////////////////////////////////////////
# vim: tabstop=4 shiftwidth=4 textwidth=76

View File

@ -211,7 +211,8 @@ CONFIG_BZIP2=yes
#
# To use this, first install http://tukaani.org/lzma/[LZMA Utils].
# Version 4.32.5 works; 4.42.2alpha also works and understands a
# newer LZMA file format. ELinks cannot use LZMA SDK from 7-Zip.
# newer LZMA file format. This version of ELinks does not support
# LZMA SDK from 7-Zip.
#
# Default: enabled if the library is installed

View File

@ -28,8 +28,10 @@ SUBDIRS = \
viewer
# Get the GIT HEAD ID if possible
ifdef CG_COMMIT_ID
BUILD_ID=$(shell GIT_DIR=$(top_srcdir)/.git $(CG_COMMIT_ID) 2> /dev/null)
ifdef GIT
GITDESC = $(shell $(GIT) --git-dir=$(top_srcdir)/.git rev-parse HEAD 2>/dev/null)
WTDIRTY = $(shell cd "$(top_srcdir)" && $(GIT) diff-index HEAD 2>/dev/null)
BUILD_ID = $(subst elinks-,,$(GITDESC))$(if $(WTDIRTY),-dirty)
endif
INCLUDES += -DBUILD_ID="\"$(BUILD_ID)\""

View File

@ -38,7 +38,7 @@ struct deflate_enc_data {
};
static int
deflate_open(struct stream_encoded *stream, int fd)
deflate_open(int window_size, struct stream_encoded *stream, int fd)
{
/* A zero-initialized z_stream. The compiler ensures that all
* pointer members in it are null. (Can't do this with memset
@ -60,7 +60,7 @@ deflate_open(struct stream_encoded *stream, int fd)
data->fdread = fd;
data->last_read = 0;
err = inflateInit2(&data->deflate_stream, MAX_WBITS | 32);
err = inflateInit2(&data->deflate_stream, window_size);
if (err != Z_OK) {
mem_free(data);
return -1;
@ -70,6 +70,20 @@ deflate_open(struct stream_encoded *stream, int fd)
return 0;
}
static int
deflate_raw_open(struct stream_encoded *stream, int fd)
{
/* raw DEFLATE with neither zlib nor gzip header */
return deflate_open(-MAX_WBITS, stream, fd);
}
static int
deflate_gzip_open(struct stream_encoded *stream, int fd)
{
/* detect gzip header, else assume zlib header */
return deflate_open(MAX_WBITS + 32, stream, fd);
}
static int
deflate_read(struct stream_encoded *stream, unsigned char *buf, int len)
{
@ -117,7 +131,7 @@ deflate_read(struct stream_encoded *stream, unsigned char *buf, int len)
}
static unsigned char *
deflate_decode_buffer(unsigned char *data, int len, int *new_len)
deflate_decode_buffer(int window_size, unsigned char *data, int len, int *new_len)
{
z_stream stream;
unsigned char *buffer = NULL;
@ -130,7 +144,7 @@ deflate_decode_buffer(unsigned char *data, int len, int *new_len)
stream.next_in = data;
stream.avail_in = len;
if (inflateInit2(&stream, MAX_WBITS | 32) != Z_OK)
if (inflateInit2(&stream, window_size) != Z_OK)
return NULL;
do {
@ -165,6 +179,20 @@ deflate_decode_buffer(unsigned char *data, int len, int *new_len)
}
}
static unsigned char *
deflate_raw_decode_buffer(unsigned char *data, int len, int *new_len)
{
/* raw DEFLATE with neither zlib nor gzip header */
return deflate_decode_buffer(-MAX_WBITS, data, len, new_len);
}
static unsigned char *
deflate_gzip_decode_buffer(unsigned char *data, int len, int *new_len)
{
/* detect gzip header, else assume zlib header */
return deflate_decode_buffer(MAX_WBITS + 32, data, len, new_len);
}
static void
deflate_close(struct stream_encoded *stream)
{
@ -183,9 +211,9 @@ static const unsigned char *const deflate_extensions[] = { NULL };
const struct decoding_backend deflate_decoding_backend = {
"deflate",
deflate_extensions,
deflate_open,
deflate_raw_open,
deflate_read,
deflate_decode_buffer,
deflate_raw_decode_buffer,
deflate_close,
};
@ -194,8 +222,8 @@ static const unsigned char *const gzip_extensions[] = { ".gz", ".tgz", NULL };
const struct decoding_backend gzip_decoding_backend = {
"gzip",
gzip_extensions,
deflate_open,
deflate_gzip_open,
deflate_read,
deflate_decode_buffer,
deflate_gzip_decode_buffer,
deflate_close,
};

View File

@ -344,30 +344,3 @@ read_encoded_file(struct string *filename, struct string *page)
close(fd);
return state;
}
void
accept_encoding_header(struct string *header)
{
#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) || defined(CONFIG_LZMA)
int comma = 0;
add_to_string(header, "Accept-Encoding: ");
#ifdef CONFIG_BZIP2
add_to_string(header, "bzip2");
comma = 1;
#endif
#ifdef CONFIG_GZIP
if (comma) add_to_string(header, ", ");
add_to_string(header, "deflate, gzip");
comma = 1;
#endif
#ifdef CONFIG_LZMA
if (comma) add_to_string(header, ", ");
add_to_string(header, "lzma");
#endif
add_crlf_to_string(header);
#endif
}

View File

@ -45,6 +45,4 @@ read_file(struct stream_encoded *stream, int readsize, struct string *page);
/* Reads the file with the given @filename into the string @source. */
enum connection_state read_encoded_file(struct string *filename, struct string *source);
void accept_encoding_header(struct string *header);
#endif

View File

@ -128,6 +128,7 @@ parse_time(const unsigned char **time, struct tm *tm, unsigned char *end)
tm->tm_hour = (h1 - '0') * 10 + h2 - '0';
tm->tm_min = (m1 - '0') * 10 + m2 - '0';
tm->tm_sec = 0;
/* Eat :SS or [PA]M or nothing */
if (end && date + 2 >= end) {

View File

@ -20,7 +20,6 @@ main(int argc, char *argv[])
{
struct ftp_file_info ftp_info = INIT_FTP_FILE_INFO;
unsigned char *response = "";
int responselen = 0;
int i;
for (i = 1; i < argc; i++) {
@ -33,18 +32,30 @@ main(int argc, char *argv[])
if (get_test_opt(&arg, "response", &i, argc, argv, "a string")) {
response = arg;
responselen = strlen(response);
} else {
die("Unknown argument '%s'", arg - 2);
}
}
if (!responselen)
if (!*response)
die("Usage: %s --response \"string\"", argv[0]);
if (parse_ftp_file_info(&ftp_info, response, responselen))
return 0;
while (*response) {
unsigned char *start = response;
return 1;
response = strchr(response, '\n');
if (!response) {
response = start + strlen(start);
} else {
if (response > start && response[-1] == '\r')
response[-1] = 0;
*response++ = 0;
}
if (!parse_ftp_file_info(&ftp_info, start, strlen(start)))
return 1;
}
return 0;
}

View File

@ -346,7 +346,7 @@ parse_ftp_unix_response(struct ftp_file_info *info, unsigned char *src, int len)
break;
}
pos = memchr(pos, ' ', end - pos);
pos = memchr(pos + 1, ' ', end - pos);
}
if (!info->symlink.source)

View File

@ -61,6 +61,11 @@ test_ftp_response_expect_success \
"
-rwxrwxrwx 1 noone nogroup 322 Aug 19 1996 message.ftp\r\n"
test_ftp_response_expect_success \
'Response from FreeBSD with symbolic link' \
"
lrwxrwx--x 1 110 1002 13 Oct 24 2006 5.3 has moved to ftp-archive -> ../README.TXT\r\n"
test_ftp_response_expect_success \
'Response from NetWare' \
"

View File

@ -23,7 +23,6 @@
#include "cache/cache.h"
#include "config/options.h"
#include "cookies/cookies.h"
#include "encoding/encoding.h"
#include "intl/charsets.h"
#include "intl/gettext/libintl.h"
#include "main/module.h"
@ -561,6 +560,33 @@ init_http_connection_info(struct connection *conn, int major, int minor, int clo
return http;
}
static void
accept_encoding_header(struct string *header)
{
#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) || defined(CONFIG_LZMA)
int comma = 0;
add_to_string(header, "Accept-Encoding: ");
#ifdef CONFIG_BZIP2
add_to_string(header, "bzip2");
comma = 1;
#endif
#ifdef CONFIG_GZIP
if (comma) add_to_string(header, ", ");
add_to_string(header, "deflate, gzip");
comma = 1;
#endif
#ifdef CONFIG_LZMA
if (comma) add_to_string(header, ", ");
add_to_string(header, "lzma");
#endif
add_crlf_to_string(header);
#endif
}
static void
http_send_header(struct socket *socket)
{

View File

@ -289,7 +289,7 @@ rewrite_uri(unsigned char *url, struct uri *current_uri, unsigned char *arg)
case '8':
case '9':
value = *url - '0';
if (value > argc) break;
if (value >= argc) break;
encode_uri_string(&n, args[value],
argslen[value], 1);
break;