summaryrefslogtreecommitdiff
path: root/content/llcache.c
Commit message (Collapse)AuthorAgeFilesLines
* Excise the llcache query pathway.Daniel Silverstone2019-08-051-89/+24
| | | | | | | | 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>
* Migrate SSL certificate storage to the browser windowDaniel Silverstone2019-08-051-9/+12
| | | | | | | | | | * 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>
* llcache: Do not delete objects if they were iterator targetsDaniel Silverstone2019-08-041-1/+1
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* llcache: pass the cb_pw in query_finishedDaniel Silverstone2019-08-041-0/+1
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* Migrate query dispatch up from llcache to hlcacheDaniel Silverstone2019-08-031-37/+37
| | | | | | | | | | | | 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>
* llcache: Ensure we preserve iteratorness when sending messagesDaniel Silverstone2019-08-021-1/+2
| | | | | | | | | In order to prevent a problem where iterating causes an abort which causes an iteration which clears the iteratorness of a user allowing it to delete itself causing a segfault, preserve the iteratorness when iterating in send_message Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* llcache: Use last_modified instead of dateDaniel Silverstone2019-08-021-2/+2
| | | | | | | | | When sending an If-Modified-Since header we should use the `last_modified` rather than the `date` property of the cached object in order to not incorrectly assume things have a modification date when they do not. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* llcache: Abort cleanly if called back during shutdownDaniel Silverstone2019-06-151-0/+7
| | | | | | | | | | In order to help us debug shutting down with active fetches, this will abort the process cleanly if we get a callback to an "active" llcache handle after the abort process has actually killed them all. This can happen with deferred fetcher aborts in the cURL fetcher. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* LLCache: validate max-age before useJohn-Mark Bell2019-06-101-1/+3
|
* LLCache: use Cache-Control parserJohn-Mark Bell2019-06-101-48/+18
|
* use jmb suggested fix to cache-control header parse errorVincent Sanders2019-06-101-7/+6
|
* fix parsing of invalid syntax max-age value Cache-control headerVincent Sanders2019-06-101-2/+8
|
* fix size_t format specifiersVincent Sanders2018-08-181-10/+12
|
* refactor llcache header processingVincent Sanders2018-08-121-115/+159
| | | | | refactor the header processing in the low level object cache to make cache control header processing more explicit.
* HSTS: make llcache update policy on 3xx responsesJohn-Mark Bell2018-04-221-0/+2
|
* HSTS: prevent llcache being niceJohn-Mark Bell2018-04-221-9/+25
| | | | | | | | If the server has defined a HSTS policy, then the user no longer gets to click-through a garbage certificate. Additionally, if the server has provided a HSTS policy, it should do TLS properly, so don't permit client-driven TLS version downgrades in that case, either.
* HSTS: teach llcache to update and enforce policy.John-Mark Bell2018-04-221-13/+126
|
* LLCache: correct typos/grammar/etc.John-Mark Bell2018-04-221-21/+21
|
* Squash remaining GCC7 -Wimplicit-fallthrough warnings.Michael Drake2017-10-231-3/+1
|
* fix time_t loggingVincent Sanders2017-09-081-1/+1
|
* Hopefully quash warning about time_t formatting on openbsdDaniel Silverstone2017-09-081-1/+1
|
* add low level cache category and use itVincent Sanders2017-09-061-76/+69
|
* Use coccinelle to change logging macro calls in c filesVincent Sanders2017-09-061-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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);
* create netsurf inttypes header to have portable integer formatting macrosVincent Sanders2017-01-211-3/+1
|
* fix spelling in low level cache codeVincent Sanders2016-11-201-47/+47
|
* Allow certificate verification user prompt creation to return errorsVincent Sanders2016-07-311-0/+9
|
* move misc header into public APIVincent Sanders2016-05-301-1/+1
|
* create date and time to seconds since epoch processing utility functionVincent Sanders2016-04-161-29/+53
| | | | | | | currently NetSurf uses curl_getdate to convert textural date and time strings into seconds since epoch. It is betetr to move this functionality to a utility function so curl_getdate can easily be replaced if required.
* complete the rename of the gui browser tableVincent Sanders2016-04-161-4/+4
| | | | | | 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.
* Fix size_t printf formattingVincent Sanders2016-03-171-6/+7
| | | | | | | The printf formatting for size_t is set in c99 as %zu but in windows it is %Iu this is solved by adding and inttypes style PRI macro for size_t This also uses this macro everywhere size_t is formatted.
* Log the cache limit along side size, after clean.Michael Drake2016-02-081-1/+1
|
* Style: Wrap some long lines.Michael Drake2016-02-081-18/+31
|
* Add URL to llcache object destruction logging.Michael Drake2016-02-081-1/+2
|
* Remove unused variable.Michael Drake2015-12-201-3/+0
|
* Add support for retrying timed-out cURL fetches.Daniel Silverstone2015-11-101-0/+19
| | | | | | | | | | | | | This is an attempt to amelioriate the situation found in #2384 where we see the cURL connect() failing to complete. Based on the pcap from the bug log, we believe that RISC OS is likely failing to signal the completion of the connection to cURL. As such, cURL times out. This change permits retries of timed out connections in the hope that a fresh socket FD might subsequently function correctly. The defaults chosen mean that the previous behaviour of 30 seconds before timeout is reported will remain the same, but in that time we will make 3 separate attempts to connect the socket.
* Fix error reporting from fetch_startVincent Sanders2015-06-241-26/+40
| | | | | | | 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.
* fixup all the remaining logging macro callsitesVincent Sanders2015-05-281-42/+43
| | | | | The semantic patch tool appears to have missed some difficult to reason about callsites which have now been manually cleaned up
* Change LOG() macro to be varadicVincent Sanders2015-05-281-21/+14
| | | | | | | | | | | | 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.
* Fix format string type missmatches on 32-bit systems.Michael Drake2015-05-121-3/+7
| | | | Use C99 inttypes header for format string macros.
* Avoid generating confusing warning.Michael Drake2015-05-121-1/+1
| | | | Now the disc cache will be disabled silently if its too slow.
* Improve the logge dinformation about written cache dataVincent Sanders2015-05-081-7/+7
|
* Ensure bandwidth minimum check is only performed when enough data hasVincent Sanders2015-04-301-6/+15
| | | | been written.
* Improve metadata deserialisation to only update object on successVincent Sanders2015-01-281-22/+46
| | | | | | | The low level cache deserialisation was leaving bad data in an low level cache object in the error case. This fixes it so the object state only gets modified on successful deserialisation of all the metadata.
* Ensure no division by zero occours if no time has ever been spent writing ↵Vincent Sanders2015-01-031-2/+6
| | | | llcache
* add missing includesVincent Sanders2014-12-271-0/+1
|
* improve comments in low level cache and remove completed todoVincent Sanders2014-12-041-4/+4
|
* move the low bandwidth check to allow for an average over a much longer timeVincent Sanders2014-12-031-21/+72
|
* Use translated messgae for low bandwidth errorVincent Sanders2014-12-021-1/+1
|
* cope with backing store writeout making no progressVincent Sanders2014-12-011-44/+52
|
* ensure the backing store write reports at least a minimal amount of timeVincent Sanders2014-12-011-0/+7
|