1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00
Commit Graph

3074 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
6c2e8cd7b2 Bug 1013: Don't assume errno is between 0 and 100000
Replace almost all uses of enum connection_state with struct
connection_status.  This removes the assumption that errno values used
by the system are between 0 and 100000.  The GNU Hurd uses values like
ENOENT = 0x40000002 and EMIG_SERVER_DIED = -308.

This commit is derived from my attachments 450 and 467 to bug 1013.
2008-08-03 17:56:41 +03:00
Kalle Olavi Niemitalo
40715ffbd4 Import and use AsciiDoc 7.1.2 configuration files
In the past, we have hit annoying incompatibilities when
people have attempted to rebuild ELinks documentation
with new versions of AsciiDoc:

http://bugzilla.elinks.cz/show_bug.cgi?id=989
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491820

So now we bundle the configuration files from a known good version
to let ELinks documentation be built with them regardless of which
version has been installed on the machine.
2008-08-02 11:28:24 +03:00
Kalle Olavi Niemitalo
e019038c17 When checking for <net/if.h>, #include <sys/socket.h> first.
On Mac OS X 10.5.4, <net/if.h> does not #include <sys/socket.h> but
uses struct sockaddr defined there.  Autoconf 2.61 generates a
configure script that warns if the header can be preprocessed but not
compiled.  The Autoconf manual cautions that future versions of
Autoconf will treat the file as missing in this case.  To let ELinks
detect <net/if.h> even with a future Autoconf, make the test program
#include <sys/socket.h> before <net/if.h>.
2008-08-01 00:40:34 +03:00
Kalle Olavi Niemitalo
abe4927d69 1022: NEWS and option documentation 2008-07-27 20:11:39 +03:00
Witold Filipczyk
2e1983ce93 1022: Fixes issue with mbank.
New patch, fixes issue with mbank's certificate verification.
2008-07-27 17:15:36 +03:00
Kalle Olavi Niemitalo
a83ff1f565 1040: Blacklist servers that support SSL3 but not TLS1.
It seems GnuTLS is not as good at negotiating a supported protocol as
OpenSSL is.  ELinks tries to work around that by retrying with a
different protocol if the SSL library reports an error.  However,
ELinks must not automatically retry POST requests where some data may
have already reached the server; POST is not a safe method in HTTP.
So instead, collect the name of the TLS-incapable server in a blacklist
when ELinks e.g. loads an HTML form from it; the actual POST can then
immediately use the protocol that worked.

It's a bit ugly that src/network/socket.c now uses
protocol/http/blacklist.h.  It might be better to move the blacklist
files out of the http directory, and perhaps merge them with the
BitTorrent blacklisting code.
2008-07-27 01:39:01 +03:00
Jonas Fonseca
5ef63a5d01 Drop unneeded include.
(cherry picked from commit fe7c163c45f32800632939b8d161844deb9a8465)
2008-07-26 15:57:20 +03:00
Kalle Olavi Niemitalo
f45ceff50d NEWS: bug 698 fixed in 0.11.4.GIT too 2008-07-26 12:33:48 +03:00
Kalle Olavi Niemitalo
6b9be71150 1018: Avoid assertion failure in SELECT pop-up for non-current tab
Check in refresh_view() whether the tab is still current; if not, skip
the draw_doc() and draw_frames() calls because draw_current_link()
called within them asserts that the tab is current.  However, do
always call print_screen_status(), because that handles non-current
tabs correctly too.

I think it was not yet possible to trigger the assertion failure with
setTimeout, because input.value modifications by ECMAScript do not
trigger a redraw (bug 1035).
2008-07-22 12:13:27 +03:00
Witold Filipczyk
7116daf43e 1038: Remove remembering last 8 URLs. It did not work.
Enable the rate limiting of opening new windows in SEE
to be consistent with SpiderMonkey.
Fixed a possible memleak (the frame variable).
2008-07-21 00:39:30 +03:00
Kalle Olavi Niemitalo
327fc1e46e 1034: NEWS, comments, and tests 2008-07-20 14:34:12 +03:00
Kalle Olavi Niemitalo
b9d48ad7e8 1034: Initialize l in deflate_read to shut up GCC
Avoid this warning:

      [CC]   src/encoding/deflate.o
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.12/src/encoding/deflate.c: In function ‘deflate_read’:
/home/Kalle/src/elinks-0.12/src/encoding/deflate.c:96: warning: ‘l’ may be used uninitialized in this function
2008-07-20 14:34:11 +03:00
Witold Filipczyk
e213a91bad 1034: Fixed deflate decompression.
First try decompress in zlib format.
If this fails, restart with the raw deflate.
Works for both blogs.msdn.com and for URL of the bug 1034.
2008-07-20 13:58:11 +03:00
Kalle Olavi Niemitalo
83ccaa3673 Bug 698: Keep forms contiguous and non-overlapping and start from 0.
In document.forms, each struct form has form_num and form_end members
that reserve a subrange of [0, INT_MAX] to that form.  Previously,
multiple forms in the list could have form_end == INT_MAX and thus
overlap each other.  Prevent that by adjusting form_end of each form
newly added to the list.

Revert 438f039bda,
"check_html_form_hierarchy: Old code was buggy.", which made
check_html_form_hierarchy attach controls to the wrong forms.
Instead, construct the dummy form ("for those Flying Dutchmans") at
form_num == 0 always before adding any real forms to the list.
This prevents the assertion failure by ensuring that every possible
form_control.position is covered by some form, if there are any forms.

Add a function assert_forms_list_ok, which checks that the set of
forms actually covers the [0, INT_MAX] range without overlapping,
as intended.  Call that from check_html_form_hierarchy to detect
any corruption.

I have tested this code (before any cherry-picking) with:
- bug 613 attachment 210: didn't crash
- bug 714 attachment 471: didn't crash
- bug 961 attachment 382: didn't crash
- bug 698 attachment 239: all the submit buttons showed the right URLs
- bug 698 attachment 470: the submit button showed the right URL

(cherry picked from commit 386a5d517b)
2008-07-20 11:46:01 +03:00
Kalle Olavi Niemitalo
85bfba4530 SEE: Do not check thisobj->objectclass in window functions.
init_js_window_object() copies the alert, open, and setTimeout methods
from the window object to the global object.  My fix for bug 846 on
2006-12-10 incorrectly made the corresponding C functions refuse to
work if they were not called as methods of the window object.
2008-07-20 09:26:52 +03:00
Kalle Olavi Niemitalo
39a5d68447 952, 954: Describe in NEWS. 2008-07-19 14:58:11 +03:00
Kalle Olavi Niemitalo
ae8080b172 952, 954: Finalize form_view.ecmascript_obj for SEE 2008-07-19 14:58:11 +03:00
Kalle Olavi Niemitalo
c81e2051f8 952, 954: Finalize form_state.ecmascript_obj for SEE 2008-07-19 14:58:11 +03:00
Kalle Olavi Niemitalo
f4213ac350 952, 954: Finalize form_view.ecmascript_obj for SpiderMonkey 2008-07-19 14:58:07 +03:00
Kalle Olavi Niemitalo
2d49f6e9cd 952, 954: Finalize form_state.ecmascript_obj for SpiderMonkey
JSObject instances of input_class now again contain a private pointer
directly to struct form_state.  This pointer is cleared or updated
when appropriate.
2008-07-19 14:57:25 +03:00
Kalle Olavi Niemitalo
759fbb1142 952, 954: Add ecmascript_detach_form_view stub
Anything that frees struct form_view must now call the new function
ecmascript_detach_form_view.  This function should then clear out any
dangling pointers, but that has not yet been implemented.
2008-07-18 20:00:16 +03:00
Kalle Olavi Niemitalo
bbadb99dd1 952, 954: Add ecmascript_{detach,moved}_form_state stubs
Anything that frees or reallocates struct form_state must now call the
new functions ecmascript_detach_form_state or ecmascript_moved_form_state.
These functions should then clear out any dangling pointers, but that has
not yet been implemented.
2008-07-18 19:56:49 +03:00
Kalle Olavi Niemitalo
8f2f9e7265 952, 954: Add spidermonkey_empty_context 2008-07-18 19:24:29 +03:00
Kalle Olavi Niemitalo
5ad675e244 Remove my comment about prefixes used with SpiderMonkey 2008-07-18 19:01:48 +03:00
Kalle Olavi Niemitalo
887a751441 1033: Mention in NEWS. 2008-07-16 17:15:12 +03:00
Witold Filipczyk
e9f3a4a9d3 1033: Fixed memory leak in open(...). 2008-07-16 16:38:50 +03:00
Kalle Olavi Niemitalo
2668602edc 1031: Mention in NEWS. 2008-07-16 14:55:31 +03:00
Kalle Olavi Niemitalo
031c1e6143 1031: Replace jsrt with spidermonkey_runtime
src/ecmascript/spidermonkey/ now uses a JSRuntime managed by
spidermonkey-shared.c.
2008-07-16 14:50:41 +03:00
Kalle Olavi Niemitalo
2024ea610b 1031: Replace smjs_rt with spidermonkey_runtime
src/scripting/smjs/ now uses a JSRuntime managed by spidermonkey-shared.c.
2008-07-16 14:28:22 +03:00
Kalle Olavi Niemitalo
32889bf908 1031: Add spidermonkey-shared.c used for both web and user scripts
Rename src/ecmascript/spidermonkey/util.c to
src/ecmascript/spidermonkey-shared.c and compile it also when
CONFIG_SCRIPTING_SMJS is enabled but CONFIG_ECMASCRIPT_SPIDERMONKEY is
not.  Then use its functions from src/scripting/smjs/ too.  Move the
corresponding declarations, as well as the inline functions needed by
src/scripting/smjs/, from src/ecmascript/spidermonkey/util.h to
src/ecmascript/spidermonkey-shared.h.

ELinks is nowadays using two JSRuntimes and SpiderMonkey has bugs that
make it crash in such use.  To work around them, ELinks will need to
be changed to use only one JSRuntime.  I am planning to define and
initialize that JSRuntime in src/ecmascript/spidermonkey-shared.c,
now that it's compiled whenever either of the modules is enabled.
2008-07-16 12:32:24 +03:00
Kalle Olavi Niemitalo
f479d6e82a Explain in config.h.in what a hack _ALLOCA_H is 2008-07-15 22:53:26 +03:00
Witold Filipczyk
37ce1ca658 Here is a patch, which adds support for tcc's alloca. 2008-07-15 22:28:01 +03:00
Kalle Olavi Niemitalo
e9d4d3aef2 Fix crash after a tab was opened during reload.
Commit 0b99fa70ca "Bug 620: Reset form
fields to default values on reload" made render_document() decrement
vs->form_info_len to 0 while vs->form_info remained non-NULL.
copy_vs() then copied the whole structure with copy_struct and did not
change form_info because form_info_len was 0.  Both view_state
structures had form_info pointing to the same memory block, causing a
segfault when destroy_vs() tried to free that block a second time.

Reported by أحمد المحمودي.
2008-07-15 11:43:03 +03:00
Kalle Olavi Niemitalo
6b05cdb3a0 1030: List the bug in NEWS.
(cherry picked from commit 295c7760f7)
2008-07-14 22:38:52 +03:00
Kalle Olavi Niemitalo
e287ca9265 1030: Wrap get_search_region_from_search_nodes in #ifdef HAVE_REGEX_H
This change avoids the following error:

gcc -DHAVE_CONFIG_H -I../../.. -I/home/Kalle/src/elinks-0.11/src -I/home/Kalle/prefix/include -I/usr/include/smjs -I/usr/include -I/usr/include/lua50 -I/usr/include -I/usr/include -O0 -ggdb -Wall -Wall -Werror -fno-strict-aliasing -Wno-pointer-sign -Wno-address -fno-strict-overflow -o search.o -c /home/Kalle/src/elinks-0.11/src/viewer/text/search.c
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.11/src/viewer/text/search.c:257: warning: 'get_search_region_from_search_nodes' defined but not used
make[3]: *** [search.o] Error 1
make[3]: Leaving directory `/home/Kalle/build/i686-pc-linux-gnu/elinks-0.11/src/viewer/text'

get_search_region_from_search_nodes is called only from
search_for_pattern, which already was inside #ifdef HAVE_REGEX_H.
(cherry picked from commit 2aec302d47)
2008-07-14 22:38:08 +03:00
Witold Filipczyk
e83f76b79e 1030: Fixed issue with undefined HAVE_REGEX_H.
(cherry picked from commit 442b0d83b0)
2008-07-14 22:36:52 +03:00
Jonas Fonseca
46e76e0688 Minor documentation improvements 2008-07-13 15:25:41 +02:00
Kalle Olavi Niemitalo
ddd36cafb4 Bug 1029: List in NEWS. 2008-07-12 01:59:18 +03:00
Kalle Olavi Niemitalo
c5a012eca5 Bug 1029: Use JS_CallFunctionValue in keybinding.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["\""] = function() {
    elinks.keymaps.main["e"] = function() {
	elinks.alert("hello!");
    };
}
2008-07-12 01:54:49 +03:00
Kalle Olavi Niemitalo
e3830cfd67 Bug 1029: Use JS_CallFunctionValue in elinks_object.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

function set_suffix(suffix) {
    elinks.preformat_html = function(cached, vs) {
	cached.content += suffix;
    }
}
set_suffix("hello");
2008-07-12 01:49:08 +03:00
Kalle Olavi Niemitalo
079b97d21b Bug 1026: Protect callback of elinks.load_uri from GC 2008-07-12 01:37:51 +03:00
Kalle Olavi Niemitalo
b2c387f1f4 Bug 1029: Use JS_CallFunctionValue in load_uri.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["!"] = function() {
    elinks.load_uri("http://www.eldar.org/cgi-bin/fortune.pl?text_format=yes",
		    function (cached) { elinks.alert(cached.content); });
}
2008-07-12 01:24:51 +03:00
Kalle Olavi Niemitalo
12bb8fdfe7 NEWS: sync from 0.11.4.GIT
http://elinks.cz/release.html is generated from NEWS of elinks-0.12;
thus we should have all the news of 0.11.4.GIT here too.
2008-07-11 22:22:27 +03:00
Kalle Olavi Niemitalo
4649d0ccba Bug 951 should not be removed from NEWS before 0.12.0.
That's because the bug was in 0.11.4 as well.
2008-07-11 19:09:07 +03:00
Kalle Olavi Niemitalo
fd27acf784 Bug 1027, SMJS: make null mean "none" in elinks.keymaps
elinks.keymaps.main["/"] = null;
used to crash ELinks with a segfault in JS_ObjectIsFunction.
Fix that by recognizing JSVAL_NULL explicitly and treating it as "none".
Likewise, if keymap_get_property would return "none" to ECMAScript,
return JSVAL_NULL instead.
2008-07-11 17:08:35 +03:00
Kalle Olavi Niemitalo
5251441fdc doc/smjs-scripting: add version info, rephrase risk 2008-07-10 21:11:45 +03:00
Kalle Olavi Niemitalo
9954d37a68 Move most of contrib/smjs/README into the manual.
Also document elinks.vs and elinks.action.

<kahmalo> Miciah: IMO most of contrib/smjs/README should be moved into
    the ELinks manual.  Specifically the parts that do not depend on
    contrib/smjs/hooks.js.  However manual.txt contains a notice:
    "Hold blameless the authors.  Any lawful use is allowed."  Will
    you allow that also for what is now in contrib/smjs/README?
<Miciah> Absolutely.
<Miciah> In fact, I would allow some lawless uses.
<Miciah> It seems a little silly to say that lawful uses are allowed.
2008-07-10 20:31:22 +03:00
Kalle Olavi Niemitalo
8ee5e8c4a1 Bug 951: Revert "Garbage-collect SMJS objects before flushing caches."
This reverts commit c33d195ff4.
ELinks no longer needs to collect garbage in this situation
because it can now free cache entries even if the corresponding
SMJS objects remain.
2008-07-08 15:21:07 +03:00
Kalle Olavi Niemitalo
06c39a8ac4 Bug 951: Lock the cache entry while the hook runs. 2008-07-08 15:20:38 +03:00
Kalle Olavi Niemitalo
314a41588c Bug 951: weaken pointer from JSObject to cache_entry
The SpiderMonkey scripting module handles the "pre-format-html" event
by constructing a JSObject for the struct cache_entry and then calling
elinks.preformat_html(cache_entry, view_state) if such a function
exists.  The problem with this was that each such JSObject kept the
struct cache_entry locked until SpiderMonkey garbage-collected the
JSObject, even if the user had not defined an elinks.preformat_html
function and the JSObject was thus never needed at all.  To work
around that, the SpiderMonkey scripting module ran a garbage
collection whenever the user told ELinks to flush caches.

Remove the SpiderMonkey scripting module's use of object_lock and
object_unlock on struct cache_entry, and instead make the pointers
weak so that ELinks can free the cache_entry whenever it wants even if
a JSObject is pointing to it.  Each cache_entry now has a pointer back
to the JSObject; done_cache_entry calls smjs_detach_cache_entry_object,
which follows the pointer and detaches the cache_entry and the JSObject
from each other.

This commit does not yet remove the workaround mentioned above.
2008-07-07 23:24:43 +03:00