Commit Graph

100 Commits

Author SHA1 Message Date
John Mark Bell
eb122c52d2 Fix cookie expiration
svn path=/trunk/netsurf/; revision=13161
2011-11-22 00:34:06 +00:00
John Mark Bell
27924aa38c Minor fix for path defaulting: retain rightmost / iff it's the first character in the path
svn path=/trunk/netsurf/; revision=11524
2011-01-29 15:17:42 +00:00
Rob Kendrick
1a7dffdac6 Brain fix on last night's IPv6 modifications
svn path=/trunk/netsurf/; revision=11000
2010-12-05 14:23:30 +00:00
Rob Kendrick
ab704ba7a7 Make urldb_add_url IPv6-aware
svn path=/trunk/netsurf/; revision=10990
2010-12-04 22:46:33 +00:00
John Mark Bell
6173bb0e6c Merge treeview-redux to trunk
svn path=/trunk/netsurf/; revision=10865
2010-10-05 19:14:46 +00:00
Vincent Sanders
4b329697f7 move url database test to test directory
svn path=/trunk/netsurf/; revision=10589
2010-06-29 07:20:12 +00:00
Vincent Sanders
03bb3e8636 remove _GNU_SOURCE define from everywhere.
strndup is not standard so provide an implementation.

svn path=/trunk/netsurf/; revision=10474
2010-04-24 15:22:17 +00:00
Vincent Sanders
6990c2cd04 remove uneccissary includes
svn path=/trunk/netsurf/; revision=9931
2010-01-29 11:32:53 +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
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
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 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
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
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
53bbe5fb9e Fix url completion when last character in url bar is a /
svn path=/trunk/netsurf/; revision=7105
2009-04-16 14:12:54 +00:00
John Mark Bell
79c0981402 Ensure that neither the current fetch host nor the referrer is an IP address before attempting to domain match them.
svn path=/trunk/netsurf/; revision=6466
2009-02-13 10:49:35 +00:00
John Mark Bell
e5c225f7d9 Even fuzzier domain matching.
svn path=/trunk/netsurf/; revision=6463
2009-02-13 00:25:48 +00:00
John Mark Bell
19321017a9 Document the assumption that all URLs passed into urldb are already normalised. Violate this precondition at your peril.
svn path=/trunk/netsurf/; revision=6371
2009-02-06 02:08:00 +00:00
John Mark Bell
6a0a7c346a Let's try that again. Now actually passes the regression tests.
svn path=/trunk/netsurf/; revision=6317
2009-01-31 03:03:50 +00:00
John Mark Bell
e2ebfb72f7 Fix urldb_match_path().
Fix test code.

svn path=/trunk/netsurf/; revision=6316
2009-01-31 02:49:26 +00:00
John Mark Bell
966b402881 urldb_destroy_path_tree() -> iteration
svn path=/trunk/netsurf/; revision=6315
2009-01-31 02:30:28 +00:00
John Mark Bell
9085c458d3 urldb_save_cookie_paths() -> iteration
svn path=/trunk/netsurf/; revision=6314
2009-01-31 02:16:01 +00:00
John Mark Bell
71e397eb84 Initialising variables helps
svn path=/trunk/netsurf/; revision=6313
2009-01-31 02:13:12 +00:00
John Mark Bell
92b3bdeda0 urldb_delete_cookie_paths() -> iteration
svn path=/trunk/netsurf/; revision=6312
2009-01-31 02:12:06 +00:00
John Mark Bell
45b222ab50 Make urldb_dump_paths iterate
svn path=/trunk/netsurf/; revision=6311
2009-01-31 02:02:01 +00:00
John Mark Bell
a1d409d922 Make urldb_match_path() iterate.
svn path=/trunk/netsurf/; revision=6310
2009-01-31 01:57:15 +00:00
John Mark Bell
376ef0ca47 Make urldb_iterate_entries_path use iteration
svn path=/trunk/netsurf/; revision=6304
2009-01-30 19:58:46 +00:00
John Mark Bell
e5c07a3a82 Pedantic linewrapping
svn path=/trunk/netsurf/; revision=6303
2009-01-30 19:47:15 +00:00
John Mark Bell
29fac74dcc Make urldb_iterate_partial_path iterate over the tree and not recurse.
svn path=/trunk/netsurf/; revision=6302
2009-01-30 19:43:54 +00:00
John Mark Bell
ffe288e50b This logic looked entirely wrong. Fix it to be more sane. If this breaks things, blame the lack of commentary.
svn path=/trunk/netsurf/; revision=6301
2009-01-30 19:09:26 +00:00
John Mark Bell
a2fbddea60 Minor optimisation
svn path=/trunk/netsurf/; revision=6300
2009-01-30 18:50:55 +00:00
John Mark Bell
a3f46b12ef Iterate when counting/writing out paths.
svn path=/trunk/netsurf/; revision=6299
2009-01-30 18:48:55 +00:00
John Mark Bell
79fdbab192 Jump through hoops, potentially squashing warnings.
svn path=/trunk/netsurf/; revision=5569
2008-10-13 23:45:08 +00:00
Daniel Silverstone
eaa744c0d2 Remove urldb_search_remove. Added hint for where to find it if we need it in future
svn path=/trunk/netsurf/; revision=5531
2008-10-10 11:54:37 +00:00
François Revel
f28f4cc760 First round of C89 fixes. Those should be obvious, hope I didn't introduce any side effect.
svn path=/trunk/netsurf/; revision=4788
2008-07-29 09:05:36 +00:00
James Bursa
f87138e5de Remove two unused functions.
svn path=/trunk/netsurf/; revision=4333
2008-06-14 23:17:50 +00:00
Rob Kendrick
59641def82 const fixes in plotters and history core
svn path=/trunk/netsurf/; revision=4083
2008-04-07 11:15:09 +00:00
John Mark Bell
46d135f42d Squash warning
svn path=/trunk/netsurf/; revision=3988
2008-03-19 18:36:16 +00:00
John Mark Bell
9597b5359c Drop support for URL file versions below 1.06
svn path=/trunk/netsurf/; revision=3945
2008-03-13 18:25:41 +00:00
John Mark Bell
2dadb5fac8 Forward compatible Cookie file loading/saving
Reduce amount of magic numbers

svn path=/trunk/netsurf/; revision=3944
2008-03-13 18:14:05 +00:00
John Mark Bell
3986abd20b Add testcase for non-fqdn -- already passes, but may as well keep it for regression testing.
svn path=/trunk/netsurf/; revision=3877
2008-03-03 13:21:02 +00:00
John Mark Bell
9164f247c2 Ensure plq is terminated when looking for an URL path.
Ensure fetchcache_redirect() normalizes the redirect destination.

svn path=/trunk/netsurf/; revision=3807
2008-01-30 01:44:57 +00:00
John Mark Bell
02e2fab6a3 More work on cookie parser. Our junk value handling is now significantly closer to that of other browsers.
+ Fix infinite loop when encountering a spurious \r
 + Values are only treated as quoted if the first non-whitespace character is "
 + Cookies are inserted into the db in the order of receipt. This brings our 
   Cookie: header ordering closer to other browsers (though this strictly 
   shouldn't matter -- no ordering is defined, other than by path specificity)
 + Fix testcase assertions to cope with new output ordering

svn path=/trunk/netsurf/; revision=3709
2008-01-19 01:51:39 +00:00
John Mark Bell
e5e2eb09f6 Work on cookies to bring our behaviour closer to the spec and other browsers:
+ Improve handling of quoted cookies -- now processes nested quotes correctly
  + Improve cookie output -- now knows which version it's outputting for and 
    processes things appropriately
  + Add assertion that we're dealing with a domain cookie in the case where the
    cookie domain and URL host part don't match during validation.
  + Tidy up fix for broken domain cookie setting -- it's now less confusing to 
    read.
  + Preserve cookie value quoting, regardless of its necessity.
  + Modify Cookie file format to save value_was_quoted flag -- version number 
    bumped to 101.
  + Add more testcases.

svn path=/trunk/netsurf/; revision=3708
2008-01-17 20:00:55 +00:00
John Mark Bell
2fa8e656a1 The previous fix was broken -- URI paths include the leafname.
Make url_path() return the full path (including the leafname).
Defaulted cookie path attributes have the leafname and trailing slash stripped.
Add testcase for defaulted path.
Fix testcase conditions for paths with leafnames.

svn path=/trunk/netsurf/; revision=3693
2008-01-07 12:01:11 +00:00
John Mark Bell
74078b6e36 Fix potential crash in urldb_dump()
Relax 4.3.2(i) checking (Cookie path must be a prefix of URL path). We now permit a cookie path containing the document leafname -- we strip the leafname from the path.
Make testsuite build again.
Add tests for cookie path checking.

svn path=/trunk/netsurf/; revision=3692
2008-01-07 04:58:06 +00:00
John Mark Bell
d1bf94dc4d Work around sites sending domain cookies for .foo.com from hosts such as bar.bat.foo.com, then expecting domain matching to succeed. This causes me pain.
svn path=/trunk/netsurf/; revision=3637
2007-10-30 23:19:03 +00:00
Vincent Sanders
2f864eeecc Update all source code file headers to reflect GPL version 2 only and contain appropriate licence text
svn path=/trunk/netsurf/; revision=3486
2007-08-08 16:16:03 +00:00