Remove trailing dot from the servername in the serverlist to be able

to use portsnap from behind a http proxy.  Some HTTP proxy don't like
trailing dot in the servername.

Approved by:	cperciva
MFC after:	2 days
This commit is contained in:
Hajimu UMEMOTO 2006-03-07 19:13:00 +00:00
parent 905b98c5f4
commit 2fd4604aa4

View File

@ -328,7 +328,7 @@ fetch_pick_server() {
# Issue the SRV query and pull out the Priority, Weight, and Target fields.
host -t srv "_http._tcp.${SERVERNAME}" |
grep -E "^_http._tcp.${SERVERNAME} has SRV record" |
cut -f 5,6,8 -d ' ' > serverlist
cut -f 5,6,8 -d ' ' | sed -e 's/\.$//' > serverlist
# If no records, give up -- we'll just use the server name we were given.
if [ `wc -l < serverlist` -eq 0 ]; then