[Pkg-sks-commit] r138 - sks/trunk/sks/debian/patches
chrism at alioth.debian.org
chrism at alioth.debian.org
Thu Jun 19 15:06:37 UTC 2008
Author: chrism
Date: 2008-06-19 15:06:37 +0000 (Thu, 19 Jun 2008)
New Revision: 138
Added:
sks/trunk/sks/debian/patches/204_relative_links
Log:
[project @ 140]
Do not use hostname and port in hrefs, when we link to ourselves
Original author: weasel
Date: 2004-04-21 19:00:46.821998+00:00
Added: sks/trunk/sks/debian/patches/204_relative_links
===================================================================
--- sks/trunk/sks/debian/patches/204_relative_links (rev 0)
+++ sks/trunk/sks/debian/patches/204_relative_links 2008-06-19 15:06:37 UTC (rev 138)
@@ -0,0 +1,58 @@
+diff -ruN sks-1.0.7-old/htmlTemplates.ml sks-1.0.7/htmlTemplates.ml
+--- sks-1.0.7-old/htmlTemplates.ml Wed Dec 10 03:12:34 2003
++++ sks-1.0.7/htmlTemplates.ml Wed Apr 21 20:55:30 2004
+@@ -47,13 +47,16 @@
+ (Str.global_replace br_regexp " | " title) title body
+
+ let link ~hostname ~op ~hash ~fingerprint ~port ~keyid =
+- sprintf "http://%s:%d/pks/lookup?op=%s%s%s&search=0x%s"
+- hostname
+- port
++ let path = sprintf "pks/lookup?op=%s%s%s&search=0x%s"
+ op
+ (if hash then "&hash=on" else "")
+ (if fingerprint then "&fingerprint=on" else "")
+ keyid
++ in
++ if !Settings.links_include_server then
++ sprintf "http://%s:%d/%s" hostname port path
++ else
++ path
+
+ let keyinfo_header = "Type bits/keyID Date User ID"
+
+@@ -76,8 +79,11 @@
+ sprintf "\t Fingerprint=%s" fp
+
+ let hash_link ~hostname ~port ~hash =
+- sprintf "http://%s:%d/pks/lookup?op=hget&search=%s"
+- hostname port hash
++ let path = sprintf "/pks/lookup?op=hget&search=%s" hash in
++ if !Settings.links_include_server then
++ sprintf "http://%s:%d/%s" hostname port path
++ else
++ path
+
+ let hash ~hostname ~port ~hash =
+ sprintf "\t Hash=<a href=%s>%s</a>"
+diff -ruN sks-1.0.7-old/settings.ml sks-1.0.7/settings.ml
+--- sks-1.0.7-old/settings.ml Tue Dec 9 22:33:31 2003
++++ sks-1.0.7/settings.ml Wed Apr 21 20:50:05 2004
+@@ -133,6 +133,9 @@
+ let hostname = ref (Unix.gethostname ())
+ let set_hostname value = hostname := value
+
++let links_include_server = ref false
++let set_links_include_server value = links_include_server := value
++
+ let filelog = ref true
+
+ let transactions = ref true
+@@ -230,6 +233,7 @@
+ "in one shot");
+ ("-seed", Arg.Int set_seed, "Seed used by RNG");
+ ("-hostname", Arg.String set_hostname, "current hostname");
++ ("-links_include_server", Arg.Set links_include_server, "HTTP links include server and port ");
+ ("-d", Arg.Int set_drop, "Number of keys to drop at random " ^
+ "when synchronizing");
+ ("-n", Arg.Int set_n, "Multiple of 15,000 keys to load at once");
More information about the Pkg-sks-commit
mailing list