Commit Graph

1478 Commits

Author SHA1 Message Date
Daniel Silverstone
3c4652c1c3
Dukky: Upgrade dukky binding to support new heap/thread split
Update the duktape bindings and dukky interface to support the
new JS heap/thread split.  Heaps may have multiple active threads
though in general there will only be 2 at a time.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-03-21 20:01:38 +00:00
Daniel Silverstone
337082f715
JS: Add concept of thread destroy
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-03-21 18:57:57 +00:00
Daniel Silverstone
17b28e85c1
JS: Split concept of JS context into heap and thread
In preparation for proper splitting of Javascript support into
heaps and threads, this renames the types and corrects the no-js
builds to still work.  At this time no substantive change in
semantics exists, and the duktape build won't work.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-03-21 18:30:41 +00:00
Daniel Silverstone
313dc9b099
JS: Remove unused slow script callback
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-03-21 18:07:50 +00:00
Michael Drake
c5aaf45d8e Fetch: Squash use of uninitialised value in fetch_send_callback()
The `last_msg` member of `struct fetch` was not initialised on
creation of the structure.
2020-03-12 17:22:28 +00:00
Michael Drake
0e6ba162b2 Internal content: Restyle certificate viewer page. 2020-02-24 21:54:54 +00:00
Daniel Silverstone
14286b381b
fs_backing_store: Remove cache on failure to init
If we fail to init the control file for reasons other than it
not being found, we blow away the cache in its entirety and then
try again.  We warn if the removal fails, but carry on regardless
since right now the worst that'll happen is that we'll end up
with more on disk than we know about in the cache.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 21:01:58 +00:00
Michael Drake
52bfae1782 Internal pages: Update directory listing style. 2020-02-24 18:22:03 +00:00
Daniel Silverstone
4c256408c5
fetch: Bump last_msg rather than always assigning it
If we are aborting a cURL fetch then it's possible entry to
cURL to clean up could cause a PROGRESS message to happen which
we need to not reset last_msg for, otherwise we spuriously attempt
to send an ERROR message during abort which is not a safe time for
our message callback to be used.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 17:43:21 +00:00
Daniel Silverstone
02c5bde5a9
fs_backing_store: Fix some comparison types
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 17:43:14 +00:00
Daniel Silverstone
fa75e8e4fd
fs_backing_store: Use correct format specifier for 64bit int
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 17:19:45 +00:00
Vincent Sanders
f172a21df9 about scheme certificate viewer initial implementation 2020-02-24 16:59:18 +00:00
Daniel Silverstone
5c205fbff0
fs_backing_store: Fix up comments to be in-line with values
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 15:56:55 +00:00
Michael Drake
f840833723 Low level cache: Squash use of uninitialised value.
Coverity issue:

CID 1419828:  Memory - corruptions  (UNINIT)
>>>     Using uninitialized value "output_length".
2020-02-24 15:37:20 +00:00
Daniel Silverstone
133e00edbe
fs_backing_store: 8K metadata blocks, 1K blocks, bump version
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 15:37:12 +00:00
Michael Drake
0140d1e5b1 Curl fetcher: Guard against read of uninitialised value.
Fixes Coverity issue:

CID 1419830:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "buf[depth]".
2020-02-24 14:58:16 +00:00
Michael Drake
63dd59bd2e Cache backing store: Add missing calloc check.
Found by coverity:

CID 1419831:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "url" when calling "read".
2020-02-24 14:34:37 +00:00
Michael Drake
b8dc537bf8 Curl fetcher: Squash coverity warning.
CID 1419832:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "goto out;".
2020-02-24 14:31:02 +00:00
Daniel Silverstone
bb5d72410b
fetchers: Rework the about, data, file, and resource fetcher poll loop
This simplifies the poll loops a little more and makes me less worried
that some other corner case will bite us in the future.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 14:25:37 +00:00
Michael Drake
a47270c93e About fetches resources: Drop maps resource.
It had bitrotted.
2020-02-24 14:21:27 +00:00
Daniel Silverstone
97870122dd
fetch: When aborting, ensure we note this to not multi-fail
When aborting a fetch, it may be cleaned up, in which case we
would otherwise send a spurious failure message too early. Instead
we record that the abort has occurred to suppress such an error.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 10:24:23 +00:00
Daniel Silverstone
5cfe0dfffc
fetchers: Apply cleaner ring handling mechanic to other fetchers
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 09:51:44 +00:00
Daniel Silverstone
083ba385d7
fetch: Automatically handle fetches which fail to finish
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 09:47:52 +00:00
Daniel Silverstone
89e468422d
about: Correct handling of ring in fetch_about_poll
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-24 09:46:59 +00:00
Daniel Silverstone
360997c265
fs_backing_store: Clear entry memory flags on read
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 23:04:49 +00:00
Daniel Silverstone
e6a5c090c9
curl: Implement SSL chain cache in cURL fetcher
Because cURL can do connection caching behind the scenes, we
need to have a cache for the SSL certificate chains which we
send onward on first header back from cURL.

This uses the new hashmap implementation to mean that we cache
chains on a hostname:port basis.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 22:31:58 +00:00
Daniel Silverstone
859972df71
llcache: Rework fs_backing_store to use hashmap
As a result, we no longer waste a bunch of RAM on the entries
tables.  This ought to be no slower, and more memory efficient.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 20:59:40 +00:00
Daniel Silverstone
ac75a9161e
llcache: Persist anything available during llcache_finalise
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 20:59:40 +00:00
Vincent Sanders
0c34d06494 Keep the complete certificate chain from a fetch
Instead of extracting information from the X509 certificate chain in
the fetcher the entire chain is propagated in Distinguished Encoding
Rules (DER) format.

This allows all the information contained in a certificate chain to be
retained which can subsequently be presented to the user
2020-02-23 16:23:50 +00:00
Vincent Sanders
214478fc15 Improve some content documentation comments 2020-02-23 16:17:51 +00:00
Michael Drake
f3b7a0c44c HTML Script: Check for success on intern of mimetype. 2020-02-23 14:28:27 +00:00
Daniel Silverstone
16163aab03
HTML: Ignore dom exceptions we don't care about
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 09:36:07 +00:00
Daniel Silverstone
b633bef7bf
Node: nodeValue setter should return value set into node
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 09:33:26 +00:00
Daniel Silverstone
bfd185ac49
dukky: Guard pointless work for deep debug
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-23 09:19:51 +00:00
Daniel Silverstone
bc1810ed61
JS: it's Infinity not infinity
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 19:37:54 +00:00
Daniel Silverstone
d0e775e901
JS: Add Element::attributes and NamedNodeMap to handle it
This is a *very* rudimentary implementation lacking most of the
functionality of NamedNodeMap but it's enough to get jQuery 1.12.4 up.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 18:40:35 +00:00
Daniel Silverstone
b23063bb52
JS Generics: Add a NodeMap proxy builder
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 18:40:16 +00:00
Daniel Silverstone
2325062ff1
Element: support innerHTML
To get us further along the JavaScript pathway, support the
getter and setter for innerHTML.  The getter always returns
an empty string for now, but the setter works.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 18:02:57 +00:00
Daniel Silverstone
61fdb8fda6
JS: Add DOMImplementation::createHTMLDocument
This was the last major thing blocking basic jQuery support

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 16:19:00 +00:00
Daniel Silverstone
fa520638fa
HTML: Ignore LOADING status in html_proceed_to_done()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 14:26:33 +00:00
Daniel Silverstone
2f8868309a
HTML: Don't transition the content state machine if we do nothing
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 14:09:39 +00:00
Daniel Silverstone
db370bfdb7
HTML: Complete content state machine after async script
The async script completion process needs to complete the
content state machine so that browser throbbers eventually
stop once async scripts have fetched and run, even if that
happens *after* conversion finishes.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-02-21 10:48:00 +00:00
Vincent Sanders
55ba27c68f re-order config include so strcasecmp is correctly detected on RISC OS/win32 2019-12-22 11:11:04 +00:00
Daniel Silverstone
eba05b0d38
html_script: Count sync scripts to prevent unpausing early
If there is more than one incomplete sync script then it's
important that we don't unpause hubbub too early.  This commit
adds a counter so that if there're unfinished sync scripts in
the set, we don't unpause until the last one completes.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-19 20:50:33 +00:00
Michael Drake
faf667ada7 HTML: box_consturction: cleanup name dom_string in box_object. 2019-12-10 19:26:12 +00:00
Michael Drake
4c4b57d511 HTML redraw: Never draw box scrollbars for textareas.
The scrollbars for textareas are rendered by the widget.

This stops us from putting broken scrollbars over the top of the
textarea's own scrollbars.
2019-12-09 14:33:53 +00:00
Michael Drake
1c466369ef webp: NetSurf bitmap format is RGBA.
Issue a bitmap modified call after conversion, to allow front ends
with different pixel formats to convert.
2019-12-08 11:30:47 +00:00
Daniel Silverstone
3a8317fddb
fetch_curl_report_certs_upstream: Use new SSL_CERT_ERR_CERT_MISSING
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-03 09:42:14 +00:00
Daniel Silverstone
24dd16ddff
fetch_curl_verify_callback: Do depth update after check
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-12-03 09:35:51 +00:00
Michael Drake
eb88c92749 html: css fetcher: Fix passing LWC borrow to fetcher_add, which consumes.
Fixes abort on exit when corestring finalisation tried to unref
what should have been the final ref:

    $ ./nsgtk3
    corrupted double-linked list
    Aborted (core dumped)
2019-12-02 10:58:36 +00:00