Commit Graph

170 Commits

Author SHA1 Message Date
Michael Drake
5fed462e88 urldb: Handle snprintf error 2022-10-23 17:22:56 +01:00
Vincent Sanders
402ad02ff5 remove unecessary use of gui_internal in content 2020-06-25 14:37:57 +01:00
Chris Young
178d4bc25c Fix some bsdsocket.library usage
NetSurf now builds against libcurl-AmiSSL
2019-04-08 12:49:13 +01:00
Vincent Sanders
7264ff6f4d ensure url buffer is sufficient to not truncate output 2018-11-06 21:58:53 +00:00
John-Mark Bell
842513f10b URLdb: fix comparison 2018-04-22 12:09:05 +00:00
John-Mark Bell
a6014cae15 HSTS: support policy in urldb 2018-04-22 11:39:12 +00:00
Vincent Sanders
8fb2fc6fc3 rationalise history icon bitmap handling to ensure correct lifetime 2017-09-10 16:06:38 +01:00
Vincent Sanders
75018632a9 Use coccinelle to change logging macro calls in c files
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);
2017-09-06 18:45:27 +01:00
Vincent Sanders
2467a0a990 fix coverity issue 1372473 Out-of-bounds write 2017-06-09 19:51:12 +01:00
Vincent Sanders
703427a486 Update documentation removing junk and moving to markdown for most text files 2017-06-09 17:30:00 +01:00
Vincent Sanders
2406acfeb3 fix urldb numerical v6 address handling 2017-03-13 23:44:06 +00:00
Vincent Sanders
27aa56cbf6 make the urldb content type setting API return an error 2017-03-13 21:55:39 +00:00
Vincent Sanders
92b5f114ba make urldb persistance setting API return an error 2017-03-13 21:19:59 +00:00
Vincent Sanders
5078bffad7 change urldb_set_title API to return an error status 2017-03-13 16:38:24 +00:00
Vincent Sanders
5ebec85282 actually check the generated database files against reference test data 2017-03-08 22:22:54 +00:00
Vincent Sanders
0da0dcc342 remove urldb_add_host and path from public API
The urldb_add_host and urldb_add_path API were only public for the
urldb test code which was calling them incorrectly in any case as the
url bloom filters were not updated so serialising and adding data to
entries was inconsistent.

This also changes the tests to use the urldb_add_url API which is less
buggy and results in a smaller, cleaner urldb API.
2017-03-08 13:27:00 +00:00
Vincent Sanders
b78887c7c8 make update data api return an result 2017-03-08 13:13:21 +00:00
Vincent Sanders
670110b171 use robust handling of time_t value (de)serialisation
The previous implementation was wrong on systems where time_t was not
an int type. This changes urldb to use the portable implementation
netsurf has available.
2017-03-08 10:54:17 +00:00
Vincent Sanders
c41d42644b clean up url database documentation comments and formatting 2017-03-06 23:21:12 +00:00
Vincent Sanders
a88254897b Revert "make urldb internal parse macros less prone to control flow errors"
This reverts commit 718da3ffff.
These macros are used in a way that causes safe macros to break
2017-03-05 15:28:05 +00:00
Vincent Sanders
718da3ffff make urldb internal parse macros less prone to control flow errors
fixes issue highlighted by coverity (CID 1361696)
2017-03-05 12:11:48 +00:00
Vincent Sanders
d9a2c7b9c1 fix some doxygen errors 2017-02-24 14:02:31 +00:00
Vincent Sanders
07c8ea22a5 fix unused variable warning on non public suffix library builds 2017-02-23 23:33:39 +00:00
Vincent Sanders
1ef1edc9e0 enable use of netsurf public suffix library to prevent supercookies 2016-09-20 21:45:35 +01:00
Vincent Sanders
e582497322 if the cookie is a session cookie indicate it
previously session cookies were simply displayed as having an expiry
in 1970 which was unhelpful.
2016-09-13 23:17:28 +01:00
Vincent Sanders
a91c7cdf04 make urldb parsing of ascii data explicit 2016-09-10 23:05:24 +01:00
Vincent Sanders
9176d3233f ensure url database destructor cleans up correctly 2016-08-09 13:15:02 +01:00
Vincent Sanders
115985f069 extend url database unit testing to cover more API 2016-08-09 12:26:37 +01:00
Vincent Sanders
c1aec1cfa0 fix urldb warning and test build 2016-08-08 13:52:54 +01:00
Vincent Sanders
05d2b9a92c update urldb dump to use LOG rather than writing to stderr directly 2016-08-08 13:44:18 +01:00
Vincent Sanders
976eca9958 msplit public url database API out for frontends 2016-06-13 23:34:45 +01:00
Vincent Sanders
2dab078f21 move bitmap API header to core include directory 2016-05-26 23:01:03 +01:00
Vincent Sanders
3224d7121a move image content handlers to accomodate core build changes 2016-05-23 23:32:16 +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
810e9153d1 urldb no longer uses curl directly but it does need correct network includes
The update to remove curl usage from urldb must pull in the utility
config header instead to get inet_aton and such or compoles on some
platforms fail.
2016-04-17 09:39:44 +01:00
Vincent Sanders
0bc5d2ca4c create date and time to seconds since epoch processing utility function
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.
2016-04-16 23:50:22 +01:00
Vincent Sanders
72308c1f0d revert urldb include fixes as tehy cause build issues elsewhere and failed to fix the warning 2016-02-12 15:55:13 +00:00
Vincent Sanders
fb95797862 fix more freebsd warnings 2016-02-12 15:45:49 +00:00
Michael Drake
58d9c98017 URLdb doesn't store 'mailto' urls, so add early exit to lookup. 2016-01-08 17:17:41 +00:00
Michael Drake
8e0e72368e Fix crazy indentation. 2016-01-08 17:17:11 +00:00
Vincent Sanders
0d811963c1 fixup all the remaining logging macro callsites
The semantic patch tool appears to have missed some difficult to
reason about callsites which have now been manually cleaned up
2015-05-28 17:06:18 +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
f37e52c394 Move bitmap operations into an operation table.
The generic bitmap handlers provided by each frontend are called back
from the core and therefore should be in an operation table. This was
one of the very few remaining interfaces stopping the core code from
being split into a library.
2015-04-13 23:19:04 +01:00
Vincent Sanders
8a99b045bc Remove url from content thumbnailers API
The content thumbnailers for each frontend were being provided the
contents url. This was only ever used to call the urldb thumbnail
setting API.

This changes it so the single callsite that passed a valid url adds
the bitmap to that url itself in desktop_history.c instead of forcing
every frontend to require the urldb API.

Additionally the old API could pass the url as NULL which was causing
asserts where this was not an expected parameter value. Because of
this this fixes bug #2286 which was also present in the monkey
frontend as both called nsurl_access() on the url without the NULL
check and caused an assertion.
2015-03-15 00:00:45 +00:00
Vincent Sanders
e32a2ad46e Doxygen fixes 2014-11-09 15:28:03 +00:00
Vincent Sanders
cf7abb4a0a restructure urldb source
remove forward declarations and restructure. exported functions are
also now documented in the urldb.h header.
2014-11-01 23:27:29 +00:00
Michael Drake
98b6d02df6 Move host_is_ip_address into urldb, as that's the only thing that cares. 2014-10-31 14:31:06 +00:00
Vincent Sanders
14e2829489 remove the die API from the core.
The die() API for abnormal termination does not belong within the core
of netsurf and instead errors are propogated back to the callers.

This is the final part of this change and the API is now only used within
some parts of the frontends
2014-10-26 12:42:53 +00:00
Michael Drake
e4ba144fe0 Remove unused #include
Persistent thumbnail code was ripped out of urldb ages ago.
2014-05-15 21:47:40 +01:00
Vincent Sanders
20b3c40816 make nsurl_defragment() API more obvious and remove duplicated parameter checking 2014-03-09 16:20:53 +00:00