FreeBSD Bugzilla – Attachment 156117 Details for
Bug 199768
[net/GeoIP] Changed MaxMind URLs to the ones that accept queries from TOR-connected host
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Improved patch
GeoIP-tor-fix.patch (text/plain), 1.82 KB, created by
Yuri Victorovich
on 2015-04-29 18:53:12 UTC
(
hide
)
Description:
Improved patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2015-04-29 18:53:12 UTC
Size:
1.82 KB
patch
obsolete
>Index: net/GeoIP/Makefile >=================================================================== >--- net/GeoIP/Makefile (revision 384892) >+++ net/GeoIP/Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME= GeoIP > PORTVERSION= 1.6.5 >+PORTREVISION= 1 > DISTVERSIONPREFIX= v > CATEGORIES= net geography > >Index: net/GeoIP/files/geoipupdate.sh.in >=================================================================== >--- net/GeoIP/files/geoipupdate.sh.in (revision 384892) >+++ net/GeoIP/files/geoipupdate.sh.in (working copy) >@@ -1,16 +1,19 @@ > #!/bin/sh > >-set -eu >+set -u > echo Fetching GeoIP.dat and GeoIPv6.dat... > >+MAXMIND_HOST_MAIN="geolite.maxmind.com" >+MAXMIND_HOST_ALT="geoip.maxmind.com" >+ > # arguments: > # $1 URL > # $2 output file name > _fetch() { >- url="$1" >- out="$2" >- TEMPDIR="$(mktemp -d '%%DATADIR%%/GeoIPupdate.XXXXXX')" >- trap 'rc=$? ; set +e ; rm -rf "'"$TEMPDIR"'" ; exit $rc' 0 >+ local url="$1" >+ local out="$2" >+ local TEMPDIR="$(mktemp -d '%%DATADIR%%/GeoIPupdate.XXXXXX')" >+ trap 'rc=$? ; rm -rf "'"$TEMPDIR"'" ; exit $rc' 0 > if fetch -o "$TEMPDIR/$out.gz" "$url"; then > gunzip "$TEMPDIR/$out.gz" > chmod 444 "$TEMPDIR/$out" >@@ -27,6 +30,15 @@ > return 0 > } > >-_fetch "http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" GeoIP.dat >+_fetch2() { >+ local url="$1" >+ local out="$2" >+ _fetch "http://${MAXMIND_HOST_MAIN}/${url}" "${out}" || >+ ! echo "Download of ${out} from ${MAXMIND_HOST_MAIN} failed, trying an alternative server ${MAXMIND_HOST_ALT}" || >+ _fetch "http://${MAXMIND_HOST_ALT}/${url}" "${out}" >+} > >-_fetch "http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz" GeoIPv6.dat >+(_fetch2 "/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" GeoIP.dat && >+ _fetch2 "/download/geoip/database/GeoIPv6.dat.gz" GeoIPv6.dat >+) || exit 1 >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199768
:
156081
|
156085
| 156117