public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 66a0f3646ad2b1da568282464b9a63479c8b45d9
Date: Wed, 28 Mar 2018 16:45:42 +0100	[thread overview]
Message-ID: <20180328154542.9F56A1081DF2@git01.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  66a0f3646ad2b1da568282464b9a63479c8b45d9 (commit)
      from  9f0999325dec7ffbcf8b18b846fbf6a8a6c5780f (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 -----------------------------------------------------------------
commit 66a0f3646ad2b1da568282464b9a63479c8b45d9
Author: Peter Müller <peter.mueller(a)link38.eu>
Date:   Wed Mar 28 05:41:50 2018 +0200

    use protocol defined in server-list.db for mirror communication
    
    For each mirror server, a protocol can be specified in the
    server-list.db database. However, it was not used for the
    actual URL query to a mirror before.
    
    This might be useful for deploy HTTPS pinning for Pakfire.
    If a mirror is known to support HTTPS, all queries to it
    will be made with this protocol.
    
    This saves some overhead if HTTPS is enforced on a mirror
    via 301 redirects. To enable this, the server-list.db
    needs to be adjusted.
    
    The second version of this patch only handles protocols
    HTTP and HTTPS, since we do not expect anything else here
    at the moment.
    
    Partially fixes #11661.
    
    Signed-off-by: Peter Müller <peter.mueller(a)link38.eu>
    Cc: Michael Tremer <michael.tremer(a)ipfire.org>
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 src/pakfire/lib/functions.pl | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Difference in files:
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl
index c97d4254d..6cc177128 100644
--- a/src/pakfire/lib/functions.pl
+++ b/src/pakfire/lib/functions.pl
@@ -31,6 +31,8 @@ use HTTP::Message;
 use HTTP::Request;
 use Net::Ping;
 
+use Switch;
+
 package Pakfire;
 
 # A small color-hash :D
@@ -172,7 +174,18 @@ sub fetchfile {
 		}
 
 		$final_data = undef;
-	 	my $url = "http://$host/$file";
+
+		my $url;
+		switch ($proto) {
+			case "HTTP" { $url = "http://$host/$file"; }
+			case "HTTPS" { $url = "https://$host/$file"; }
+			else {
+				# skip all lines with unknown protocols
+				logger("DOWNLOAD WARNING: Skipping Host: $host due to unknown protocol ($proto) in mirror database");
+				next;
+			}
+		}
+
 		my $response;
 		
 		unless ($bfile =~ /^counter.py\?.*/) {


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2018-03-28 15:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180328154542.9F56A1081DF2@git01.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox