Fw: Use nsws_find_resource to find ca-bundle.crt
by James Woodcock
Resending this to the mailing list.
On Fri, Jul 28, 2017 at 09:50:00 +0000, Daniel Silverstone wrote:
> On Thu, Jul 27, 2017 at 21:06:21 +0000, James Woodcock wrote:
> > I have attached a patch, which should do the trick.
> Unfortunately it turned up mangled. Can you please ensure you attach it rather than paste it in?
Sorry about that. I have attached the patch to this email.
5 years, 10 months
Use nsws_find_resource to find ca-bundle.crt
by James Woodcock
I cross compiled the Windows version of NetSurf on Linux and ran it under Wine. It failed to find the ca-bundle.crt file.
I think nsws_find_resource() should be used to find the file instead of the Windows SearchPathA() API so that NetSurf will look in the NetSurf resources directory.
I have attached a patch, which should do the trick.
diff --git a/frontends/windows/main.c b/frontends/windows/main.cindex d019f10..8e86a29 100644--- a/frontends/windows/main.c+++ b/frontends/windows/main.c@@ -156,32 +156,14 @@ static nserror set_defaults(struct nsoption_s *defaults) /* locate CA bundle and set as default, cannot rely on curl * compiled in default on windows. */- DWORD res_len;- DWORD buf_tchar_size = PATH_MAX + 1;- DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size;- char *ptr = NULL;- char *buf;+ char buf[PATH_MAX]; char *fname; HRESULT hres; char dldir[] = "Downloads";
- buf = malloc(buf_bytes_size);- if (buf== NULL) {- return NSERROR_NOMEM;- }- buf[0] = '\0';- /* locate certificate bundle */- res_len = SearchPathA(NULL,- "ca-bundle.crt",- NULL,- buf_tchar_size,- buf,- &ptr);- if (res_len > 0) {- nsoption_setnull_charp(ca_bundle, strdup(buf));- }-+ nsws_find_resource(buf, "ca-bundle.crt", "windows/res/ca-bundle.crt");+ nsoption_setnull_charp(ca_bundle, strdup(buf));
/* download directory default *@@ -204,8 +186,6 @@ static nserror set_defaults(struct nsoption_s *defaults) } }
- free(buf);- /* ensure homepage option has a default */ nsoption_setnull_charp(homepage_url, strdup(NETSURF_HOMEPAGE));
5 years, 10 months
Windows redraw issue when resizing screen
by James Woodcock
I noticed that the redraw logic goes a bit funny when you maximise the browser window on Windows. A race condition with WM_PAINT can cause win32_window_set_scroll() to use the old window size. If this happens, the page data will not get drawn from the top left of the window but offset quite a large distance down and to the right.
To recreate:
1. start NetSurf and resize the browser window to be 1/2 size of the screen
2. load a page (any page will do)
3. click the maximise window button
It usually fails, but you might need to give it a few tries.
The following patch fixes it.
diff --git a/frontends/windows/window.c b/frontends/windows/window.c
index 976974c..0addc35 100644
--- a/frontends/windows/window.c
+++ b/frontends/windows/window.c
@@ -1366,7 +1366,7 @@ nsws_window_resize(struct gui_window *gw,
}
nsws_window_update_forward_back(gw);
- win32_window_set_scroll(gw, &rect);
+ browser_window_update(gw->bw, false);
if (gw->toolbar != NULL) {
SendMessage(gw->toolbar, TB_SETSTATE,
5 years, 10 months
Re: toolchains: branch master updated. c113b768e24439447e0306011ca2743606f227f9
by John-Mark Bell
On 09/05/17 23:13, NetSurf Browser Project (Commit Mailer) wrote:
> Gitweb links:
>
> ...log http://git.netsurf-browser.org/toolchains.git/shortlog/c113b768e24439447e...
> ...commit http://git.netsurf-browser.org/toolchains.git/commit/c113b768e24439447e03...
> ...tree http://git.netsurf-browser.org/toolchains.git/tree/c113b768e24439447e0306...
>
> The branch, master has been updated
> via c113b768e24439447e0306011ca2743606f227f9 (commit)
> from eb01b89e3e2cd6f74053b825cd1a31e07a60dd36 (commit)
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
>
> - Log -----------------------------------------------------------------
> commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=c113b768e2443944...
> commit c113b768e24439447e0306011ca2743606f227f9
> Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
> Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
>
> Set an OpenSSL environment path
> OpenSSL sometimes tries to read a config file which by default is in /opt. On AmigaOS this causes a request for volume opt:
> The way NetSurf uses curl/openssl doesn't appear to trigger this, but adding the option as a precaution as I've seen the problem with this OpenSSL build when used in other software.
>
> diff --git a/sdk/Makefile b/sdk/Makefile
> index 47efd13..629ddc8 100644
> --- a/sdk/Makefile
> +++ b/sdk/Makefile
> @@ -114,6 +114,7 @@ ifeq ($(TARGET),ppc-amigaos)
> SDK_ITEMS := $(addprefix $(BUILDSTEPS)/, libiconv.d libtre.d libpbl.d $(COMMON_SDK_ITEMS) libjpeg-turbo.d)
> EXTRAARGS_LIBCARES := --disable-shared
> EXTRAARGS_LIBCURL := --disable-ntlm-wb --without-random --enable-threaded-resolver LIBS=-lpthread
> + EXTRAARGS_OPENSSL := --openssldir="/env/openssl"
> endif
>
> ifeq ($(TARGET),i686-w64-mingw32)
>
I'm afraid I've had to revert this change, as it breaks CI toolchain
builds[1]: --openssldir overrides --prefix, and so this change causes
the OpenSSL buildsystem to try to install into /env/openssl, rather than
{PREFIX}/ssl. /env does not exist, and thus this fails (and, even if it
did exist, and was writable, you'd still end up with a toolchain tarball
that didn't contain OpenSSL, and a build environment that no longer
worked, as OpenSSL headers and libraries would no longer be found).
If the problem this change is trying to solve is that, at runtime, in
the absence of an explicitly provided path to openssl.cnf, it will
default to looking in the computed openssldir (i.e. {prefix}/ssl), then
you're probably better off patching lines 83-86 of crypto/cryptlib.h to
ignore OPENSSLDIR on AmigaOS (as these macros are the only thing that
determines where OpenSSL looks for things by default).
J.
1. http://ci.netsurf-browser.org/jenkins/job/toolchain-ppc-amigaos/60/
5 years, 11 months