pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wyeb-git: patch to check response status code before downloading files



Module Name:	pkgsrc-wip
Committed By:	Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By:	yhardy
Date:		Sun Nov 11 07:21:35 2018 +0200
Changeset:	d0332439e52e8af75e1b31b187e7d8c0426f74c5

Modified Files:
	wyeb-git/distinfo
	wyeb-git/patches/patch-main.c

Log Message:
wyeb-git: patch to check response status code before downloading files

The second part of the patch to main.c prevents wyeb from trying to download
urls which have failed (according to the http error code). This happens,
for example, when a proxy server denies access to a URL.

(wip/luakit{,-git} has the same issue.)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d0332439e52e8af75e1b31b187e7d8c0426f74c5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 wyeb-git/distinfo             |  2 +-
 wyeb-git/patches/patch-main.c | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diffs:
diff --git a/wyeb-git/distinfo b/wyeb-git/distinfo
index 7ac62cd8ee..948ba66ea1 100644
--- a/wyeb-git/distinfo
+++ b/wyeb-git/distinfo
@@ -1,3 +1,3 @@
 $NetBSD$
 
-SHA1 (patch-main.c) = a829c08e71a538c4d10b90ab6efa0c40676d2bb6
+SHA1 (patch-main.c) = e9ae1b5d73c9e03cd662eea68e8a6bfd5375e8b5
diff --git a/wyeb-git/patches/patch-main.c b/wyeb-git/patches/patch-main.c
index 465a24280b..cbe8428d34 100644
--- a/wyeb-git/patches/patch-main.c
+++ b/wyeb-git/patches/patch-main.c
@@ -2,6 +2,9 @@ $NetBSD$
 
 Use the correct data type for modification time.
 
+The second part of the patch prevents wyeb from trying to download
+urls which have failed (according to the http error code).
+
 --- main.c.orig	2018-11-10 14:18:57.000000000 +0000
 +++ main.c
 @@ -2895,7 +2895,7 @@ static char *histdata(bool rest, bool al
@@ -13,3 +16,13 @@ Use the correct data type for modification time.
  	for (int j = 2; j > 0; j--) for (int i = histfnum - 1; i >= 0; i--)
  	{
  		if (!rest && size && num >= size) break;
+@@ -3948,6 +3948,9 @@ static gboolean policycb(
+ 	WebKitResponsePolicyDecision *rdec = dec;
+ 	WebKitURIResponse *res = webkit_response_policy_decision_get_response(rdec);
+ 
++	if(!SOUP_STATUS_IS_SUCCESSFUL(webkit_uri_response_get_status_code(res)))
++		return false;
++
+ 	bool dl = false;
+ 	char *msr = getset(win, "dlmimetypes");
+ 	//for checking whether is sub frame or not.


Home | Main Index | Thread Index | Old Index