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

521 Commits

Author SHA1 Message Date
Witold Filipczyk
e4b536f8ab [gopher] Nothing is easy as it seems. Refs #34 2019-05-13 12:46:44 +02:00
Witold Filipczyk
12b270e8d2 [gopher] Allow unix like line endings. Refs #34 2019-05-13 12:09:26 +02:00
Witold Filipczyk
3d23424b9f [gopher] Another try for #33.
This time replace /URL -> URL for h type.
2019-05-12 22:56:54 +02:00
Witold Filipczyk
41c3485add Revert "[gopher] Skip '/'. Refs #33"
This reverts commit 5106b31f6c.
2019-05-12 22:16:48 +02:00
Witold Filipczyk
5106b31f6c [gopher] Skip '/'. Refs #33 2019-05-05 16:18:29 +02:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Witold Filipczyk
d8be2c505e Rename struct box to struct el_box.
In the future I want to copy some code from netsurf, so I'm preparing.
2018-09-09 19:14:56 +02:00
Witold Filipczyk
442f4936dc Use blacklist to skip verification of certificates 2017-07-23 18:59:05 +02:00
Witold Filipczyk
2fc9b0bf5a Better handling of content-disposition (line without semicolon)
This time it was copied from links2.
2016-08-21 22:02:46 +02:00
Witold Filipczyk
ab63ee8f82 Revert "Fix saving files from speccy.pl archives"
This reverts commit 29d85fdb3b.
2016-08-21 18:22:33 +02:00
Witold Filipczyk
29d85fdb3b Fix saving files from speccy.pl archives 2016-05-28 17:58:17 +02:00
Pete Deas
e9152c8772 gopher: ensure slash after entity type in links
This prevents links with null selectors being interpreted as pointing to
a (likely non-existent) file gopher://server/1
An example of a page with such links: gopher://gopher.floodgap.com/1/new
2016-04-30 10:45:42 +02:00
Witold Filipczyk
257422f28c Reorganisation of code to make C++ happy 2016-04-20 22:21:31 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
8cf00fa61c delete -> delete_ for C++ compatibility 2016-04-20 18:57:32 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
Witold Filipczyk
aec900f2ae Flush decompression with len = 0
This is required by code in encoding/brotli.c.
2016-01-16 13:03:54 +01:00
Witold Filipczyk
6eba447e8a Experimental brotli encoding support.
https://github.com/bagder/libbrotli
2015-10-12 23:18:23 +02:00
Witold Filipczyk
b4adf0d70d Prefer gzip. 2015-08-22 11:22:58 +02:00
Witold Filipczyk
c84dfd7e18 mem_free_if where aplicable. Initialised memory in encoding/* 2015-05-10 17:27:55 +02:00
Witold Filipczyk
06f0dff43f expert is also proper suffix. 2015-01-02 13:53:10 +01:00
Witold Filipczyk
bdfb3ec754 bug 1145: The freecode.com successor has the URL "freecode.club" but "club"
is not recognized as a TLD. Patch by Dr. Markus Waldeck
2014-09-22 21:47:53 +02:00
Witold Filipczyk
7453b03279 deflate switched on again.
askubuntu.com uses deflate compression.
2014-09-01 12:50:23 +02:00
Witold Filipczyk
e7ebfa06c3 deflate is broken. 2014-09-01 12:19:49 +02:00
witekfl
4fc6343407 mem_free_if(data) instead of if (data) mem_free(data). Shorter. 2013-01-04 17:54:57 +01:00
witekfl
b0ea7cd7c1 decompress_data is now cleaner, isn't it? 2013-01-04 16:23:09 +01:00
witekfl
6fae43511c Call decompress_data only for compressed data.
Hope this is less missleading than before.
2013-01-04 16:00:50 +01:00
Kalle Olavi Niemitalo
642e164ec3 rewrite: update default dumb and smart prefixes
DELETED:

* dumb {b}, smart {bb, bb_fr_en, bb_en_fr}: Redirects to Microsoft
  Translator, which I can't get to work without JavaScript.  Deleted.

* dumb {pyhelp}, smart {py, pydev}: Deleted as recommended by the
  author of the CGI script.

* dumb {pyvault, lyrics}, smart {pyvault}: Can't find a new URL for the
  service.  Deleted.

* smart {gd}: Google Directory has been shut down.  Deleted.

* smart {sd, sdc, sdu, sdp, sdj, whatis}: These don't seem to work
  without JavaScript.  Deleted.

* smart {id, draft}: The search still exists but I can't get it to
  take the words from the URL.  Deleted.

UPDATED:

* dumb {cia}: Had changed its URL, and the service is down, but they
  intend to restore it.  Updated and kept.

* dumb {lua}: ELinks no longer supports Lua 4.0.  Changed to 5.1 as
  installed by Debian.

* smart {cliki, foldoc, gwho, gwhat, gwhere, gwhen, a, imdb, wn, fsd,
  rfcs, cr}: Updated URLs.
2012-11-30 09:24:53 +02:00
Kalle Olavi Niemitalo
90d7c11f28 doxygen: Escape <uri> in doc of bittorrent_download
Doxygen warned that <uri> is an unsupported xml/html tag.
It was not intended as a tag though; rather as a placeholder
akin to <var>uri</var>.  Escape with a backslash.
2012-11-18 20:16:59 +02:00
Kalle Olavi Niemitalo
6628a3f477 parse_header: document parameters and return value 2012-11-18 17:36:36 +02:00
Kalle Olavi Niemitalo
0386a3e14b parse_header: make the 2nd parameter point to const
In almost all calls to parse_header, the second argument is a string
literal: parse_header(head, "Charset", NULL) for example.
Of course, parse_header does not write to that string.  Accordingly,
make the parameter point to const, so calls that use a variable rather
than a string literal can make that variable point to const too.

Leaving the other parameters non-const for now.
2012-11-18 16:39:04 +02:00
Kalle Olavi Niemitalo
ed6a33d318 http_negotiate: Fix int* vs. size_t* type mismatch
http_negotiate_parse_data passed &token->length as the int *outlen
parameter of base64_decode_bin, which stores an int at that location.
However, gss_buffer_desc::length is size_t in all implementations that
I checked: MIT Kerberos Version 5 Release 1.10, libgssglue 0.4, and
GNU GSS 1.0.2.  This mismatch could cause the build to fail:

.../src/protocol/http/http_negotiate.c: In function ‘http_negotiate_parse_data’:
.../src/protocol/http/http_negotiate.c:173:2: error: passing argument 3 of ‘base64_decode_bin’ from incompatible pointer type [-Werror]
In file included from .../src/protocol/http/http_negotiate.c:30:0:
.../src/util/base64.h:8:16: note: expected ‘int *’ but argument is of type ‘size_t *’

On 64-bit big-endian hosts, it might also cause the GSSAPI
implementation to read too much data from memory and disclose it to
some network server, or crash ELinks.
(cherry picked from elinks-0.12 commit d33c807dd9)
2012-11-03 23:01:29 +02:00
Kamil Dudka
5e113362da http_negotiate: do not delegate GSSAPI credentials
CVE-2012-4545.  Reported by Marko Myllynen.
(cherry picked from elinks-0.12 commit da18694ff7)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
8b00e1ef70 bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member.  On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least.  OPT_LONG however tended to work right.

This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.

So here's a rather more invasive solution.  Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions.  Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.

In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee2)

Conflicts:
	src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
	src/protocol/smb/smb2.c: Ditto.
2012-11-03 22:16:32 +02:00
Kamil Dudka
a96d8a17e5 rewrite: add default "ddg" dumb/smart prefixes for DuckDuckGo
... and mention that URI rewriting rules may leak ELinks' identity
in the documentation of protocol.http.user_agent.

Originally requested at <https://bugzilla.redhat.com/856348>.
2012-10-05 14:05:13 +02:00
witekfl
71bd75f759 Avoid a warning when gzip, bzip2 nor lzma is compiled-in. 2012-08-08 22:36:21 +02:00
witekfl
a556fba1d2 Label bad was unused without fork. 2012-08-08 22:31:05 +02:00
witekfl
bebde69507 Compilation fixes for Mingw32.
* check if fork is available
* use set_nonblocking_fd
2012-05-25 16:13:25 +02:00
Miciah Dashiel Butler Masters
f8bdc3ca9e read_http_post_inline: fix assertion-failed message
read_http_post_inline decodes two hexadecimal digits into one byte at
a time, and it asserts that each hexadecimal digit is valid; however,
both assertions print the first digit when they fail.  Fix the assertion
on the second digit to print the second digit.
2011-11-14 04:34:50 +00:00
witekfl
0e5822edae Memorize the auth form only when the "document.browse.forms.show_formhist" is on. 2011-10-06 10:54:11 +02:00
witekfl
ddc0d8d7be Use formhist for 401 Unauthorized and others. 2011-10-05 22:42:41 +02:00
Petr Baudis
9a001f051a Remove variables that were set but not used
Required to make new gcc with default warning settings happy.
2011-09-24 02:25:51 +02:00
Petr Baudis
69a226eba1 find_clonable_bittorrent_peer_request(): Remove likely wrong inner clone declaration 2011-09-24 02:21:59 +02:00
witekfl
9cb170f97f ftp: Get filesize from SIZE command instead of guess it from RETR command. 2011-03-22 17:51:13 +01:00
Witold Filipczyk
7933724dc8 Removed code using pipes for decompression and simplified decompress_data.
Workarounds for sites, which send incorrect data, probably won't work.
2010-09-24 16:12:35 +02:00
Witold Filipczyk
f93d5ccd80 Revert "strcpy -> strlcpy."
This reverts commit 365cbb61be.
There is no strlcpy in libc.
2010-09-19 15:26:05 +02:00