Commit Graph

78 Commits

Author SHA1 Message Date
Vincent Sanders 5a2f69388c hoist the Referer header generation logic up to the low level cache
This removes the need for the fetchers to have any interaction with
 the Referer header. It has not been completely removed from the
 fetch interface as fetch.c:fetch_set_cookie() still uses it for
 unverifiable cookie decision logic. (There is an anchient todo here)
2021-03-25 23:36:41 +00:00
Vincent Sanders ab952e0634 improve content header usage 2020-05-07 20:55:44 +01: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
Daniel Silverstone b03786920a hlcache_fini(): Deschedule cleanups on finalisation
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-07 15:23:45 +01:00
Daniel Silverstone 170dc5d524 Excise the llcache query pathway.
In further preparation for the auth and cert queries being handled
as special contents from `about:` this excises the query pathway
from the llcache pretty much entirely.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 20:56:07 +01:00
Daniel Silverstone bfb1bb1192 Migrate SSL certificate storage to the browser window
* Fetchers now provide the certificates before headers
* This is propagated all the way to the browser window
* When a query occurs, we retrieve it from there and fire
  the query with those stored certificates.
* The serial number is a bignum, store it as hex.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 18:12:47 +01:00
Daniel Silverstone 6ba199c7d7 Content messages: Remove ERRORCODE, rework ERROR
This reworks CONTENT_MSG_ERROR to be structured data and
removes the CONTENT_MSG_ERRORCODE message kind.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-05 14:30:30 +01:00
Daniel Silverstone b48e462f0f content, hlcache: Propagate query events upward
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-04 11:22:40 +01:00
Daniel Silverstone 09eb89e3c3 Migrate query dispatch up from llcache to hlcache
As a first step in refactoring query handling to be managed
by `browser_window`, this migrates the calling of the query
handler from the llcache object code up to the hlcache.

In theory this may result in multiple queries happening for one
object, but we mitigate multiple-responses in the llcache so
all should be well.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-08-03 21:13:19 +01:00
Daniel Silverstone 09fa61eb73 hlcache.c: Clean up LOADING contents during finalise
During the process of finalising the hlcache, there won't be
any more fetching going on.  As such, we can abort, error, and
then destroy any contents still in the process of loading.  This
should reduce our leaks during shutdown.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-15 21:12:58 +01:00
Vincent Sanders 75018632a9 Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done

@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 18:45:27 +01:00
Michael Drake 4a014fecde hlcache content callback: Use designated initialiser for hlcache_event. 2017-08-28 11:52:54 +01:00
Vincent Sanders cde300133e initialise event struct correctly to avoid compiler warning 2017-08-27 16:01:58 +01:00
Michael Drake e94fe1632e Content API: Avoid content message copy in content user callback. 2017-08-26 16:38:18 +01:00
Vincent Sanders 0866314d96 reduce hlcache handle api usage in mimesniff 2017-03-19 22:29:23 +00:00
Vincent Sanders 9ff13d64c4 fix spelling mistakes in hlcache code 2016-11-20 15:25:33 +00:00
Vincent Sanders 76a68d7dd0 Update content to split public and internal API 2016-06-06 09:01:38 +01:00
Vincent Sanders fe7eb85614 move misc header into public API 2016-05-30 11:23:32 +01:00
Vincent Sanders 33c7df0c40 complete the rename of the gui browser table
When the operations tables were created the browser table was renamed
to miscellaneous except the actual rename patch was never applied,
this fixes that situation.
2016-04-16 23:50:21 +01:00
Vincent Sanders b1e0a711c7 Stop reporting error from mime sniffing when a fetcher completes with no data
If a fetcher returns with no data (no content or http error code 204)
the hlcache state machine was trying to mimesniff using non existent
header data and reporting the resulting NSERROR_NOT_FOUND as a
"BadType" message.

This changes the behaviour to be similar to that in the headers
received case where NSERROR_NOT_FOUND from the mimesniffing is not an
error.
2016-01-06 23:53:02 +00:00
Vincent Sanders 73e45ff024 Fix error reporting from fetch_start
Any fetch start error was being reported as "out of memory" which was
clearly insufficient. Foe example bad urls (reported was file:// with
a missing /) were causing a warn_user with out of memory. This change
now at least causes a "bad url" message.
2015-06-24 10:31:13 +01:00
Vincent Sanders c105738fa3 Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all
callsites to have double bracketing and allows for future improvement
on how we use the logging macros.

The callsites were changed with coccinelle and the changes checked by
hand. Compile tested for several frontends but not all.

A formatting annotation has also been added which allows the compiler
to check the parameters and types passed to the logging.
2015-05-28 16:08:46 +01:00
Vincent Sanders 5562c9a553 Continue doxygen error cleanup. 2014-11-08 22:08:29 +00:00
Vincent Sanders 8ec7ad053a Make the fetching of a contents encoding generic.
The frontends previously had to use an html renderer API to get the
encoding of a content. This also required the explicit checking of the
contents type rather than using the existing content API to abstract
this knowledge.
2014-11-05 23:44:31 +00:00
Vincent Sanders d06df231bc Update the core to use the split operations table headers
Second in the series to decouple the core API usage from the frontends.
2014-10-16 22:33:43 +01:00
Vincent Sanders 4b2101ba6a clean up the fetcher factory and improve its API 2014-06-19 18:27:24 +01:00
Vincent Sanders 644fc616b3 attempt to purge low level cache on out of memory during fetch 2014-05-29 14:00:13 +01:00
Vincent Sanders 4a49ff5266 Extend low level source data cache with persistant storage 2014-05-13 15:52:58 +01:00
Vincent Sanders 2326d3c503 remove unecessary utils/url.h includes 2014-05-09 10:15:42 +01:00
Vincent Sanders 87f6314dab move scheduleing into browser operation table 2014-03-09 15:37:40 +00:00
Vincent Sanders 977ae8efc6 remove all forward declarations from hlcache.c 2014-01-19 21:18:47 +00:00
Michael Drake 5122559d73 Pedantic wrap fix. 2013-10-23 15:41:19 +01:00
Michael Drake ba9769bc8c Pass fetch redirect info up to content layer as content_msg. Mark redirect origin URLs as visited in browser window content callback. Note this doesn't mean we track redirects, it just lets us get the :visited link style on links that redirect. 2013-05-27 14:51:00 +01:00
Vincent Sanders 8611281b2e add content handler for javascript
svn path=/trunk/netsurf/; revision=13971
2012-06-19 22:57:29 +00:00
John Mark Bell 3e2e110a86 Bypass full type sniffer if only images are acceptable
svn path=/trunk/netsurf/; revision=13436
2012-02-08 00:52:16 +00:00
John Mark Bell 4e4cf305cb Fix bug #3454606: prevent double free of retrieval context when downloading
svn path=/trunk/netsurf/; revision=13260
2011-12-08 21:58:26 +00:00
John Mark Bell 3ba6a15fa7 Fix bug #3452421: retain hlcache retrieval context when reporting errors & rely on clients correctly releasing handles to clean up.
svn path=/trunk/netsurf/; revision=13250
2011-12-06 20:47:15 +00:00
John Mark Bell f2993e6ed0 content_get_url -> hlcache_handle_get_url, content__get_url -> content_get_url
svn path=/trunk/netsurf/; revision=13236
2011-12-04 14:55:23 +00:00
Daniel Silverstone 29d3b4fa00 Sort out hiccough in hlcache finalisation debug
svn path=/trunk/netsurf/; revision=13017
2011-10-09 10:53:17 +00:00
Michael Drake 36eff6da2b Port more internals to nsurl. Front ends may need updating.
svn path=/trunk/netsurf/; revision=12926
2011-10-03 15:56:47 +00:00
Michael Drake 861f88aa43 Port llcache to nsurl.
svn path=/trunk/netsurf/; revision=12904
2011-09-28 11:26:30 +00:00
Vincent Sanders 2d33a8f85a Make high level cache, low level cache and image cache all be initialised from passed parameters
Calculate all cache sizes from single memory cache size option and sanity check
have a single global struct to hold all parameters instead of several individual variables

svn path=/trunk/netsurf/; revision=12784
2011-09-10 00:55:39 +00:00
Vincent Sanders dec633ca8e make high level cache take a parameter structure
make hlcache have a single global container

svn path=/trunk/netsurf/; revision=12779
2011-09-08 12:04:57 +00:00
John Mark Bell f6ac059a05 Handle zero-length documents correctly
svn path=/trunk/netsurf/; revision=12778
2011-09-08 08:26:16 +00:00
John Mark Bell 6807fa854d Sniff content types where appropriate.
We never sniff for CSS, nor for non-page artefacts (e.g. treeview icons)

svn path=/trunk/netsurf/; revision=12707
2011-09-04 06:28:09 +00:00
John Mark Bell b34502af82 Refactor http utilities
svn path=/trunk/netsurf/; revision=12595
2011-07-08 08:38:17 +00:00
John Mark Bell e71691bae8 Merge branches/jmb/content-factory to trunk
svn path=/trunk/netsurf/; revision=12283
2011-05-06 20:40:09 +00:00
Vincent Sanders 1da7b161f8 Stop gtk printing from exploding if its unable to initialise the job
add interface to clone a high level cache handle
make generic printing core call new hlcache interface

svn path=/trunk/netsurf/; revision=12068
2011-03-15 22:02:06 +00:00
John Mark Bell 408f78b737 Move schedule.h to utils/
svn path=/trunk/netsurf/; revision=12039
2011-03-13 22:50:54 +00:00
Daniel Silverstone e083b503a0 Ensure we stop the hlcache schedule before we quit the gui
svn path=/trunk/netsurf/; revision=12036
2011-03-13 20:20:31 +00:00