Commit Graph

332 Commits

Author SHA1 Message Date
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
Michael Drake bae61d9224 Periodically reflow the page while fetching a page's objects. Make buffer all rendering default.
svn path=/trunk/netsurf/; revision=3874
2008-02-29 23:03:26 +00:00
John Mark Bell 85bb19c93d Mark old contents as stale if a conditional request succeeded so they'll be flushed from the cache as soon as they're unused.
svn path=/trunk/netsurf/; revision=3872
2008-02-27 19:13:35 +00:00
John Mark Bell 3a79bcb3da Explicitly mark error pages as non-fresh so they'll get purged from the cache ASAP.
svn path=/trunk/netsurf/; revision=3871
2008-02-27 18:48:35 +00:00
John Mark Bell 89793c2171 Make content_reset actually do what it's meant to (i.e. reset the appropriate members)
Fix up CONTENT_MSG_REFRESH scheduled events to gracefully the refresh URL disappearing from under them.

svn path=/trunk/netsurf/; revision=3870
2008-02-27 18:38:41 +00:00
John Mark Bell 7f70acaca6 Silence noisy logging
svn path=/trunk/netsurf/; revision=3830
2008-02-03 18:21:49 +00:00
John Mark Bell ad6fcea6b0 Add url_fragment to extract fragment from URL
Optionally allow url_compare to ignore fragments in comparison
Fix handling of url_compare result in a few places
Fix redirects which contain fragments in the Location header

svn path=/trunk/netsurf/; revision=3826
2008-02-03 12:04:48 +00:00
John Mark Bell cc3481a2ff Make core fetching code handle verifiability of transactions
Make core fetching code be responsible for inserting cookies into the urldb
Provide accessor to a fetch's parent url (this is defined as being the URL of the verifiable fetch which caused this one to occur)
Make fetchcache's 3xx handling use the parent url when spawning new fetches

svn path=/trunk/netsurf/; revision=3809
2008-01-30 19:56:41 +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 78d194cb77 Rework handling of HTTP redirects -- we now count the number of redirects followed for a given item and abort if a fixed limit is reached. This fixes sites which have pages that redirect to themselves.
Redirect handling is now transparent to clients of fetchcache.

The new scheme works as follows:

1) Request content for URL (fetchcache()
2) Start fetch of content (fetchcache_go()
3) If no redirect, continue through LOADING, READY, DONE etc. states as before
   If redirect, receive NEWPTR for each redirect that occurs, then continue
   through LOADING, READY, DONE etc. states as before.

The upshot of this is that redirects result in extra contents being created. It also means that, until LOADING has been received, the content (and thus the URL being fetched) may change. Therefore, fetchcache clients should expect to have to deal with transient data prior to LOADING occurring.

As a necessary side-effect of this, the HTML object URLs and CSS @import URLs are no longer stored alongside the relevant contents. These URLs can be accessed by interrogating the url member of struct content anyway, so it was a rather redundant scheme before.

svn path=/trunk/netsurf/; revision=3787
2008-01-28 01:35:00 +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
James Bursa 07c54283e3 Move window scaling from platform-specific code to desktop/browser.c. Modify gtk gui to handle scaling in the same way as RO.
svn path=/trunk/netsurf/; revision=3478
2007-08-07 03:55:18 +00:00
John Mark Bell 81f3fcbafd Fix crash when building error page -- fetch will be NULL, so fetch_get_referer will fail.
svn path=/trunk/netsurf/; revision=3476
2007-08-06 22:17:04 +00:00
John Mark Bell 40b1c80896 Ensure option strings aren't blank before setting headers: previously, a blank option string could result in "Accept-Language: , *;q=0.1" being sent, for example.
svn path=/trunk/netsurf/; revision=3450
2007-07-21 08:53:00 +00:00
Michael Drake d2c3d22f52 Change ArtWorks file MIME type to "image/x-artworks".
svn path=/trunk/netsurf/; revision=3449
2007-07-21 00:20:04 +00:00
John Mark Bell 04fb714f8e Add SVG content name to content_type_name array.
svn path=/trunk/netsurf/; revision=3448
2007-07-21 00:14:15 +00:00
Rob Kendrick 1522bfeed6 Add incremental parsing of SVG data to librsvg content handler.
svn path=/trunk/netsurf/; revision=3441
2007-07-19 13:47:59 +00:00
Rob Kendrick 04292695be Initial work on RSVG image handler. Still a lot to do.
svn path=/trunk/netsurf/; revision=3433
2007-07-18 17:58:35 +00:00
Rob Kendrick 59f358eb0f Wrap internal SVG renderer with appropriate #ifdef WITH_NS_SVG
svn path=/trunk/netsurf/; revision=3432
2007-07-18 14:49:26 +00:00
James Bursa afc9517fbd Add CONTENT_SVG to content handling.
svn path=/trunk/netsurf/; revision=3406
2007-07-13 03:54:47 +00:00
John Mark Bell 17ab65e69a Fix uninitialised fetch structure entries.
This was causing the Referer header to be sent regardless (assuming the referer string was non-NULL).

svn path=/trunk/netsurf/; revision=3387
2007-07-08 11:35:53 +00:00
James Bursa 594eb74c4c Fix deadlock when fetching stylesheets when max_fetchers_per_host is reached by splitting fetch_can_be_freed() into fetch_remove_from_queues() and fetch_free().
svn path=/trunk/netsurf/; revision=3380
2007-07-04 18:44:13 +00:00
James Bursa 960c11de1a Rename register_curl_fetchers() to fetch_curl_register(). Add declarations for static functions and reorder functions.
svn path=/trunk/netsurf/; revision=3379
2007-07-04 18:05:16 +00:00
Daniel Silverstone e2d0019119 Add option_suppress_curl_debug and default it to true
svn path=/trunk/netsurf/; revision=3373
2007-06-27 16:27:52 +00:00
Daniel Silverstone 82c4458689 Only pass option_ca_bundle and option_ca_path to cURL if they are non-empty.
svn path=/trunk/netsurf/; revision=3372
2007-06-27 16:13:54 +00:00
Daniel Silverstone e91cfc8e47 Add ca_path option which sets CURLOPT_CAPATH.
svn path=/trunk/netsurf/; revision=3369
2007-06-27 15:39:56 +00:00
Daniel Silverstone 18edcf5a40 Move the p->parent check in urldb to before the cookie loop. Prevents the cookie stuff exploding on domain cookies with no path. Fixes breakage with visiting launchpad.net
svn path=/trunk/netsurf/; revision=3368
2007-06-27 15:35:30 +00:00
John Mark Bell 92fd7ff871 Fix cookie domain matching in unverifiable transactions.
Minor tidying.

svn path=/trunk/netsurf/; revision=3337
2007-06-10 19:59:29 +00:00
Daniel Silverstone e671fe3707 Add debug about ring sizes. Ensure we dispatch queued jobs when a job is freed.
svn path=/trunk/netsurf/; revision=3333
2007-06-10 18:12:30 +00:00
John Mark Bell 87ca206e13 Warning fixes.
svn path=/trunk/netsurf/; revision=3332
2007-06-10 18:08:22 +00:00
Daniel Silverstone e6d754cc96 Remove a time consuming LOG(()) and add some whitespace to help me think
svn path=/trunk/netsurf/; revision=3331
2007-06-10 17:55:07 +00:00
Daniel Silverstone 1dd7e97eb3 Merge scheme switcher branch in.
svn path=/trunk/netsurf/; revision=3330
2007-06-10 17:46:44 +00:00
Daniel Silverstone 6807b4208a Remove the netsurf/ from the include paths and rationalise use of <> vs "" in includes
NetSurf includes are now done with ""s and other system includes with <>s as C intended.
The scandeps tool has been updated to only look for ""ed includes, and to verify that the
files exist in the tree before adding them to the dependency lines. The depend rule has
therefore been augmented to make sure the autogenerated files are built before it is run.

This is untested under self-hosted RISC OS builds. All else tested and works.


svn path=/trunk/netsurf/; revision=3307
2007-05-30 22:39:54 +00:00
Daniel Silverstone 25e22eb1f5 Add a -v option to enable debug logging. Pass -v by default to the RO runimage.
svn path=/trunk/netsurf/; revision=3306
2007-05-30 22:27:58 +00:00
James Bursa 5d2a2c42b2 Log curl_version() in fetch_init().
svn path=/trunk/netsurf/; revision=3267
2007-05-06 05:55:13 +00:00
James Bursa d0db5ed413 Fix warning: field precision should have type 'int', but argument 4 has type 'long int'.
svn path=/trunk/netsurf/; revision=3262
2007-05-02 03:06:52 +00:00
James Bursa 21407fe8ab Fix some warnings in recent gcc.
svn path=/trunk/netsurf/; revision=3261
2007-05-02 02:47:39 +00:00
James Bursa 0547422534 Move user-agent generation into fetch.c and simplify.
svn path=/trunk/netsurf/; revision=3260
2007-05-02 02:38:38 +00:00
John Mark Bell b229c41e9c 1) Fix corruption of history data structure on cloning
2) Only destroy urldb's thumbnail bitmap if it's not the same as the new 
   one. This needs revisiting at a later date such that the mess 
   surrounding who owns bitmap objects is sorted (and so that urldb 
   doesn't need to know about bitmaps)

svn path=/trunk/netsurf/; revision=3243
2007-04-07 20:30:39 +00:00
John Mark Bell f059818d74 Squash memory leak
svn path=/trunk/netsurf/; revision=3235
2007-04-05 12:33:12 +00:00
John Mark Bell ccfc0e7516 Fix abort on attempted destruction of CONTENT_DIRECTORY (1690222)
svn path=/trunk/netsurf/; revision=3228
2007-03-28 22:56:54 +00:00
John Mark Bell 91cfb11592 Fix crash on WWW-Authenticate header with no realm (1686714)
svn path=/trunk/netsurf/; revision=3216
2007-03-23 22:39:10 +00:00
John Mark Bell f261e4426a Lose noisy logging
svn path=/trunk/netsurf/; revision=3213
2007-03-18 23:48:12 +00:00
John Mark Bell 947ab0dcd2 Ensure content structures are zero initialised.
Make css_destroy check that the stylesheet pointer exists (content 
destructors may be called whilst the content is still loading - e.g. if 
the content type isn't permissable in the context it was loaded from).
Fixes 1627413, 1580980.

svn path=/trunk/netsurf/; revision=3212
2007-03-18 20:19:13 +00:00
John Mark Bell 0d750eac73 Improve debug output so that content usage may be traced
svn path=/trunk/netsurf/; revision=3210
2007-03-18 17:04:18 +00:00