Commit Graph

559 Commits

Author SHA1 Message Date
Vincent Sanders
448b0275ae Fix file: handling on risc os, gtk, windows and framebuffer frontends
svn path=/trunk/netsurf/; revision=10419
2010-04-16 23:56:53 +00:00
John Mark Bell
01eb197f56 When the fetch system informs its clients that certificate verification has failed, it has already stopped and cleaned up the fetch.
Stop llcache_fetch_cert_error attempting to abort the fetch, as this will result in a double free.

svn path=/trunk/netsurf/; revision=10418
2010-04-16 23:15:22 +00:00
John Mark Bell
be3b246eab Add accessor for quirks
svn path=/trunk/netsurf/; revision=10415
2010-04-16 20:54:57 +00:00
John Mark Bell
bf27f667c9 Add assertion
svn path=/trunk/netsurf/; revision=10414
2010-04-16 20:47:22 +00:00
John Mark Bell
34465a06ab Remove fresh field from struct content
svn path=/trunk/netsurf/; revision=10413
2010-04-16 20:44:44 +00:00
John Mark Bell
e58a7d88f4 Make content_invalidate_reuse_data cause llcache to invalidate cache control data
svn path=/trunk/netsurf/; revision=10412
2010-04-16 20:43:36 +00:00
John Mark Bell
44552e7492 Provide API to invalidate llcache object cache control data
svn path=/trunk/netsurf/; revision=10411
2010-04-16 20:42:10 +00:00
John Mark Bell
ca0daa1a66 Reset fetch state when refetching object.
Ensure that cache control data is invalidated for 401/certificate failure so that conditional headers are not emitted when object is refetched.

svn path=/trunk/netsurf/; revision=10408
2010-04-16 20:08:27 +00:00
John Mark Bell
b008327de1 Improve 401 response handling
svn path=/trunk/netsurf/; revision=10407
2010-04-16 20:00:10 +00:00
John Mark Bell
1c42c0569f Ensure we invalidate cache data and mark objects as complete on failure to fetch.
svn path=/trunk/netsurf/; revision=10402
2010-04-14 20:42:03 +00:00
Daniel Silverstone
2ba2dab3a7 Eat any #fragment in llcache_object_retrieve -- fixing double-fragment issues at the top level, and preventing fragment(ed) redirects from confusing the issue
svn path=/trunk/netsurf/; revision=10399
2010-04-14 14:53:21 +00:00
Daniel Silverstone
b56886d0ee Abstract a number of unsafe iterations of object users into a single safe function call
svn path=/trunk/netsurf/; revision=10398
2010-04-14 10:56:44 +00:00
John Mark Bell
3840e3911b Stop leaking hlcache handles.
svn path=/trunk/netsurf/; revision=10395
2010-04-13 23:24:07 +00:00
Vincent Sanders
d1cd04a0b9 remove incorrect low level cache release
svn path=/trunk/netsurf/; revision=10391
2010-04-13 16:53:52 +00:00
Michael Drake
f58fa3b2ac Revert last change.
svn path=/trunk/netsurf/; revision=10382
2010-04-12 09:31:34 +00:00
Michael Drake
de6f1a2b2e Make new cache strip the fragment identifier, like fetchcache did.
svn path=/trunk/netsurf/; revision=10381
2010-04-12 09:25:41 +00:00
John Mark Bell
18081664eb Provide API to enable a handle's callback to be replaced
svn path=/trunk/netsurf/; revision=10376
2010-04-11 23:02:49 +00:00
John Mark Bell
4b8c720ac5 Shrink source buffer to final length on fetch completion
svn path=/trunk/netsurf/; revision=10373
2010-04-11 21:26:20 +00:00
John Mark Bell
486731e589 Release low-level cache handle when destroying contents
svn path=/trunk/netsurf/; revision=10372
2010-04-11 20:58:50 +00:00
John Mark Bell
71de3618f1 Implement hlcache_poll(), which drives the low-level cache event loop, and attempts to clean the high-level cache.
Call this, instead of llcache_poll().

svn path=/trunk/netsurf/; revision=10371
2010-04-11 20:21:13 +00:00
John Mark Bell
60d1b74099 Remove redundant todo
svn path=/trunk/netsurf/; revision=10363
2010-04-11 16:39:58 +00:00
John Mark Bell
0650096403 CSS contents may be shared
svn path=/trunk/netsurf/; revision=10362
2010-04-11 16:38:16 +00:00
John Mark Bell
ff8791a3f7 Ensure content can be shared when retrieving from cache
svn path=/trunk/netsurf/; revision=10361
2010-04-11 16:37:39 +00:00
John Mark Bell
7577e2a1e6 Ensure quirks mode matches when retrieving contents from cache
svn path=/trunk/netsurf/; revision=10360
2010-04-11 16:34:23 +00:00
John Mark Bell
ad89d5b263 Copy child charset, if any
svn path=/trunk/netsurf/; revision=10359
2010-04-11 16:23:45 +00:00
John Mark Bell
6a88eaf67a Pedantic whitespace changes
svn path=/trunk/netsurf/; revision=10356
2010-04-11 14:39:26 +00:00
John Mark Bell
fe87225ccf Complete low-level cache cleaner
svn path=/trunk/netsurf/; revision=10355
2010-04-11 14:32:39 +00:00
John Mark Bell
9666787dfa Remove redundant todo
svn path=/trunk/netsurf/; revision=10354
2010-04-11 14:12:13 +00:00
John Mark Bell
a70c67fa35 Support 307 redirects for GET requests
svn path=/trunk/netsurf/; revision=10353
2010-04-11 14:11:33 +00:00
John Mark Bell
863d5c77c3 Forbid redirects to file:/// URLs
svn path=/trunk/netsurf/; revision=10352
2010-04-11 14:06:02 +00:00
John Mark Bell
40bac34ffd Bail out if we're redirected to an URL we can't handle
svn path=/trunk/netsurf/; revision=10351
2010-04-11 14:01:11 +00:00
John Mark Bell
758190f37b Reintroduce redirect limit
svn path=/trunk/netsurf/; revision=10350
2010-04-11 13:58:12 +00:00
John Mark Bell
3470764041 Remove redundant todos
svn path=/trunk/netsurf/; revision=10349
2010-04-11 13:29:02 +00:00
John Mark Bell
737d6ad557 Merge jmb/kill-reentrancy. r=vince
svn path=/trunk/netsurf/; revision=10346
2010-04-11 10:52:18 +00:00
John Mark Bell
b0f1b7b170 Improve const-correctness of fetch_start
svn path=/trunk/netsurf/; revision=10342
2010-04-10 17:13:53 +00:00
John Mark Bell
24c853281d Return cookies to the same level of working/brokenness as they had before new-cache.
svn path=/trunk/netsurf/; revision=10340
2010-04-10 12:24:25 +00:00
John Mark Bell
ee2a5b40ce Use computed POST data when redirecting, instead of original.
Certain redirect methods result in POST being converted to GET.

svn path=/trunk/netsurf/; revision=10339
2010-04-10 11:56:14 +00:00
John Mark Bell
4a4cc0d1bc Introduce content_set_ready.
Make content_convert emit events only if content is in appropriate state.
Remove no-longer-relevant assertion from content_convert.

svn path=/trunk/netsurf/; revision=10330
2010-04-09 18:52:44 +00:00
Daniel Silverstone
b2124867db Kill uninitialized warning about 'type'
svn path=/trunk/netsurf/; revision=10329
2010-04-09 09:10:23 +00:00
Daniel Silverstone
dfae5c33d2 Some more asserts to try and help spot multiple-release of llcache handles
svn path=/trunk/netsurf/; revision=10327
2010-04-09 00:06:36 +00:00
Daniel Silverstone
2b8adb0c8a Move the removal of the retrieval context to prevent a re-entrancy race causing double-release of llcache handles
svn path=/trunk/netsurf/; revision=10307
2010-04-08 13:39:07 +00:00
Daniel Silverstone
4262232956 Fix missing 'break' introduced by 10300
svn path=/trunk/netsurf/; revision=10304
2010-04-08 13:18:50 +00:00
Daniel Silverstone
92bd0d4ce0 Add an assert to clarify a segfault I'm investigating
svn path=/trunk/netsurf/; revision=10303
2010-04-08 13:12:30 +00:00
Daniel Silverstone
5c55264217 Remove todo -- no longer appropriate
svn path=/trunk/netsurf/; revision=10302
2010-04-08 12:24:29 +00:00
Daniel Silverstone
45faa483e5 Ensure an error'd fetch's llcache object is implicitly stale so it is not reused
svn path=/trunk/netsurf/; revision=10301
2010-04-08 12:20:20 +00:00
Daniel Silverstone
6c9e4bea8e Purge FETCH_TYPE which is unused throughout NetSurf. Clearing a todo in llcachec.
svn path=/trunk/netsurf/; revision=10300
2010-04-08 12:16:52 +00:00
Daniel Silverstone
2b1146bcb3 Remove parent from fetches, clearing a todo from llcache.c
svn path=/trunk/netsurf/; revision=10299
2010-04-08 11:47:05 +00:00
Daniel Silverstone
6948496d45 Ensure that aborting or releasing hlcache handles will result in nascent retrieval contexts being cleaned up
svn path=/trunk/netsurf/; revision=10298
2010-04-08 11:21:50 +00:00
John Mark Bell
bba7fbbd9b Abort and release llcache handle on failure to process data.
Make hlcache retrieval ignore erroneous contents.

svn path=/trunk/netsurf/; revision=10296
2010-04-08 07:09:09 +00:00
John Mark Bell
4682f0ccd8 When we've snapshotted an object, make sure we add the *new* object into the list of uncacheable objects, and not the old one. Otherwise, our cache chains end up being corrupted.
svn path=/trunk/netsurf/; revision=10295
2010-04-08 07:08:16 +00:00
Michael Drake
2fba2249ee Add function to test whether hlcache_handle's content is locked.
svn path=/trunk/netsurf/; revision=10287
2010-04-07 18:50:18 +00:00
Michael Drake
bbd757c34a Fix fetch_curl_post_convert() for filename_from_path() returning NULL.
svn path=/trunk/netsurf/; revision=10265
2010-04-07 11:10:55 +00:00
Michael Drake
236b6a15e1 Add mime-type getter.
svn path=/trunk/netsurf/; revision=10259
2010-04-07 09:12:09 +00:00
John Mark Bell
2748fe4f64 Make downloads work again.
svn path=/trunk/netsurf/; revision=10243
2010-04-05 21:35:38 +00:00
John Mark Bell
2dc791a253 Remove redundant content message types and associated data
svn path=/trunk/netsurf/; revision=10241
2010-04-05 10:40:16 +00:00
John Mark Bell
69f02e926f Make the high-level cache drop contents of unacceptable type on the floor.
svn path=/trunk/netsurf/; revision=10238
2010-04-04 17:17:24 +00:00
John Mark Bell
79ce683b4e Most of a stop implementation.
Remaining work:
  1) Clone content_html_data
  2) Cloning content_css_data requires the charset of the old content
  3) Calling hlcache_handle_abort() before a content has been created must clean up the retrieval context.

svn path=/trunk/netsurf/; revision=10236
2010-04-04 12:41:19 +00:00
John Mark Bell
43a99ab683 Constify data parameter to *_process_data
svn path=/trunk/netsurf/; revision=10234
2010-04-03 16:37:36 +00:00
John Mark Bell
49810d8191 Use mutator to modify content's title field.
svn path=/trunk/netsurf/; revision=10231
2010-04-03 11:55:28 +00:00
Vincent Sanders
95e4a737de rationalise the usage of the file scheme
svn path=/trunk/netsurf/; revision=10221
2010-03-31 13:59:57 +00:00
John Mark Bell
9f575c590b Do not abort fetch on receipt of FETCH_ERROR: the fetch has already been destroyed.
Implement LLCACHE_EVENT_ERROR case of hlcache_llcache_callback().

svn path=/trunk/netsurf/; revision=10218
2010-03-30 21:36:39 +00:00
Chris Young
07537e5240 Fix compilation when building WITH_NS_SVG
svn path=/trunk/netsurf/; revision=10213
2010-03-30 18:12:21 +00:00
John Mark Bell
9aca901eb1 The convert stage of a content's state progression no longer reflows the content to the provided dimensions.
It is now defined as converting the content into a state in which it is ready for use.
The user of the content is now responsible for performing an initial reformat (sic) of the content before it can be redrawn.

Purge width/height parameters from hlcache_handle_retrieve/content_convert/*_convert APIs.
Fix up content handlers affected by the above change in semantics.
Ensure that browser_window_callback performs an initial reformat of its content.

svn path=/trunk/netsurf/; revision=10207
2010-03-29 22:33:21 +00:00
John Mark Bell
2a53c4c811 Use hlcache_child_ctx, instead of just hoping that we replicate its members correctly.
Ensure public API documentation is not duplicated.

svn path=/trunk/netsurf/; revision=10206
2010-03-29 21:17:18 +00:00
John Mark Bell
99dee5e3d0 Disable llcache tracing
svn path=/trunk/netsurf/; revision=10201
2010-03-29 06:29:56 +00:00
John Mark Bell
b6f6bc5fdd Fix broken linked list removal.
svn path=/trunk/netsurf/; revision=10200
2010-03-29 06:29:25 +00:00
John Mark Bell
311b458d56 Forbid contents with active fetches from being cleaned.
svn path=/trunk/netsurf/; revision=10199
2010-03-29 06:28:46 +00:00
John Mark Bell
4e2c3a4c39 Exceptionally verbose tracing of llcache operation.
svn path=/trunk/netsurf/; revision=10198
2010-03-29 06:27:37 +00:00
John Mark Bell
57253cdd58 Fixup per review
svn path=/trunk/netsurf/; revision=10196
2010-03-28 23:25:21 +00:00
Daniel Silverstone
66d1418506 Allow us to cache foo?bar when it explicitly allows it. as per rfc2616 13.9
svn path=/trunk/netsurf/; revision=10190
2010-03-28 16:51:47 +00:00
Daniel Silverstone
8effd1cb98 Ensure that finished redirection objects in llcache do not get found by subsequent fetch attempts.
svn path=/trunk/netsurf/; revision=10188
2010-03-28 16:28:28 +00:00
Daniel Silverstone
cb7412181f Replace fetch_poll with llcache_poll throughout. Allow CONTENT_OTHER to complete properly.
svn path=/trunk/netsurf/; revision=10187
2010-03-28 16:00:54 +00:00
Daniel Silverstone
05a4eceae2 Remove fetchcache.[ch]
svn path=/trunk/netsurf/; revision=10183
2010-03-28 15:34:07 +00:00
Daniel Silverstone
270ef59a98 Merge jmb/new-cache; r=dsilvers,rs=vince
svn path=/trunk/netsurf/; revision=10180
2010-03-28 12:56:39 +00:00
Chris Young
033b5d815a Move code which extracts the filename from a given path into frontend.
svn path=/trunk/netsurf/; revision=10139
2010-03-21 13:32:59 +00:00
John Mark Bell
ee833877c5 Rate limit fetch progress notifications.
svn path=/trunk/netsurf/; revision=9962
2010-02-10 00:32:12 +00:00
Vincent Sanders
6990c2cd04 remove uneccissary includes
svn path=/trunk/netsurf/; revision=9931
2010-01-29 11:32:53 +00:00
James Bursa
914eedc11d Don't set proxy option for file: URLs to workaround some versions of libcurl attempting to use it (fixed in latest libcurl). Also unset curl proxy option if it's disabled so the previous xfer's setting isn't retained.
svn path=/trunk/netsurf/; revision=9759
2009-12-25 19:27:22 +00:00
John Mark Bell
b75b2ae8bb Merge r9731:HEAD from branches/MarkieB/gtkmain to trunk.
svn path=/trunk/netsurf/; revision=9737
2009-12-18 20:15:50 +00:00
John Mark Bell
355799ce0b Merge branches/MarkieB/gtkmain to trunk.
svn path=/trunk/netsurf/; revision=9729
2009-12-17 23:55:02 +00:00
John Mark Bell
d88945bc0b Squash leak.
svn path=/trunk/netsurf/; revision=9711
2009-12-02 16:54:17 +00:00
John Mark Bell
d591d8df94 Treat decomposed URLs with no path component as being for the path "/".
svn path=/trunk/netsurf/; revision=9703
2009-11-22 23:25:18 +00:00
John Mark Bell
3f4d79e576 This optimisation was so simple that it was broken.
svn path=/trunk/netsurf/; revision=9696
2009-11-22 14:24:53 +00:00
John Mark Bell
8685cfb3b7 Fix the other half of this NULL dereference issue
svn path=/trunk/netsurf/; revision=9695
2009-11-22 14:21:47 +00:00
John Mark Bell
63848419e2 Ensure urldb file handle is closed on error.
svn path=/trunk/netsurf/; revision=9693
2009-11-22 14:12:03 +00:00
John Mark Bell
eba224e09e Avoid potential NULL deference
svn path=/trunk/netsurf/; revision=9688
2009-11-22 13:52:16 +00:00
John Mark Bell
81c1b0e0df Don't call memcpy when p->segment is NULL
svn path=/trunk/netsurf/; revision=9687
2009-11-22 13:49:43 +00:00
John Mark Bell
54cd21ae0d Realm may be NULL iff there's no WWW-Authenticate header served up with a 401.
Default the realm to the fetch URL in this case. Fixes #2890933

Note for new cache implementation (which is actually capable of utilising response bodies in this situation): if there is no WWW-Authenticate header, serve up the response body immediately -- don't present an authentication dialogue.

svn path=/trunk/netsurf/; revision=9659
2009-11-03 07:03:07 +00:00
John Mark Bell
1c403cb2f8 svgtiny requires separate contents
svn path=/trunk/netsurf/; revision=9615
2009-10-08 12:03:44 +00:00
John Mark Bell
e580e2bea9 Hack around cache issue. The entire cache layer needs a redesign asap.
svn path=/trunk/netsurf/; revision=9460
2009-08-26 11:22:48 +00:00
John Tytgat
2261b616f6 - content/urldb.c(auth_data): Removed;
(prot_space_data): Added, it lives linked in the leaf host_part
  struct and together with its scheme and port (which defins canonical root
  url) and realm this defines a protection space.
  (path_data): Removed auth_data field and replaced by a prot_space_data
  pointer.
  (host_part::prot_space): Added linked list of protection space data
  structs.
  (urldb_get_auth_details): Given an URL fetch fetches its auth.
  (urldb_set_auth_details): Creates or updates the contents of a
  protection space to which given URL belongs.
  (urldb_destroy_host_tree): Delete protection data space structures
  using urldb_destroy_prot_space.
  (urldb_destroy_prot_space): Added.
- content/urldb.h(urldb_get_auth_details): Added realm parameter.
- content/fetchers/fetch_curl.c(fetch_curl_set_options): Update
  urldb_get_auth_details call (we don't know realm at this point).
- content/fetchcache.c(fetchcache_callback, fetchcache_auth): At FETCH_AUTH,
  use realm to determine if we really don't know auth data and if so,
  refetch content.
- content/content.h(struct content): Add content::tried_with_auth.
- content/content.c(content_create): Initialize content::tried_with_auth.
- riscos/401login.c(ro_gui_401login_open): Show known authentication
  data in dialogue so user can see what was wrong with it and correct it.

Solves bug #2830829.

svn path=/trunk/netsurf/; revision=9045
2009-08-04 23:02:23 +00:00
John Tytgat
9d678ef7cd Drop pkg-config on cairo, not needed here. Added const.
svn path=/trunk/netsurf/; revision=8985
2009-08-02 12:07:29 +00:00
Chris Young
0cd96bdd5e Correct definition
svn path=/trunk/netsurf/; revision=8899
2009-07-29 22:00:07 +00:00
Chris Young
d2c29dbe95 Keep a copy of the next_fetcher pointer to avoid a situation where the fetch gets
freed during the poll routine and the next pointer can no longer be read.

svn path=/trunk/netsurf/; revision=8898
2009-07-29 18:51:35 +00:00
John Mark Bell
ddeadd1c02 Merge LibCSS port to trunk.
svn path=/trunk/netsurf/; revision=8752
2009-07-23 23:05:34 +00:00
John Mark Bell
5feb7018c5 Replace parent_url with a pointer to the parent content.
svn path=/trunk/netsurf/; revision=8428
2009-07-10 00:26:37 +00:00
John Mark Bell
ceca548a1d Fix serialisation of page titles.
svn path=/trunk/netsurf/; revision=8313
2009-07-04 18:19:29 +00:00
John Mark Bell
d58baf8ea4 Permit referer to propagate to https hosts from http
svn path=/trunk/netsurf/; revision=7875
2009-06-19 11:15:06 +00:00
John Mark Bell
c1e3fb0bec Remove spurious "domain" variable from urldb_iterate_partial().
Lose unnecessary increment of rptr in cookie domain prefix matching.
Record that, in the long term, we need some kind of TLD service to consult so that (e.g.) .co.uk is not considered a valid domain prefix.

svn path=/trunk/netsurf/; revision=7600
2009-05-28 13:19:07 +00:00
John Mark Bell
059b6a0e15 Make logic surrounding extraction of URL + referer scheme more sensible.
Always require the fetch URL to have a scheme -- without it, we can't find a fetcher.

svn path=/trunk/netsurf/; revision=7597
2009-05-28 11:56:56 +00:00