Commit Graph

263 Commits

Author SHA1 Message Date
Vincent Sanders
7d9c9dba36 Split utils header into string functions and everything else
split out the string handling API from the rest of the utils header
and fix up all the fallout.
2016-04-21 22:36:21 +01:00
Vincent Sanders
798654f910 remove curl fetchers use of the wallclock API
The wallclock() API uses gettimeofday which can be affected by the the
systems clock being changed etc. The curl fetcher usage of this API is
to generate a timing delta and does not cope with the gettimeofday
issues.

This changes the fetcher to use the nsutils library monotonic time
function which does not suffer from the issues with gettimeofday.
2016-04-19 14:18:09 +01:00
Vincent Sanders
afea659fef move dir_sort_alpha function from generic utils to one specific place it is used 2016-04-19 12:01:05 +01:00
Vincent Sanders
1bc010665e Reduce unecessary use of directory entry headers
The config header was causing many source files to unecessarily
include the dirent headers causing extra dependancies. This has been
fixed by providing a utility dirent header that provides a common API
across all platforms while removing the unecessary dirent header usage.
2016-04-19 11:21:06 +01:00
Vincent Sanders
ade0cd8bb9 Reduce unecessary use of networking headers
The utility configuration header dragged in a number of bsd sockets
and related API as a side effect of setting up the configuration. By
splitting the header and API setup into a separate header only the
small number of places that need the functionality explitly include
it.
2016-04-17 13:42:28 +01:00
Vincent Sanders
d15ab96a51 Fix size_t printf formatting
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.
2016-03-17 22:00:54 +00:00
Michael Drake
4055ecf796 Tiny simplification of curl debug logging. 2016-01-21 09:27:27 +00:00
Michael Drake
401cc36924 Add extra logging to curl poll fn when not suppressing curl debug. 2015-11-11 10:39:12 +00:00
Daniel Silverstone
4d1ef3bac4 Add support for retrying timed-out cURL fetches.
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.
2015-11-10 21:51:54 +00:00
Vincent Sanders
e9b89f776d Allow the resource scheme to provide data directly.
This allows front ends to provide resources from compiled in data
instead of requiring the resources to be available on disc and forcing
a redirect.
2015-06-17 21:35:40 +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
a487f7e611 Move win32 window operations into their own module
This splits up a great deal of the win32 window code out from other
gui code. It also remove large quantities of unused and junk
variables and functions.
2015-03-12 23:48:53 +00:00
Vincent Sanders
669df172ec Fix my spelling of teh everywhere 2014-11-18 17:16:26 +00:00
Vincent Sanders
d4c7a0ff77 Improve data scheme fetcher allocation
The data scheme fetcher was over allocating the space for decoded
base64 encoded urls and not using the base64 API that allocated the
correct size storage.
2014-11-17 16:05:17 +00:00
Vincent Sanders
71d016aba5 Remove unecessary form debug
Additionaly we make the curl fetcher report errors instead of
uninitialised buffer.
2014-11-15 18:23:44 +00:00
Vincent Sanders
56bb1b03c5 Doxygen cleanups 2014-11-09 12:50:30 +00:00
Vincent Sanders
8f64d5d223 Improve Doxygen documentation 2014-11-08 12:35:11 +00:00
Vincent Sanders
53f0f432dd update fetcher registration API to return an error code.
By using an error code return we can gracefully handle fetcher
registration faliures instead of just immediately aborting.

The curl handler was also cleaned up and documentation improved
as a side effect.
2014-10-25 17:15:23 +01:00
Michael Drake
6b846c363d Add trivial maps facilitator at about:maps
This is a simple HTML front end for the Google Static Maps API, since
we don't yet have enough JS support for the full Google Maps.

See:
  https://developers.google.com/maps/documentation/staticmaps/
2014-10-22 20:42:21 +01: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
John-Mark Bell
b2242c57e1 HTTPS: disable all SSL versions; emit fallback SCSV on downgrade.
This removes all support for SSL and (with help from servers that
support the fallback SCSV) protects against inappropriate protocol
downgrade.
2014-10-15 12:02:25 +01:00
Vincent Sanders
02bbaa3e88 split version info into its own header and remove unnecessary nesurf.h includes
The netsurf.h header should *only* contain the registration, core
initialisation and finalisation methods. Version information is best
placed in its own header.

Also remove any unneeded inclusion of this header limiting it to
solely the places the relevant API is required.
2014-10-13 15:08:16 +01:00
Vincent Sanders
1a2040bc72 Trivial sepelling, documentation and whitespace cleanups 2014-10-10 13:01:20 +01:00
Vincent Sanders
c695d3d007 memcpy and terminate from openssl buffers
The memcpy is used instead of snprintf as the source data may not be null terminated and was
 causing OpenBSD to segfault.
2014-09-03 14:27:25 +01:00
Vincent Sanders
5492e96793 terminate buffers from X509_NAME_print_ex() 2014-09-02 23:30:37 +01:00
Vincent Sanders
1b7aa7ffe5 make fetchers scheduled 2014-06-26 19:05:59 +01:00
Vincent Sanders
4b2101ba6a clean up the fetcher factory and improve its API 2014-06-19 18:27:24 +01:00
Rob Kendrick (fatigue)
7b1332c5c5 Include the date in the testament 2014-06-04 12:10:42 +01:00
Vincent Sanders
00b6cfc57e rework path to url mapping functions to convert from and to nsurl 2014-05-26 23:52:36 +01:00
Vincent Sanders
a6d3ceae0e Completely re-write web search provider handling 2014-05-25 01:01:59 +01:00
Vincent Sanders
2326d3c503 remove unecessary utils/url.h includes 2014-05-09 10:15:42 +01:00
Vincent Sanders
c56642819e add file operations table and make all frontends use it.
This rationalises the path construction and basename file
operations. The default implementation is POSIX which works for all
frontends except windows, riscos and amiga which have differeing path
separators and rules.

These implementations are significantly more robust than the previous
nine implementations and also do not use unsafe strncpy or buffers
with arbitrary length limits.

These implementations also carry full documentation comments.
2014-05-07 16:24:51 +01:00
Vincent Sanders
b7b3496a78 move testament output to object directory instead of modifying source 2014-04-08 11:41:58 +01:00
Vincent Sanders
87f6314dab move scheduleing into browser operation table 2014-03-09 15:37:40 +00:00
John-Mark Bell
823aad5ddf Use libcurl's cache if it's new enough. Fixes #2064. 2014-02-06 01:19:22 +00:00
Vincent Sanders
db33103fa3 clean up desktop/gui.h include usage 2014-01-29 21:35:53 +00:00
Vincent Sanders
8ce0a10670 move path_to_url and url_to_path to fetch operation table 2014-01-25 23:01:32 +00:00
Michael Drake
14238615a4 Use corestrings for "about", "data", and "resource". 2014-01-24 20:08:41 +00:00
Michael Drake
e32dc31b04 Use corestring ref. 2014-01-24 19:58:51 +00:00
Michael Drake
178f3945b8 Just use corestring refs. 2014-01-24 19:31:50 +00:00
Vincent Sanders
0475693394 create table for fetcher operations and move all operations into it 2014-01-23 00:00:18 +00:00
John-Mark Bell
4a014b61be Enable TLS 1.2 support again. 2014-01-19 22:57:16 +00:00
Vincent Sanders
38cb39339a move filename_from_path and path_add_part into gui operation tables 2014-01-16 00:01:25 +00:00
Vincent Sanders
bd065d4a43 split browser gui operations up 2014-01-15 19:37:05 +00:00
Vincent Sanders
0075eab194 move remaining gui operations to table 2014-01-14 23:31:54 +00:00
Daniel Silverstone
b4f9860848 Remove logging now that file upload *seems* to work 2014-01-04 22:05:23 +00:00
Daniel Silverstone
de42f8880e Add a bunch of logging to try and help track down the issue with rawfile handling, sorry guys 2014-01-04 21:20:17 +00:00
Daniel Silverstone
581d877576 In theory, store raw filenames and pass them through for file upload. Untested due to no file-upload in GTK frontend just yet 2014-01-04 19:34:18 +00:00
Michael Drake
c56fb9259b Enable access to hotlist icons through resource URLs. 2013-11-20 22:03:07 +00:00
Michael Drake
c933b0aff9 Sort non zero-padded numerical filename parts correctly. 2013-11-14 21:01:51 +00:00
Michael Drake
5e4e32923d Can just use scandir now. 2013-11-14 19:02:35 +00:00
Michael Drake
7a920ace39 Marginally cleaner handling of scandir absence. 2013-11-11 11:38:48 +00:00
Michael Drake
74d430f44a Dirty special casing of Windows, to handle mingw dirent.h's lack of scandir and alphasort. 2013-11-11 10:58:55 +00:00
Michael Drake
8a72d5be84 Sort directory contents. 2013-11-10 22:02:12 +00:00
Michael Drake
61b5a5e98f Visual indication of hotlist's folder for unsorted entries, with special icon. 2013-11-08 18:53:34 +00:00
Michael Drake
0d03a342d9 Clean up cached fetch handles. 2013-10-24 18:12:18 +01:00
Michael Drake
9ea65f652a Fix Coverity #1109871. 2013-10-23 15:04:51 +01:00
Michael Drake
f0b8594c46 Add arrow image to resource icons. 2013-08-12 16:34:14 +01:00
Michael Drake
44e4ca5f05 Merge branch 'master' of git://git.netsurf-browser.org/netsurf 2013-06-05 12:28:08 +01:00
Vincent Sanders
4d39d4314c only set no proxy value in modern enough versions of teh library 2013-06-04 18:30:22 +01:00
Vincent Sanders
4e24869524 Add and use no proxy list option 2013-06-04 18:11:15 +01:00
Michael Drake
a2c6f90330 Add icons to resource space. 2013-05-31 10:00:59 +01:00
Vincent Sanders
68c2013504 add provenance to about:config 2013-05-28 21:36:46 +01:00
Vincent Sanders
1502b08925 move option init out of netsurf_init 2013-05-28 14:16:11 +01:00
Vincent Sanders
ee6e6eec05 move options include 2013-05-28 14:16:10 +01:00
Vincent Sanders
95e726c7cc split sources lists out to their subdirectories as first step towards using core buildsystem 2013-03-11 17:53:52 +00:00
John-Mark Bell
3dff750ae2 Downgrade TLS version support if it turns out the server can't cope with TLSv1.1. 2013-01-04 23:13:23 +00:00
Daniel Silverstone
413248d0fc Rough implementation of httponly cookie support 2012-11-09 11:38:46 +00:00
John-Mark Bell
aa438d34d2 Only disable TLS1.2 if it can be disabled. 2012-11-04 16:01:05 +00:00
John-Mark Bell
c2c2fc959e Disable TLS1.2 support. 2012-11-04 15:54:28 +00:00
John-Mark Bell
debe0e345b Disable SSL session ID caching. 2012-11-04 14:07:22 +00:00
John-Mark Bell
9924bcf850 Revert "Enable verbose curl debug"
This reverts commit f5a98defae.
2012-11-04 12:01:51 +00:00
John-Mark Bell
f5a98defae Enable verbose curl debug 2012-11-04 11:11:54 +00:00
John-Mark Bell
0586b97f25 Revert "Suppress BEAST workaround."
This reverts commit d31e8a7b29.
2012-11-04 10:57:33 +00:00
John-Mark Bell
d31e8a7b29 Suppress BEAST workaround. 2012-11-04 10:39:24 +00:00
Michael Drake
a668f327ba Merge branch 'master' of git://git.netsurf-browser.org/netsurf 2012-10-11 11:21:27 +01:00
John-Mark Bell
43724acf94 Fix bug #3576005: partial file means finished, not error. 2012-10-10 23:48:33 +01:00
Michael Drake
55bef354a6 Port to new urldb. 2012-10-08 20:33:17 +01:00
Daniel Silverstone
9cb4d00ea9 If you pass CI_BUILD=xxx to make, it will build a CI #xxx into the version string and also mention it in the testament 2012-10-06 18:12:57 +01:00
Michael Drake
29ad56b4b2 Use nsurl_parent. 2012-10-06 14:07:34 +01:00
Michael Drake
346b061d7b Remove unused #include. 2012-10-05 18:29:17 +01:00
John-Mark Bell
c22fbf9377 Avoid trying to mmap zero-length files.
Remove buf size limit in mmap case: prevented processing entire file.
2012-09-19 22:50:28 +01:00
Vincent Sanders
f58b5924a5 alter file fetcher to use mmap where available 2012-08-13 17:00:43 +01:00
Vincent Sanders
de982b4d3e fix windows build format specifiers
add install target for windows - creates installer rather than actually installing
2012-08-12 21:52:39 +01:00
Michael Drake
a2dadbbe12 Add about:welcome handler and enable resource:welcome.html. 2012-07-21 13:12:51 +01:00
Vincent Sanders
9b85ae106b limit url debug output to 140 characters 2012-07-03 14:32:13 +01:00
Daniel Silverstone
0437f81c55 Testament generation now supports git
svn path=/trunk/netsurf/; revision=13946
2012-06-04 15:48:21 +00:00
Chris Young
9458ed77ab Add support for sending DoNotTrack header.
svn path=/trunk/netsurf/; revision=13928
2012-05-20 16:29:57 +00:00
Michael Drake
3f262e4803 Remove image cache status from user-facing listing.
svn path=/trunk/netsurf/; revision=13865
2012-04-13 12:29:52 +00:00
Michael Drake
cdee9e985e More work on about:imagecache entry listing table.
svn path=/trunk/netsurf/; revision=13855
2012-04-12 13:43:57 +00:00
Michael Drake
e2e69d29bb Close paragraph tags and other minor imagecache page cleanups.
svn path=/trunk/netsurf/; revision=13854
2012-04-12 13:06:21 +00:00
Michael Drake
5266539f92 Make more readable and fix use double quotes for href attribute value.
svn path=/trunk/netsurf/; revision=13852
2012-04-12 12:34:33 +00:00
Chris Young
87b9a905eb Fix typo and unhide imagecache from about:about
svn path=/trunk/netsurf/; revision=13823
2012-04-07 17:30:54 +00:00
Rob Kendrick
e6155dd37f about:imagecache gives URL links, and table is styled. This has revealed a buffer overflow or similar here; reducing the buffer size to 1024 makes it very fragile with long URLs.
svn path=/trunk/netsurf/; revision=13700
2012-03-25 16:42:45 +00:00
Vincent Sanders
1490b52a6b NetSurf options rework (a=vince r=daniels,jmb)
svn path=/trunk/netsurf/; revision=13548
2012-03-22 09:34:34 +00:00
Michael Drake
20583d7288 Enable User CSS file.
svn path=/trunk/netsurf/; revision=13507
2012-03-06 17:44:24 +00:00
Michael Drake
714f07c48b Rename nsurl_enquire to nsurl_has_component.
svn path=/trunk/netsurf/; revision=13183
2011-11-27 18:32:06 +00:00
John Mark Bell
07309888d6 return;
Fix bug #3442642: allow scheme-specific fetchers to have a say in whether an URL can be fetched.

svn path=/trunk/netsurf/; revision=13182
2011-11-27 14:14:36 +00:00
John Mark Bell
dcbafe6b87 Clean up fetch callback API. Inject some long-needed type safety.
svn path=/trunk/netsurf/; revision=13137
2011-11-08 21:51:42 +00:00
John Mark Bell
da2b1ce44d Hack around curl complaining about junk gzip streams
svn path=/trunk/netsurf/; revision=13129
2011-11-05 22:10:46 +00:00