[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Sks-devel] do not use server:port in links, if possible
From: |
Peter Palfrader |
Subject: |
[Sks-devel] do not use server:port in links, if possible |
Date: |
Wed, 21 Apr 2004 21:06:23 +0200 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
In my setup I have apache listening on port 80, and mod_proxy it to
11371 for /pks. On 11371 sks is listening.
The problem is that links created by sks always include servername and
port, so a user accessing it on port 80 will sooner rather than later
come to a link that sends him to port 11371. There are users who cannot
access that port however.
This patch makes sks use href="/pks/..." instead of
href="http://server:port/pks...".
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");
signature.asc
Description: Digital signature
- [Sks-devel] do not use server:port in links, if possible,
Peter Palfrader <=