diff --git a/go.mod b/go.mod
index 1d28dc09cb..66f2b180d6 100644
--- a/go.mod
+++ b/go.mod
@@ -6,25 +6,25 @@ require (
github.com/Masterminds/squirrel v1.1.0
github.com/NYTimes/gziphandler v1.1.1
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
- github.com/avct/uasurfer v0.0.0-20190308134847-43c6f9a90eeb
+ github.com/avct/uasurfer v0.0.0-20190821150637-906cc7dc6197
github.com/blang/semver v3.5.1+incompatible
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
- github.com/corpix/uarand v0.1.0 // indirect
+ github.com/corpix/uarand v0.1.1 // indirect
github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3
- github.com/disintegration/imaging v1.6.0
+ github.com/disintegration/imaging v1.6.1
github.com/dyatlov/go-opengraph v0.0.0-20180429202543-816b6608b3c8
github.com/fortytw2/leaktest v1.3.0 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/go-gorp/gorp v2.0.0+incompatible // indirect
- github.com/go-redis/redis v6.15.2+incompatible
+ github.com/go-redis/redis v6.15.5+incompatible
github.com/go-sql-driver/mysql v1.4.1
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/uuid v1.1.1 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
- github.com/gorilla/handlers v1.4.1
+ github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.3
github.com/gorilla/schema v1.1.0
- github.com/gorilla/websocket v1.4.0
+ github.com/gorilla/websocket v1.4.1
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hako/durafmt v0.0.0-20190612201238-650ed9f29a84
github.com/hashicorp/go-hclog v0.9.2
@@ -33,15 +33,16 @@ require (
github.com/hashicorp/go-plugin v1.0.1
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
- github.com/hashicorp/memberlist v0.1.4
- github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
+ github.com/hashicorp/golang-lru v0.5.3 // indirect
+ github.com/hashicorp/memberlist v0.1.5
+ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428
github.com/jaytaylor/html2text v0.0.0-20190408195923-01ec452cbe43
github.com/jmoiron/sqlx v1.2.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/lib/pq v1.2.0
github.com/magiconair/properties v1.8.1 // indirect
- github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect
+ github.com/mailru/easyjson v0.7.0 // indirect
github.com/mattermost/go-i18n v1.11.0
github.com/mattermost/gorp v2.0.1-0.20190301154413-3b31e9a39d05+incompatible
github.com/mattermost/ldap v3.0.4+incompatible
@@ -49,8 +50,8 @@ require (
github.com/mattermost/viper v1.0.4
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/mattn/go-sqlite3 v1.11.0
- github.com/miekg/dns v1.1.15 // indirect
- github.com/minio/minio-go/v6 v6.0.34
+ github.com/miekg/dns v1.1.19 // indirect
+ github.com/minio/minio-go/v6 v6.0.38
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/muesli/smartcrop v0.3.0 // indirect
github.com/olekukonko/tablewriter v0.0.1 // indirect
@@ -59,12 +60,13 @@ require (
github.com/pborman/uuid v1.2.0
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/pkg/errors v0.8.1
- github.com/prometheus/client_golang v1.0.0
- github.com/prometheus/common v0.6.0 // indirect
- github.com/prometheus/procfs v0.0.3 // indirect
- github.com/rs/cors v1.6.0
+ github.com/prometheus/client_golang v1.1.0
+ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
+ github.com/prometheus/common v0.7.0 // indirect
+ github.com/prometheus/procfs v0.0.5 // indirect
+ github.com/rs/cors v1.7.0
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
- github.com/segmentio/analytics-go v3.0.1+incompatible
+ github.com/segmentio/analytics-go v3.1.0+incompatible
github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c // indirect
github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/assertions v1.0.0 // indirect
@@ -72,37 +74,32 @@ require (
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman v1.1.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
github.com/stretchr/objx v0.2.0 // indirect
- github.com/stretchr/testify v1.3.0
+ github.com/stretchr/testify v1.4.0
github.com/throttled/throttled v2.2.4+incompatible
github.com/tylerb/graceful v1.2.15
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
go.uber.org/atomic v1.4.0 // indirect
- go.uber.org/multierr v1.1.0 // indirect
+ go.uber.org/multierr v1.2.0 // indirect
go.uber.org/zap v1.10.0
- golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
- golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9
- golang.org/x/net v0.0.0-20190628185345-da137c7871d7
- golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
+ golang.org/x/crypto v0.0.0-20191001170739-f9e2070545dc
+ golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a
+ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
+ golang.org/x/sys v0.0.0-20191002091554-b397fe3ad8ed // indirect
golang.org/x/text v0.3.2
- golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b
- google.golang.org/appengine v1.6.1 // indirect
- google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610 // indirect
- google.golang.org/grpc v1.22.0 // indirect
+ golang.org/x/tools v0.0.0-20191002161851-3769738f410b
+ google.golang.org/appengine v1.6.4 // indirect
+ google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c // indirect
+ google.golang.org/grpc v1.24.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
- gopkg.in/ini.v1 v1.44.0 // indirect
+ gopkg.in/ini.v1 v1.48.0 // indirect
gopkg.in/mail.v2 v2.3.1
gopkg.in/natefinch/lumberjack.v2 v2.0.0
- gopkg.in/olivere/elastic.v5 v5.0.81
- gopkg.in/yaml.v2 v2.2.2
+ gopkg.in/olivere/elastic.v5 v5.0.82
+ gopkg.in/yaml.v2 v2.2.3
willnorris.com/go/imageproxy v0.9.0
)
-
-replace (
- git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
- // Workaround for https://github.com/golang/go/issues/30831 and fallout.
- github.com/golang/lint => github.com/golang/lint v0.0.0-20190227174305-8f45f776aaf1
-)
diff --git a/go.sum b/go.sum
index 8d60f129f5..4064e2c18d 100644
--- a/go.sum
+++ b/go.sum
@@ -3,6 +3,8 @@ cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.1/go.mod h1:SAbnLi6YTSPKSI0dTUEOVLCkyPfKXK8n4ibqiMoj4ok=
contrib.go.opencensus.io/exporter/ocagent v0.4.9/go.mod h1:ueLzZcP7LPhPulEBukGn4aLh7Mx9YJwpVJ9nL2FYltw=
+git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
+git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/Azure/azure-sdk-for-go v26.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-autorest v11.5.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
@@ -18,12 +20,11 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo
github.com/PaulARoy/azurestoragecache v0.0.0-20170906084534-3c249a3ba788/go.mod h1:lY1dZd8HBzJ10eqKERHn3CU59tfhzcAVb2c0ZhIWSOk=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845/go.mod h1:c8Mh99Cw82nrsAnPgxQSZHkswVOJF7/MqZb1ZdvriLM=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
-github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
-github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
@@ -31,13 +32,15 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM=
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
-github.com/avct/uasurfer v0.0.0-20190308134847-43c6f9a90eeb h1:Y3aZuokc2y31S/oh04f5893WST38EefizkMaP4qS6DM=
-github.com/avct/uasurfer v0.0.0-20190308134847-43c6f9a90eeb/go.mod h1:noBAuukeYOXa0aXGqxr24tADqkwDO2KRD15FsuaZ5a8=
+github.com/avct/uasurfer v0.0.0-20190821150637-906cc7dc6197 h1:E7XoJNlFlrtC6dlRG9SoGBwJpX8vD7fNTKRmgSwAj5I=
+github.com/avct/uasurfer v0.0.0-20190821150637-906cc7dc6197/go.mod h1:noBAuukeYOXa0aXGqxr24tADqkwDO2KRD15FsuaZ5a8=
github.com/aws/aws-sdk-go v1.19.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
@@ -53,8 +56,8 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
-github.com/corpix/uarand v0.1.0 h1:HgE/0ismPNM4n3z2VeZxzwpMJiN4uSZ+SMpxxvoyffY=
-github.com/corpix/uarand v0.1.0/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
+github.com/corpix/uarand v0.1.1 h1:RMr1TWc9F4n5jiPDzFHtmaUXLKLNUFK0SgCLo4BhX/U=
+github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -65,6 +68,8 @@ github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3/go.mod h1:hEfFau
github.com/die-net/lrucache v0.0.0-20181227122439-19a39ef22a11/go.mod h1:ew0MSjCVDdtGMjF3kzLK9hwdgF5mOE8SbYVF3Rc7mkU=
github.com/disintegration/imaging v1.6.0 h1:nVPXRUUQ36Z7MNf0O77UzgnOb1mkMMor7lmJMJXc/mA=
github.com/disintegration/imaging v1.6.0/go.mod h1:xuIt+sRxDFrHS0drzXUlCJthkJ8k7lkkUojDSR247MQ=
+github.com/disintegration/imaging v1.6.1 h1:JnBbK6ECIZb1NsWIikP9pd8gIlTIRx7fuDNpU9fsxOE=
+github.com/disintegration/imaging v1.6.1/go.mod h1:xuIt+sRxDFrHS0drzXUlCJthkJ8k7lkkUojDSR247MQ=
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dyatlov/go-opengraph v0.0.0-20180429202543-816b6608b3c8 h1:6muCmMJat6z7qptVrIf/+OWPxsjAfvhw5/6t+FwEkgg=
@@ -81,16 +86,16 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
-github.com/gernest/wow v0.1.0/go.mod h1:dEPabJRi5BneI1Nev1VWo0ZlcTWibHWp43qxKms4elY=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-gorp/gorp v2.0.0+incompatible h1:dIQPsBtl6/H1MjVseWuWPXa7ET4p6Dve4j3Hg+UjqYw=
github.com/go-gorp/gorp v2.0.0+incompatible/go.mod h1:7IfkAQnO7jfT/9IQ3R9wL1dFhukN6aQxzKTHnkxzA/E=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
-github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
+github.com/go-redis/redis v6.15.5+incompatible h1:pLky8I0rgiblWfa8C1EV7fPEUv0aH6vKRaYHc/YRHVk=
+github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
@@ -101,7 +106,7 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF0
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/lint v0.0.0-20190227174305-8f45f776aaf1/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
+github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
@@ -117,9 +122,11 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -131,15 +138,15 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4=
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
-github.com/gorilla/handlers v1.4.1 h1:BHvcRGJe/TrL+OqFxoKQGddTgeibiOjaBssV5a/N9sw=
-github.com/gorilla/handlers v1.4.1/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
+github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
+github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY=
github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
-github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
-github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
+github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc h1:f8eY6cV/x1x+HLjOp4r72s/31/V2aTUtg5oKRRPf8/Q=
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
@@ -180,13 +187,15 @@ github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCO
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk=
+github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
-github.com/hashicorp/memberlist v0.1.4 h1:gkyML/r71w3FL8gUi74Vk76avkj/9lYAY9lvg0OcoGs=
-github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
+github.com/hashicorp/memberlist v0.1.5 h1:AYBsgJOW9gab/toO5tEB8lWetVgDKZycqkebJ8xxpqM=
+github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
-github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ=
-github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
+github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d h1:W+SIwDdl3+jXWeidYySAgzytE3piq6GumXeBjFBG67c=
+github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428 h1:Mo9W14pwbO9VfRe+ygqZ8dFbPpoIK1HFrG/zjTuQ+nc=
@@ -201,6 +210,7 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
@@ -230,8 +240,8 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/mattermost/go-i18n v1.11.0 h1:1hLKqn/ZvhZ80OekjVPGYcCrBfMz+YxNNgqS+beL7zE=
github.com/mattermost/go-i18n v1.11.0/go.mod h1:RyS7FDNQlzF1PsjbJWHRI35exqaKGSO9qD4iv8QjE34=
@@ -253,11 +263,12 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
-github.com/miekg/dns v1.1.15 h1:CSSIDtllwGLMoA6zjdKnaE6Tx6eVUxQ29LUgGetiDCI=
-github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
-github.com/minio/cli v1.20.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY=
-github.com/minio/minio-go/v6 v6.0.34 h1:ESPDlIg8Pe2BRvsxPomd0xB72uLmsXrkDNoze36yb90=
-github.com/minio/minio-go/v6 v6.0.34/go.mod h1:vaNT59cWULS37E+E9zkuN/BVnKHyXtVGS+b04Boc66Y=
+github.com/miekg/dns v1.1.19 h1:0ymbfaLG1/utH2+BydNiF+dx1jSEmdr/nylOtkGHZZg=
+github.com/miekg/dns v1.1.19/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
+github.com/minio/minio-go/v6 v6.0.38 h1:zd3yagckaBVAMJT+HsbpURx9ndqYQp/N/udc1UVS72E=
+github.com/minio/minio-go/v6 v6.0.38/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg=
+github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
+github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -267,7 +278,9 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/muesli/smartcrop v0.2.1-0.20181030220600-548bbf0c0965 h1:BdOnvj+P+06ZFwYd07iFWXHPfRyrJd5sAXpX9+E8bxM=
github.com/muesli/smartcrop v0.2.1-0.20181030220600-548bbf0c0965/go.mod h1:i2fCI/UorTfgEpPPLWiFBv4pye+YAG78RwcQLUkocpI=
@@ -316,11 +329,15 @@ github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+Ci
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8=
+github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
@@ -328,6 +345,8 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
+github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY=
+github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
@@ -336,10 +355,12 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
+github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=
+github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
-github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI=
-github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
+github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
+github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/rwcarlsen/goexif v0.0.0-20190318171057-76e3344f7516 h1:unvLzUrgn54Nhn5yJB8qUBr/a7wiZHQaJ/8Y4yTGAjE=
github.com/rwcarlsen/goexif v0.0.0-20190318171057-76e3344f7516/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
@@ -349,8 +370,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
github.com/satori/go.uuid v0.0.0-20180103174451-36e9d2ebbde5/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
-github.com/segmentio/analytics-go v3.0.1+incompatible h1:W7T3ieNQjPFMb+SE8SAVYo6mPkKK/Y37wYdiNf5lCVg=
-github.com/segmentio/analytics-go v3.0.1+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48=
+github.com/segmentio/analytics-go v3.1.0+incompatible h1:IyiOfUgQFVHvsykKKbdI7ZsH374uv3/DfZUo9+G0Z80=
+github.com/segmentio/analytics-go v3.1.0+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48=
github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c h1:rsRTAcCR5CeNLkvgBVSjQoDGRRt6kggsE6XYBqCv2KQ=
github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@@ -376,6 +397,8 @@ github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmq
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
@@ -387,6 +410,8 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/throttled/throttled v2.2.4+incompatible h1:aVKdoH/qT5Mo1Lm/678OkX2pFg7aRpHlTn1tfgaSKxs=
github.com/throttled/throttled v2.2.4+incompatible/go.mod h1:0BjlrEGQmvxps+HuXLsyRdqpSRvJpq0PNIsOtqP9Nos=
@@ -404,8 +429,8 @@ go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
-go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
-go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/multierr v1.2.0 h1:6I+W7f5VwC5SV9dNrZ3qXrDB9mD0dyGOi/ZJmYw03T4=
+go.uber.org/multierr v1.2.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
@@ -414,19 +439,19 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
-golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
+golang.org/x/crypto v0.0.0-20191001170739-f9e2070545dc h1:KyTYo8xkh/2WdbFLUyQwBS0Jfn3qfZ9QmuPbok2oENE=
+golang.org/x/crypto v0.0.0-20191001170739-f9e2070545dc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f h1:FO4MZ3N56GnxbqxGKqh+YTzUWQ2sDwtFQEZgLOxh9Jc=
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 h1:uc17S921SPw5F2gJo7slQ3aqvr2RwpL7eb3+DZncu3s=
-golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a h1:gHevYm0pO4QUbwy8Dmdr01R5r1BuKtfYqRqF0h/Cbh0=
+golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -451,8 +476,10 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs=
+golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -478,7 +505,6 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190116161447-11f53e031339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -487,8 +513,11 @@ golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI=
-golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191002091554-b397fe3ad8ed h1:5TJcLJn2a55mJjzYk0yOoqN8X1OdvBDUnaZaKKyQtkY=
+golang.org/x/sys v0.0.0-20191002091554-b397fe3ad8ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
@@ -508,6 +537,10 @@ golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b h1:mSUCVIwDx4hfXJfWsOPfdzEHxzb2Xjl6BQ8YgPnazQA=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191002161851-3769738f410b h1:H3xgcuTEMnlg2n7BT6mWCOGuMchcPTaZ/uCC9GuV05M=
+golang.org/x/tools v0.0.0-20191002161851-3769738f410b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
@@ -519,8 +552,8 @@ google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO50
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
+google.golang.org/appengine v1.6.4 h1:WiKh4+/eMB2HaY7QhCfW/R7MuRAoA8QMCSJA6jP5/fo=
+google.golang.org/appengine v1.6.4/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
@@ -528,16 +561,16 @@ google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190321212433-e79c0c59cdb5 h1:VchCZUJA1Lkjn3FxAtLPl4GotxoGt/E8ZIm9nVqbhQ8=
google.golang.org/genproto v0.0.0-20190321212433-e79c0c59cdb5/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610 h1:Ygq9/SRJX9+dU0WCIICM8RkWvDw03lvB77hrhJnpxfU=
-google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c h1:hrpEMCZ2O7DR5gC1n2AJGVhrwiEjOi35+jxtIuZpTMo=
+google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw=
-google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
+google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
@@ -550,22 +583,23 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/ini.v1 v1.44.0 h1:YRJzTUp0kSYWUVFF5XAbDFfyiqwsl0Vb9R8TVP5eRi0=
-gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
+gopkg.in/ini.v1 v1.48.0 h1:URjZc+8ugRY5mL5uUeQH/a63JcHwdX9xZaWvmNWD7z8=
+gopkg.in/ini.v1 v1.48.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk=
gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
-gopkg.in/olivere/elastic.v5 v5.0.81 h1:21Vu9RMT2qXVLqXINtiOhwVPYz/87+Omsxh/Re+gK4k=
-gopkg.in/olivere/elastic.v5 v5.0.81/go.mod h1:uhHoB4o3bvX5sorxBU29rPcmBQdV2Qfg0FBrx5D6pV0=
+gopkg.in/olivere/elastic.v5 v5.0.82 h1:QH7ere4lvOAWnnOd0VLJ54W8LzExZszoGIRijnb1h2Y=
+gopkg.in/olivere/elastic.v5 v5.0.82/go.mod h1:uhHoB4o3bvX5sorxBU29rPcmBQdV2Qfg0FBrx5D6pV0=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/github.com/avct/uasurfer/device.go b/vendor/github.com/avct/uasurfer/device.go
index 52a65ed865..3a1fc38839 100644
--- a/vendor/github.com/avct/uasurfer/device.go
+++ b/vendor/github.com/avct/uasurfer/device.go
@@ -31,7 +31,8 @@ func (u *UserAgent) evalDevice(ua string) {
return
}
- if strings.Contains(ua, "tablet") || strings.Contains(ua, "nexus 7") || strings.Contains(ua, "nexus 9") || strings.Contains(ua, "nexus 10") || strings.Contains(ua, "xoom") {
+ if strings.Contains(ua, "tablet") || strings.Contains(ua, "nexus 7") || strings.Contains(ua, "nexus 9") || strings.Contains(ua, "nexus 10") || strings.Contains(ua, "xoom") ||
+ strings.Contains(ua, "sm-t") || strings.Contains(ua, "; kf") || strings.Contains(ua, "; t1") || strings.Contains(ua, "lenovo tab") {
u.DeviceType = DeviceTablet
return
}
diff --git a/vendor/github.com/corpix/uarand/.travis.yml b/vendor/github.com/corpix/uarand/.travis.yml
index 9d2b75da6c..58114d498d 100644
--- a/vendor/github.com/corpix/uarand/.travis.yml
+++ b/vendor/github.com/corpix/uarand/.travis.yml
@@ -1,11 +1,3 @@
-language: go
+language: nix
-go:
- - 1.8
- - 1.9
- - 1.10
- - 1.11
- - 1.12
- - master
-
-script: make test
+script: nix-shell --pure --command "make lint test"
diff --git a/vendor/github.com/corpix/uarand/Makefile b/vendor/github.com/corpix/uarand/Makefile
index dac0fcbdda..fdca404f38 100644
--- a/vendor/github.com/corpix/uarand/Makefile
+++ b/vendor/github.com/corpix/uarand/Makefile
@@ -14,17 +14,19 @@ test:
.PHONY: lint
lint:
- go vet ./...
+.PHONY: lint
+lint:
+ golangci-lint --color=always \
+ --exclude='uses unkeyed fields' \
+ --exclude='type .* is unused' \
+ --exclude='should merge variable declaration with assignment on next line' \
+ --deadline=120s \
+ run ./...
.PHONY: check
check: lint test
.PHONY: useragents.go
useragents.go:
- curl -Ls -H'User-Agent: gotohellwithyour403' \
- http://techpatterns.com/downloads/firefox/useragentswitcher.xml \
- | ./scripts/extract-user-agents \
- | ./scripts/generate-useragents-go $(name) \
- > $@
+ ./scripts/fetch-user-agents | ./scripts/generate-useragents-go $(name) > $@
go fmt $@
-
diff --git a/vendor/github.com/corpix/uarand/README.md b/vendor/github.com/corpix/uarand/README.md
index d79b5c29b6..c8d98a98ac 100644
--- a/vendor/github.com/corpix/uarand/README.md
+++ b/vendor/github.com/corpix/uarand/README.md
@@ -35,4 +35,4 @@ Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41
## License
-MIT
+[Unlicense](https://unlicense.org/)
diff --git a/vendor/github.com/corpix/uarand/shell.nix b/vendor/github.com/corpix/uarand/shell.nix
index 7ac346052e..ef55b0ddd6 100644
--- a/vendor/github.com/corpix/uarand/shell.nix
+++ b/vendor/github.com/corpix/uarand/shell.nix
@@ -1,15 +1,17 @@
let
nixpkgs = builtins.fetchTarball {
- url = "https://github.com/nixos/nixpkgs/archive/03050e9749e1548f1648aae5c062c954eaad546e.tar.gz";
- sha256 = "00hfkldmf853ynnd8a9d7a778ifcrdjxdndxyykzbpxfki5s5qsb";
+ url = "https://github.com/nixos/nixpkgs/archive/ddf38a8241089d79c3bcd1777781b6438ab88d84.tar.gz";
+ sha256 = "0fjk69mn58h0gjzgxgnkfkhhf1l707bg2cn4823ma9xbjxbhl0ya";
};
in with import nixpkgs {};
stdenv.mkDerivation {
name = "nix-shell";
buildInputs = [
- go
+ coreutils bashInteractive jq curl gcc git gnumake
+ go golangci-lint cacert openssl
];
shellHook = ''
unset GOPATH
+ export NIX_PATH=nixpkgs=${nixpkgs}
'';
}
diff --git a/vendor/github.com/corpix/uarand/uarand.go b/vendor/github.com/corpix/uarand/uarand.go
index fe7296b31a..fad7337848 100644
--- a/vendor/github.com/corpix/uarand/uarand.go
+++ b/vendor/github.com/corpix/uarand/uarand.go
@@ -2,6 +2,7 @@ package uarand
import (
"math/rand"
+ "sync"
"time"
)
@@ -24,11 +25,17 @@ type Randomizer interface {
type UARand struct {
Randomizer
UserAgents []string
+
+ mutex sync.Mutex
}
// GetRandom returns a random user agent from UserAgents slice.
func (u *UARand) GetRandom() string {
- return u.UserAgents[u.Intn(len(u.UserAgents))]
+ u.mutex.Lock()
+ n := u.Intn(len(u.UserAgents))
+ u.mutex.Unlock()
+
+ return u.UserAgents[n]
}
// GetRandom returns a random user agent from UserAgents slice.
@@ -39,11 +46,18 @@ func GetRandom() string {
// New return UserAgent randomizer settings with default user-agents list
func New(r Randomizer) *UARand {
- return &UARand{r, UserAgents}
+ return &UARand{
+ Randomizer: r,
+ UserAgents: UserAgents,
+ mutex: sync.Mutex{},
+ }
}
// NewWithCustomList return UserAgent randomizer settings with custom user-agents list
func NewWithCustomList(userAgents []string) *UARand {
- r := rand.New(rand.NewSource(time.Now().UnixNano()))
- return &UARand{r, userAgents}
+ return &UARand{
+ Randomizer: rand.New(rand.NewSource(time.Now().UnixNano())),
+ UserAgents: userAgents,
+ mutex: sync.Mutex{},
+ }
}
diff --git a/vendor/github.com/corpix/uarand/useragents.go b/vendor/github.com/corpix/uarand/useragents.go
index aa8e44cc95..5e1c565331 100644
--- a/vendor/github.com/corpix/uarand/useragents.go
+++ b/vendor/github.com/corpix/uarand/useragents.go
@@ -3,827 +3,1733 @@ package uarand
var (
// UserAgents is a list of browser and bots user agents.
UserAgents = []string{
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )",
+ "Adobe Application Manager 2.0",
+ "AdsBot-Google ( http://www.google.com/adsbot.html)",
+ "AndroidDownloadManager/5.1 (Linux; U; Android 5.1; Z820 Build/LMY47D)",
"Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)",
- "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5",
- "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7",
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/9.0.601.0 Safari/534.14",
- "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/10.0.601.0 Safari/534.14",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.27 (KHTML, like Gecko) Chrome/12.0.712.0 Safari/534.27",
- "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7",
- "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0",
- "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6",
- "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
- "Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9pre) Gecko/2008072421 Minefield/3.0.2pre",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10",
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)",
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB5",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0E)",
- "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a2) Gecko/20110622 Firefox/6.0a2",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
- "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0",
- "Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20100101 Firefox/14.0.1",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1",
- "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0) Gecko/16.0 Firefox/16.0",
- "Mozilla/5.0 (Windows NT 6.2; rv:19.0) Gecko/20121129 Firefox/19.0",
- "Mozilla/5.0 (Windows NT 6.2; rv:20.0) Gecko/20121202 Firefox/20.0",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Maxthon 2.0)",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100815 Minefield/4.0b4pre",
- "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0 )",
- "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)",
- "Mozilla/5.0 (Windows; U; Windows XP) Gecko MultiZilla/1.6.1.0a",
- "Mozilla/2.02E (Win95; U)",
- "Mozilla/3.01Gold (Win95; I)",
- "Mozilla/4.8 [en] (Windows NT 5.1; U)",
- "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko Netscape/7.1 (ax)",
- "Opera/7.50 (Windows XP; U)",
- "Opera/7.50 (Windows ME; U) [en]",
- "Opera/7.51 (Windows NT 5.1; U) [en]",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en) Opera 8.0",
- "Opera/9.25 (Windows NT 6.0; U; en)",
- "Opera/9.80 (Windows NT 5.2; U; en) Presto/2.2.15 Version/10.10",
- "Opera/9.80 (Windows NT 5.1; U; zh-tw) Presto/2.8.131 Version/11.10",
- "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.7.62 Version/11.01",
- "Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
- "Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14",
- "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021001 Phoenix/0.2",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18",
- "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.17) Gecko/20110123 (like Firefox/3.x) SeaMonkey/2.0.12",
- "Mozilla/5.0 (Windows NT 5.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
- "Mozilla/5.0 (Windows; U; ; en-NZ) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.8.0",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; Avant Browser; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Beamrise/17.2.0.9 Chrome/17.0.939.0 Safari/535.8",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2869.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 AOL/11.0 AOLBUILD/11.0.1305 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3191.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
- "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240",
- "Mozilla/5.0 (MSIE 9.0; Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14931",
- "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063",
- "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20130401 Firefox/21.0",
- "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0",
- "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/29.0",
- "Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0",
- "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:35.0) Gecko/20100101 Firefox/35.0",
- "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0",
- "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0",
- "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0",
- "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0",
- "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0",
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0",
- "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0",
- "iTunes/9.0.2 (Windows; N)",
- "Mozilla/5.0 (compatible; Konqueror/4.5; Windows) KHTML/4.5.4 (like Gecko)",
- "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Maxthon/3.0.8.2 Safari/533.1",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML like Gecko) Maxthon/4.0.0.2000 Chrome/22.0.1229.79 Safari/537.1",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.6.1000 Chrome/30.0.1599.101 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/5.0.4.3000 Chrome/47.0.2526.73 Safari/537.36",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",
- "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
- "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)",
- "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; Trident/5.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; WOW64; Trident/5.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)",
- "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
- "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)",
- "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) MxBrowser/4.5.10.7000 Chrome/30.0.1551.0 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko",
- "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; MALNJS; rv:11.0) like Gecko",
- "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.16",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.12 Safari/537.36 OPR/14.0.1116.4",
- "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36 OPR/15.0.1147.24 (Edition Next)",
- "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36 OPR/18.0.1284.49",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36 OPR/19.0.1326.56",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36 OPR/20.0.1387.91",
- "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36 OPR/28.0.1750.40",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36 OPR/31.0.1889.174",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 OPR/36.0.2130.46",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 OPR/47.0.2631.55",
- "Mozilla/5.0 (Windows NT 10.0; rv:45.9) Gecko/20100101 Goanna/3.2 Firefox/45.9 PaleMoon/27.4.0",
- "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8",
- "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5",
- "Mozilla/5.0 (Windows; U; Windows NT 6.2; es-US ) AppleWebKit/540.0 (KHTML like Gecko) Version/6.0 Safari/8900.00",
- "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.71 (KHTML like Gecko) WebVideo/1.0.1.10 Version/7.0 Safari/537.71",
- "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120422 Firefox/12.0 SeaMonkey/2.9",
- "Mozilla/5.0 (Windows NT 6.0; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.13705.206 Safari/537.36",
- "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.94.2 Safari/537.36",
- "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.90 Safari/537.36 Vivaldi/1.4.589.11",
- "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.91 Safari/537.36 Vivaldi/1.92.917.39",
- "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.1785 Yowser/2.5 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre Camino/2.2a1pre",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.302.2 Safari/532.8",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.464.0 Safari/534.3",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.15 Safari/534.13",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.54 Safari/535.2",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.79 Safari/537.4",
- "Mozilla/5.0 (Macintosh; U; Mac OS X Mach-O; en-US; rv:2.0a) Gecko/20040614 Firefox/3.0.0",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110218 AlexaToolbar/alxf-2.0 Firefox/3.6.14",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20120813 Firefox/16.0",
- "Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC)",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.15",
- "Opera/9.0 (Macintosh; PPC Mac OS X; U; en)",
- "Opera/9.20 (Macintosh; Intel Mac OS X; U; en)",
- "Opera/9.64 (Macintosh; PPC Mac OS X; U; en) Presto/2.1.1",
- "Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.6.30 Version/10.61",
- "Opera/9.80 (Macintosh; Intel Mac OS X 10.4.11; U; en) Presto/2.7.62 Version/11.00",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/85.8",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr-fr) AppleWebKit/312.5 (KHTML, like Gecko) Safari/312.3",
- "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.31 (KHTML like Gecko) Chrome/26.0.1410.63 Safari/537.31",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 1083) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2859.0 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.49 Safari/537.36",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:47.0) Gecko/20100101 Firefox/47.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:55.0) Gecko/20100101 Firefox/55.0",
- "iTunes/4.2 (Macintosh; U; PPC Mac OS X 10.2)",
- "iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Maxthon/4.5.2",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/528.16 (KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0.112941",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/528.16 (KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0",
- "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 OPR/28.0.1750.51",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.82 Safari/537.36 OPR/29.0.1795.41",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; de-de) AppleWebKit/534.15 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_7; en-us) AppleWebKit/534.20.8 (KHTML, like Gecko) Version/5.1 Safari/534.20.8",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML like Gecko) Version/6.0.2 Safari/536.26.17",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.1 (KHTML like Gecko) Version/7.0.6 Safari/537.78.1",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/10.1 Safari/603.1.30",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true",
- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.105 Safari/537.36 Vivaldi/1.0.162.9",
- "ELinks (0.4pre5; Linux 2.6.10-ac7 i686; 80x33)",
- "ELinks/0.9.3 (textmode; Linux 2.6.9-kanotix-8 i686; 127x41)",
- "ELinks/0.12~pre5-4",
- "Links/0.9.1 (Linux 2.4.24; i386;)",
- "Links (2.1pre15; Linux 2.4.26 i686; 158x61)",
- "Links (2.3pre1; Linux 2.6.38-8-generic x86_64; 170x48)",
- "Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/0.8.12",
- "w3m/0.5.1",
- "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Chrome/4.0.237.0 Safari/532.4 Debian",
- "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.277.0 Safari/532.8",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.309.0 Safari/532.9",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/540.0 (KHTML, like Gecko) Ubuntu/10.10 Chrome/9.1.0.0 Safari/540.0",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.15 (KHTML, like Gecko) Chrome/10.0.613.0 Safari/534.15",
- "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.15 (KHTML, like Gecko) Ubuntu/10.10 Chromium/10.0.613.0 Chrome/10.0.613.0 Safari/534.15",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.703.0 Chrome/12.0.703.0 Safari/534.24",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.20 Safari/535.1",
- "Mozilla/5.0 Slackware/13.37 (X11; U; Linux x86_64; en-US) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.825.0 Chrome/14.0.825.0 Safari/535.1",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.120 Chrome/15.0.874.120 Safari/535.2",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5",
- "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Epiphany/1.2.5",
- "Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.3) Gecko/20040924 Epiphany/1.4.4 (Ubuntu)",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040614 Firefox/0.8",
- "Mozilla/5.0 (X11; U; Linux x86_64; sv-SE; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/9.10 (karmic) Firefox/3.0.11",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091107 Firefox/3.5.5",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20091020 Linux Mint/8 (Helena) Firefox/3.5.3",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100915 Gentoo Firefox/3.6.9",
- "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8",
- "Mozilla/5.0 (X11; Linux i686; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre",
- "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre",
- "Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0",
- "Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0",
- "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110623 Firefox/7.0a1",
- "Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0",
- "Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120421 Gecko Firefox/11.0",
- "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0",
- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1",
- "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Galeon/1.3.14",
- "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-5)",
- "Mozilla/5.0 (X11; U; Linux i686; pt-PT; rv:1.9.2.3) Gecko/20100402 Iceweasel/3.6.3 (like Firefox/3.6.3) GTB7.0",
- "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0",
- "Mozilla/5.0 (X11; Linux i686; rv:6.0a2) Gecko/20110615 Firefox/6.0a2 Iceweasel/6.0a2",
- "Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1 Iceweasel/14.0.1",
- "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120724 Debian Iceweasel/15.02",
- "Konqueror/3.0-rc4; (Konqueror/3.0-rc4; i686 Linux;;datecode)",
- "Mozilla/5.0 (compatible; Konqueror/3.3; Linux 2.6.8-gentoo-r3; X11;",
- "Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.30-7.dmz.1-liquorix-686; X11) KHTML/3.5.10 (like Gecko) (Debian package 4:3.5.10.dfsg.1-1 b1)",
- "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; en_US) KHTML/3.5.6 (like Gecko) (Kubuntu)",
- "Mozilla/5.0 (X11; Linux x86_64; en-US; rv:2.0b2pre) Gecko/20100712 Minefield/4.0b2pre",
- "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Debian/1.6-7",
- "MSIE (MSIE 6.0; X11; Linux; i686) Opera 7.23",
- "Opera/9.64 (X11; Linux i686; U; Linux Mint; nb) Presto/2.1.1",
- "Opera/9.80 (X11; Linux i686; U; en) Presto/2.2.15 Version/10.10",
- "Opera/9.80 (X11; Linux x86_64; U; pl) Presto/2.7.62 Version/11.00",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) QupZilla/1.2.0 Safari/534.34",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)",
- "Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.1",
- "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.56 Safari/537.4",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1478.0 Safari/537.36",
- "Mozilla/5.0 (X11; CrOS x86_64 5841.83.0) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.138 Safari/537.36",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.125 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2166.2 Safari/537.36",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36",
- "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2876.0 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3187.0 Safari/537.366",
- "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3178.0 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.78 Chrome/60.0.3112.78 Safari/537.36",
- "Mozilla/4.0 (compatible; Dillo 3.0)",
- "Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) lt-GtkLauncher",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.32 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.32 Epiphany/3.8.2",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/604.1 (KHTML, like Gecko) Version/11.0 Safari/604.1 Ubuntu/17.04 (3.24.1-0ubuntu1) Epiphany/3.24.1",
- "Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0",
- "Mozilla/5.0 (X11; U; Linux i686; rv:19.0) Gecko/20100101 Slackware/13 Firefox/19.0",
- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0",
- "Mozilla/5.0 (X11; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0",
- "Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0",
- "Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0",
- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
- "Mozilla/5.0 (X11; CentOS; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0",
- "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0",
- "Mozilla/5.0 (X11; Linux i686; rv:40.0) Gecko/20100101 Firefox/40.0",
- "Mozilla/5.0 (X11; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0",
- "Mozilla/5.0 (X11; Linux i686; rv:46.0) Gecko/20100101 Firefox/46.0",
- "Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0",
- "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0",
- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0",
- "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0",
- "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Galeon/2.0.6 (Ubuntu 2.0.6-2)",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 (Gentoo) Galeon/2.0.6",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.13) Gecko/20100916 Iceape/2.0.8",
- "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 Iceweasel/19.0.2",
- "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1",
- "Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like Gecko) Slackware/13.0",
- "Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.1 (like Gecko) Fedora/4.3.1-3.fc11",
- "Mozilla/5.0 (compatible; Konqueror/4.4; Linux) KHTML/4.4.1 (like Gecko) Fedora/4.4.1-1.fc12",
- "Mozilla/5.0 (compatible; Konqueror/4.4; Linux 2.6.32-22-generic; X11; en_US) KHTML/4.4.3 (like Gecko) Kubuntu",
- "Mozilla/5.0 (compatible; Konqueror/4.4; Linux 2.6.32-22-generic; X11; en_US) KHTML/4.4.3 (like Gecko) Kubuntu",
- "Mozilla/5.0 (X11; Linux 3.8-6.dmz.1-liquorix-686) KHTML/4.8.4 (like Gecko) Konqueror/4.8",
- "Mozilla/5.0 (X11; Linux) KHTML/4.9.1 (like Gecko) Konqueror/4.9",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) konqueror/4.14.10 Safari/537.21",
- "Midori/0.1.10 (X11; Linux i686; U; en-us) WebKit/(531).(2)",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092814 (Debian-3.0.1-1)",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a3pre) Gecko/20070330",
- "Opera/9.80 (X11; Linux i686) Presto/2.12.388 Version/12.16",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.166 Safari/537.36 OPR/20.0.1396.73172",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.166 Safari/537.36 OPR/20.0.1396.73172",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 OPR/32.0.1948.25",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36 OPR/40.0.2308.62",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.8.0.2965AT",
- "Mozilla/5.0 (X11; Linux i686) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.6 Safari/538.1",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.9.0 Safari/538.1",
- "Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
- "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120502 Firefox/12.0 SeaMonkey/2.9.1",
- "Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35",
- "Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46",
- "Mozilla/5.0 (X11; U; Linux x86_64; us; rv:1.9.1.19) Gecko/20110430 shadowfox/7.0 (like Firefox/7.0",
- "Mozilla/5.0 (X11; U; Linux i686; it; rv:1.9.2.3) Gecko/20100406 Firefox/3.6.3 (Swiftfox)",
- "Uzbl (Webkit 1.3) (Linux i686 [i686])",
- "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36 Vivaldi/1.0.344.37",
- "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)",
- "Links (2.1pre15; FreeBSD 5.3-RELEASE i386; 196x84)",
- "Lynx/2.8.7dev.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8d",
- "w3m/0.5.1",
- "Mozilla/5.0 (X11; U; FreeBSD i386; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.207.0 Safari/532.0",
- "Mozilla/5.0 (X11; U; OpenBSD i386; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.359.0 Safari/533.3",
- "Mozilla/5.0 (X11; U; FreeBSD x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16",
- "Mozilla/5.0 (X11; U; SunOS sun4m; en-US; rv:1.4b) Gecko/20030517 Mozilla Firebird/0.6",
- "Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1b3) Gecko/20090429 Firefox/3.1b3",
- "Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.1) Gecko/20090702 Firefox/3.5",
- "Mozilla/5.0 (X11; U; FreeBSD i386; de-CH; rv:1.9.2.8) Gecko/20100729 Firefox/3.6.8",
- "Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20100101 Firefox/5.0",
- "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15",
- "Mozilla/5.0 (compatible; Konqueror/3.5; NetBSD 4.0_RC3; X11) KHTML/3.5.7 (like Gecko)",
- "Mozilla/5.0 (compatible; Konqueror/3.5; SunOS) KHTML/3.5.1 (like Gecko)",
- "Mozilla/5.0 (X11; U; FreeBSD; i386; en-US; rv:1.7) Gecko",
- "Mozilla/4.77 [en] (X11; I; IRIX;64 6.5 IP30)",
- "Mozilla/4.8 [en] (X11; U; SunOS; 5.7 sun4u)",
- "Mozilla/5.0 (Unknown; U; UNIX BSD/SYSV system; C -) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.2",
- "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/536.5 (KHTML like Gecko) Chrome/19.0.1084.56 Safari/536.5",
- "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.79 Safari/537.4",
- "Mozilla/5.0 (X11; NetBSD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
- "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
- "Mozilla/5.0 (X11; NetBSD x86; en-us) AppleWebKit/666.6+ (KHTML, like Gecko) Chromium/20.0.0000.00 Chrome/20.0.0000.00 Safari/666.6+",
- "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Epiphany/2.30.6",
- "Mozilla/5.0 (X11; U; OpenBSD arm; en-us) AppleWebKit/531.2 (KHTML, like Gecko) Safari/531.2 Epiphany/2.30.0",
- "Mozilla/5.0 (X11; NetBSD amd64; rv:16.0) Gecko/20121102 Firefox/16.0",
- "Mozilla/5.0 (X11; OpenBSD amd64; rv:28.0) Gecko/20100101 Firefox/28.0",
- "Mozilla/5.0 (X11; NetBSD amd64; rv:30.0) Gecko/20100101 Firefox/30.0",
- "Mozilla/5.0 (X11; OpenBSD amd64; rv:30.0) Gecko/20100101 Firefox/30.0",
- "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36",
- "Mozilla/5.0 (X11; FreeBSD amd64; rv:54.0) Gecko/20100101 Firefox/54.0",
- "Mozilla/5.0 (compatible; Konqueror/4.1; DragonFly) KHTML/4.1.4 (like Gecko)",
- "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)",
- "Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; amd64; en_US) KHTML/4.5.4 (like Gecko)",
- "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
- "Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Namoroka/3.6.15",
- "NetSurf/1.2 (NetBSD; amd64)",
- "Opera/9.80 (X11; FreeBSD 8.1-RELEASE i386; Edition Next) Presto/2.12.388 Version/12.10",
- "Mozilla/5.0 (Unknown; UNIX BSD/SYSV system) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.7.0 Safari/538.1",
- "Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1.12) Gecko/20080303 SeaMonkey/1.1.8",
- "Mozilla/5.0 (X11; FreeBSD i386; rv:28.0) Gecko/20100101 Firefox/28.0 SeaMonkey/2.25",
- "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; BOLT/2.800) AppleWebKit/534.6 (KHTML, like Gecko) Version/5.0 Safari/534.6.3",
- "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0",
- "Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12; Microsoft ZuneHD 4.3)",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) Asus;Galaxy6",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch)",
- "Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2.1",
- "Mozilla/5.0 (WindowsCE 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
- "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
- "Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
- "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
- "Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0",
- "Mozilla/5.0 (Windows; U; Windows CE 5.1; rv:1.8.1a3) Gecko/20060610 Minimo/0.016",
- "Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020",
- "Mozilla/5.0 (X11; U; Linux arm7tdmi; rv:1.8.1.11) Gecko/20071130 Minimo/0.025",
- "Mozilla/4.0 (PDA; PalmOS/sony/model prmr/Revision:1.1.54 (en)) NetFront/3.0",
- "Opera/9.51 Beta (Microsoft Windows; PPC; Opera Mobi/1718; U; en)",
- "Opera/9.60 (J2ME/MIDP; Opera Mini/4.1.11320/608; U; en) Presto/2.2.0",
- "Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14320/554; U; cs) Presto/2.2.0",
- "Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; ru) Presto/2.4.18 Version/10.00",
- "Opera/10.61 (J2ME/MIDP; Opera Mini/5.1.21219/19.999; en-US; rv:1.9.3a5) WebKit/534.5 Presto/2.6.30",
- "Opera/9.80 (Android; Opera Mini/7.5.33361/31.1543; U; en) Presto/2.8.119 Version/11.1010",
- "Opera/9.80 (J2ME/MIDP; Opera Mini/8.0.35626/37.8918; U; en) Presto/2.12.423 Version/12.16",
- "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Safari/537.36 OPR/30.0.1856.93524",
- "Opera/9.80 (Android; Opera Mini/9.0.1829/66.318; U; en) Presto/2.12.423 Version/12.16",
- "Opera/9.80 (Linux i686; Opera Mobi/1040; U; en) Presto/2.5.24 Version/10.00",
- "POLARIS/6.01 (BREW 3.1.5; U; en-us; LG; LX265; POLARIS/6.01/WAP) MMP/2.0 profile/MIDP-2.1 Configuration/CLDC-1.1",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AT",
- "Mozilla/5.0 (iPod; U; CPU iPhone OS 6_1 like Mac OS X; en-HK) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IP Mobile",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-AU) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IT",
- "Mozilla/5.0 (X11; U; Linux i686; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.0.5603M",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.5.0IT",
- "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; da-dk) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7) UCBrowser/2.9.0.263",
- "Mozilla/5.0 (Linux; U; Android 2.3.3; en-us ; LS670 Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.6.1.262/145/355",
- "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
- "Mozilla/5.0 (Linux; U; Android 4.1; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.1 Safari/534.30",
- "Mozilla/5.0 (Linux; U; Android 4.2; en-us; sdk Build/MR1) AppleWebKit/535.19 (KHTML, like Gecko) Version/4.2 Safari/535.19",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AT",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-AU) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IT",
- "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
- "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3",
- "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
- "Mozilla/5.0 (iPad; CPU OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML like Gecko) Mobile/12A405 Version/7.0 Safari/9537.53",
- "Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4",
- "Mozilla/5.0 (iPad; CPU OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1",
- "Mozilla/5.0 (iPad; CPU OS 10_0 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/49.0.2623.109 Mobile/14A5335b Safari/601.1.46",
- "Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5362a Safari/604.1",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.5.0IT",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7;en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17",
- "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.2; U; de-DE) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.40.1 Safari/534.6 TouchPad/1.0",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19 Silk-Accelerated=true",
- "Mozilla/5.0 (Linux; Android 4.4.2; LG-V410 Build/KOT49I.V41010d) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.103 Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
- "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36",
- "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",
- "Mozilla/5.0 (Linux; U; Android 1.5; de-de; Galaxy Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-ca; GT-P1000M Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; GT-P5210 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
- "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebkit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
- "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T530NU Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
- "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.0 (screen 600x800)",
- "Mozilla/5.0 (Linux U; en-US) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) Version/4.0 Kindle/3.0 (screen 600x800; rotate)",
- "Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19 Silk-Accelerated=true",
- "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
- "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; U; CPU iPad OS 5_0_1 like Mac OS X; en-us) AppleWebKit/535.1+ (KHTML like Gecko) Version/7.2.0.0 Safari/6533.18.5",
- "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
- "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.12 Mobile/11A465 Safari/8536.25 (3B92C18B-D9DE-4CB7-A02A-22FD2AF17C8F)",
- "Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",
- "Mozilla/5.0 (iPad; CPU OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML like Gecko) Mobile/12A405 Version/7.0 Safari/9537.53",
- "Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4",
- "Mozilla/5.0 (iPad; CPU OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1",
- "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.5.0IT",
- "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420 (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.200",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/531.22.7",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; da-dk) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; da-dk) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25",
- "UCWEB/8.8 (iPhone; CPU OS_6; en-US)AppleWebKit/534.1 U3/3.0.0 Mobile",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/8.0.57838 Mobile/12H321 Safari/600.1.4",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13C75 Safari/601.1",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A346 Safari/602.1",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/18.0.130791545 Mobile/14A5345a Safari/600.1.4",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5362a Safari/604.1",
- "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20",
- "Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145",
- "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML like Gecko) Version/7.0 Mobile/11D167 Safari/123E71C",
- "Mozilla/5.0 (iPod; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/44.0.2403.67 Mobile/12H143 Safari/600.1.4",
- "nook browser/1.0",
- "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7;en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; BNTV250 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1",
- "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36",
+ "Baiduspider ( http://www.baidu.com/search/spider.htm)",
"BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103",
+ "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/5.0.3.3 UP.Link/5.1.2.12 (Google WAP Proxy/1.0)",
"BlackBerry8300/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107 UP.Link/6.2.3.15.0",
"BlackBerry8320/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100",
"BlackBerry8330/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105",
"BlackBerry9000/4.6.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102",
"BlackBerry9530/4.7.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102 UP.Link/6.3.1.20.0",
"BlackBerry9700/5.0.0.351 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/123",
- "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1 (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1",
- "Mozilla/5.0 (BlackBerry; U; BlackBerry 9930; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.267 Mobile Safari/534.11+",
- "Mozilla/5.0 (Linux; Android 7.1.1; BBB100-1 Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
- "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",
- "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2342 Mobile Safari/537.10+",
- "Mozilla/5.0 (Linux; Android 5.1.1; Coolpad 3622A Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.1.1; Coolpad 3632A Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 1.5; en-us; sdk Build/CUPCAKE) AppleWebkit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 6.0; Nexus 5X Build/MDB08L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 6P Build/N2G48C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.4; Nexus 7 Build/KTU84P) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.135 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Safari/537.36 OPR/30.0.1856.93524",
- "Mozilla/5.0 (Linux; Android 7.0; Nexus 9 Build/NRD90R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.1.2; Pixel Build/NHG47N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.2; U; de-DE) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.40.1 Safari/534.6 TouchPad/1.0",
- "Mozilla/5.0 (Linux; webOS/2.2.4; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) webOSBrowser/221.56 Safari/534.6 Pre/3.0",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) Sprint:PPC6800",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) XV6800",
- "Mozilla/5.0 (Linux; U; Android 1.5; en-us; htc_bahamas Build/CRB17) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.1-update1; de-de; HTC Desire 1.19.161.5 Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "HTC_Dream Mozilla/5.0 (Linux; U; Android 1.5; en-ca; Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Sprint APA9292KT Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 1.5; de-ch; HTC Hero Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; ADR6300 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 2.1; en-us; HTC Legend Build/cupcake) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 1.5; de-de; HTC Magic Build/PLAT-RC33) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1 FirePHP/0.3",
- "Mozilla/5.0 (Linux; Android 6.0; HTC One M9 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
+ "Bloglines/3.1 (http://www.bloglines.com)",
+ "CSSCheck/1.2.2",
+ "DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
+ "DoCoMo/2.0 SH901iC(c100;TB;W24H12)",
+ "Download Demon/3.5.0.11",
+ "ELinks (0.4.3; NetBSD 3.0.2PATCH sparc64; 141x19)",
+ "ELinks (0.4pre5; Linux 2.6.10-ac7 i686; 80x33)",
+ "ELinks/0.12~pre5-4",
+ "ELinks/0.9.3 (textmode; Linux 2.6.9-kanotix-8 i686; 127x41)",
+ "EmailWolf 1.00",
+ "FAST-WebCrawler/3.8 (crawler at trd dot overture dot com; http://www.alltheweb.com/help/webmaster/crawler)",
+ "Facebot",
+ "FeedFetcher-Google; ( http://www.google.com/feedfetcher.html)",
+ "Gaisbot/3.0 (robot@gais.cs.ccu.edu.tw; http://gais.cs.ccu.edu.tw/robot.php)",
+ "Googlebot-Image/1.0",
+ "Googlebot-News",
+ "Googlebot-Video/1.0",
+ "Googlebot/2.1 ( http://www.googlebot.com/bot.html)",
+ "Gregarius/0.5.2 ( http://devlog.gregarius.net/docs/ua)",
+ "Gulper Web Bot 0.2.4 (www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot)",
"HTC-ST7377/1.59.502.3 (67150) Opera/9.50 (Windows NT 5.1; U; en) UP.Link/6.3.1.17.0",
- "Mozilla/5.0 (Linux; U; Android 1.6; en-us; HTC_TATTOO_A3288 Build/DRC79) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; Android 6.0; ALE-L21 Build/HuaweiALE-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.1; C6740N Build/LMY47O) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; LG-P870/P87020d Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
- "LG-LX550 AU-MIC-LX550/2.0 MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Mozilla/5.0 (Linux; Android 6.0; LG-D850 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.97 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; LG-H918 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; LGL84VL Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; LGUS997 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.2; LGMS323 Build/KOT49I.MS32310b) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.103 Mobile Safari/537.36",
- "POLARIS/6.01(BREW 3.1.5;U;en-us;LG;LX265;POLARIS/6.01/WAP;)MMP/2.0 profile/MIDP-201 Configuration /CLDC-1.1",
+ "HTC_Dream Mozilla/5.0 (Linux; U; Android 1.5; en-ca; Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "HTMLParser/1.6",
+ "Java/1.6.0_13",
+ "Jigsaw/2.2.5 W3C_CSS_Validator_JFouffa/2.0",
+ "Konqueror/3.0-rc4; (Konqueror/3.0-rc4; i686 Linux;;datecode)",
"LG-GC900/V10a Obigo/WAP2.0 Profile/MIDP-2.1 Configuration/CLDC-1.1",
- "Mozilla/5.0 (Linux; Android 4.4.2; LG-V410 Build/KOT49I.V41010d) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.103 Safari/537.36",
- "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; MDA Pro/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1)",
- "Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
- "Mozilla/5.0 (Linux; U; Android 1.5; en-us; T-Mobile G1 Build/CRB43) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari 525.20.1",
- "Mozilla/5.0 (Linux; U; Android 1.5; en-gb; T-Mobile_G2_Touch Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Droid Build/FRG22D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "LG-LX550 AU-MIC-LX550/2.0 MMP/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Links (2.1pre15; FreeBSD 5.3-RELEASE i386; 196x84)",
+ "Links (2.1pre15; Linux 2.4.26 i686; 158x61)",
+ "Links (2.3pre1; Linux 2.6.38-8-generic x86_64; 170x48)",
+ "Links/0.9.1 (Linux 2.4.24; i386;)",
+ "Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/0.8.12",
+ "Lynx/2.8.7dev.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8d",
"MOT-L7v/08.B7.5DR MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.0.0.0",
- "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Milestone Build/ SHOLS_U2_01.03.1) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.0.1; de-de; Milestone Build/SHOLS_U2_01.14.0) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; Android 7.0; Moto G (5) Plus Build/NPNS25.137-35-5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.1.1; XT1710-02 Build/NDS26.74-36) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "MOT-V177/0.1.75 UP.Browser/6.2.3.9.c.12 (GUI) MMP/2.0 UP.Link/6.3.1.13.0",
"MOT-V9mm/00.62 UP.Browser/6.2.3.4.c.1.123 (GUI) MMP/2.0",
"MOTORIZR-Z8/46.00.00 Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; 356) Opera 8.65 [it] UP.Link/6.3.0.0.0",
- "MOT-V177/0.1.75 UP.Browser/6.2.3.9.c.12 (GUI) MMP/2.0 UP.Link/6.3.1.13.0",
- "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
- "Mozilla/5.0 (Linux; Android 4.4.4; XT1032 Build/KXB21.14-L1.61) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36",
- "portalmmm/2.0 N410i(c20;TB)",
- "Nokia3230/2.0 (5.0614.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0",
- "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 Nokia5700/3.27; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
- "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 Nokia6120c/3.70; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
- "Nokia6230/2.0 (04.44) Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Nokia6230i/2.0 (03.80) Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Mozilla/4.1 (compatible; MSIE 5.0; Symbian OS; Nokia 6600;452) Opera 6.20 [en-US]",
- "Nokia6630/1.0 (2.39.15) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Nokia7250/1.0 (3.14) Profile/MIDP-1.0 Configuration/CLDC-1.0",
+ "MSIE (MSIE 6.0; X11; Linux; i686) Opera 7.23",
+ "Mediapartners-Google",
+ "Microsoft URL Control - 6.00.8862",
+ "Midori/0.1.10 (X11; Linux i686; U; en-us) WebKit/(531).(2)",
+ "MobileSafari/600.1.4 CFNetwork/711.1.12 Darwin/14.0.0",
+ "Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2.1",
+ "Mozilla/2.0 (compatible; Ask Jeeves/Teoma)",
+ "Mozilla/2.02E (Win95; U)",
+ "Mozilla/3.0 (compatible; NetPositive/2.1.1; BeOS)",
+ "Mozilla/3.01Gold (Win95; I)",
+ "Mozilla/4.0 (PDA; PalmOS/sony/model prmr/Revision:1.1.54 (en)) NetFront/3.0",
+ "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",
+ "Mozilla/4.0 (Windows; U; MSIE 7.0; Windows NT 6.0; .NET CLR 1.0.40727; Media Center PC 4.0; InfoPath.1; en-NZ)",
+ "Mozilla/4.0 (compatible; Dillo 3.0)",
+ "Mozilla/4.0 (compatible; GoogleToolbar 4.0.1019.5266-big; Windows XP 5.1; MSIE 6.0.2900.2180)",
+ "Mozilla/4.0 (compatible; Linux 2.6.22) NetFront/3.4 Kindle/2.0 (screen 600x800)",
+ "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; MDA Pro/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1)",
"Mozilla/4.0 (compatible; MSIE 5.0; Series80/2.0 Nokia9500/4.51 Profile/MIDP-2.0 Configuration/CLDC-1.1)",
+ "Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC)",
+ "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)",
+ "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0 )",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/hspr-H102; Blazer/4.0) 16;320x320",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12; Microsoft ZuneHD 4.3)",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) Sprint:PPC6800",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) XV6800",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 8.12; MSIEMobile6.0)",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en) Opera 8.0",
+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
+ "Mozilla/4.0 (compatible; MSIE 6.0; j2me) ReqwirelessWeb/3.5",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; Avant Browser; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Maxthon 2.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0)",
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) Asus;Galaxy6",
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)",
+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)",
+ "Mozilla/4.1 (compatible; MSIE 5.0; Symbian OS; Nokia 6600;452) Opera 6.20 [en-US]",
+ "Mozilla/4.77 [en] (X11; I; IRIX;64 6.5 IP30)",
+ "Mozilla/4.8 [en] (Windows NT 5.1; U)",
+ "Mozilla/4.8 [en] (X11; U; SunOS; 5.7 sun4u)",
+ "Mozilla/5.0 (Android 4.2; rv:19.0) Gecko/20121129 Firefox/19.0",
+ "Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0",
+ "Mozilla/5.0 (Android; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
+ "Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
+ "Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0",
+ "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.1.0.2342 Mobile Safari/537.10+",
+ "Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20060702 SeaMonkey/1.5a",
+ "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1 (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1",
+ "Mozilla/5.0 (BlackBerry; U; BlackBerry 9930; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.267 Mobile Safari/534.11+",
+ "Mozilla/5.0 (Linux U; en-US) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) Version/4.0 Kindle/3.0 (screen 600x800; rotate)",
+ "Mozilla/5.0 (Linux; Android 10; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.1.2; GT-N8013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.1.2; SHV-E250S Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.82 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.2.2; WX10K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.3; SPH-L710 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; GT-I9190) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; GT-N8000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; LG-V410 Build/KOT49I.V41010d) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.103 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; LGMS323 Build/KOT49I.MS32310b) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.103 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-G900A Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.2; SM-T230NU Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.4; Nexus 7 Build/KTU84P) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.135 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4.4; XT1032 Build/KXB21.14-L1.61) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0.1; GT-I9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0.1; SCH-R970 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.84 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0.2; Lenovo A6010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T530NU Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0; ASUS_Z00AD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.0; SM-G900F Build/LRX21T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/45.0.2454.95 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; A37f Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.126 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; A37f) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; Coolpad 3622A Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; KYF39 Build/100.0.2039; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; KYOCERA-C6742) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Safari/537.36 OPR/30.0.1856.93524",
+ "Mozilla/5.0 (Linux; Android 5.1.1; SM-E700H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; SM-J111F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1.1; vivo Y31L.RastaMod™_Version) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1; A1601) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1; C6740N Build/LMY47O) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1; Lenovo P70-A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1; Neffos C5 Max) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 5.1; OPPO A59s Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044813 Mobile Safari/537.36 MMWEBID/6148 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P1a42) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; MI 4W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; MI 5 Build/MXB48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/3072 MicroMessenger/7.0.3.1400(0x2700033C) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 6.0.1; ONE E1003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; OPPO A57 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044813 Mobile Safari/537.36 MMWEBID/6886 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 6.0.1; Redmi 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-G900F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-G900H Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-J700F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-N910C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-N910S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-N915T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0.1; SM-T550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; ALE-L21 Build/HuaweiALE-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; CAM-L23) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; HTC 2PXH3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; HTC One M9 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; LG-D850 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.97 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; Le X620 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; Lenovo A7000-a Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; NCE-AL00 Build/HUAWEINCE-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044813 Mobile Safari/537.36 MMWEBID/6904 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 6.0; Nexus 5X Build/MDB08L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; ASUS_X00GD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Alcatel_5044R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; EVA-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; FRD-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; HUAWEI VNS-L31) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; KIICAA POWER) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LG-H820) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LG-H850) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LG-H918 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LGL84VL Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LGMS428) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; LGUS997 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Lenovo K33a42) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Lenovo K33a42) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Moto G (5) Plus Build/NPNS25.137-35-5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Nexus 9 Build/NRD90R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; PIC-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; PRA-LX1 Build/HUAWEIPRA-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Redmi Note 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.5 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G925R6 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.4 Chrome/51.0.2704.106 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-A510F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-G925F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-G930F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-G955U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-J327T1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-J710FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-N9200) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; SM-T819) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; TRT-L21A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; Vivo 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; XT1585) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; YS900) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Iron Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.0; i1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; 1607-A01 Build/NMF26F; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/2867 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 7.1.1; 1713-A01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; BBB100-1 Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; CPH1801) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; Coolpad 3632A Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; Moto E (4) Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; Moto G Play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; SM-J510F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; XT1710-02 Build/NDS26.74-36) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.1; Z971) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; FP2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.0 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; FP2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3888.0 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Nexus 6P Build/N2G48C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; OC105) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Pixel Build/NHG47N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Redmi 4X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 7.1.2; Redmi 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; BLA-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; F5121) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; F5321) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; G8441) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 YaBrowser/19.1.3.198.00 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; HTC U Ultra) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; HTC U11 plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; HTC U11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LDN-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LG-H870DS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LG-H873) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LG-H873) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LG-H932) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LLD-L31) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; LND-AL30) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; Lenovo K8 Note) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; MI 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; Moto Z2 Play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; PRA-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; RNE-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-G935F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-N935F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG-SM-G891A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG-SM-G930A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-A600FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-A910F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G930F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G930V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G930V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G935F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G935F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G935U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G935V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G950U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G955F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-J737A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; SM-T820) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; WAS-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; XT1650) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; d-02K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; moto e5 cruise Build/OCPS27.91-157-12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; moto e5 plus Build/OPPS27.91-122-3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.126 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.0.0; moto e5 plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; CPH1823 Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; GM 6 d) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Infinix X624B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; LM-Q710.FG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; LM-Q925S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; LM-X210CMR) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; MI 5X Build/OPM1.171019.019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; MI PLAY) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Mi Note 3 Build/OPM1.171019.019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044813 Mobile Safari/537.36 MMWEBID/6858 MicroMessenger/7.0.5.1440(0x27000537) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Mi Note 3 Build/OPM1.171019.019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 XWEB/882 MMWEBSDK/190505 Mobile Safari/537.36 MMWEBID/358 MicroMessenger/7.0.5.1440(0x27000537) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5S) Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5S) Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5S) Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5S)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Nexus 6P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Phone 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 5 Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 6 Pro Build/OPM1.171019.019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi Note 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi Note 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi Y2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; Redmi Y2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; SM-G390F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; SM-G610M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; SM-J530F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; SM-T580) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; ZB602KL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; vivo 1726) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1.0; vivo 1802 Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 VivoBrowser/5.8.0.10",
+ "Mozilla/5.0 (Linux; Android 8.1.0; vivo 1807) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 8.1; PBBM00 Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 YaBrowser/17.6.1.345.00 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ANE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ANE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ANE-LX3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ASUS_X00QD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ASUS_X00TD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ASUS_X01BDA) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; BLA-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; CLT-AL00 Build/HUAWEICLT-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/9069 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; CLT-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; CLT-L29 Build/HUAWEICLT-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 OPR/48.1.2331.132804",
+ "Mozilla/5.0 (Linux; Android 9; CLT-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; COL-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; CPH1859) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; CPH1859) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ELE-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; EML-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; EML-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; G8141) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; G8141) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; G8341) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; G8343 Build/47.2.A.10.107; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/229.1.0.17.118;]",
+ "Mozilla/5.0 (Linux; Android 9; GM1910) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; GM1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; GM1917) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; H3223) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; H8314) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; HMA-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; INE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; INE-LX2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; JSN-AL00a Build/HONORJSN-AL00a; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/1961 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; LEX829) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/10.1 Chrome/71.0.3578.99 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LG-H930) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LLD-AL10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LM-G710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LM-G710VM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LM-G820) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LM-V405) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; LYA-L29 Build/HUAWEILYA-L29; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MHA-AL00 Build/HUAWEIMHA-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36 MMWEBID/9772 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; MI 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MI 8 Build/PKQ1.180729.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044851 Mobile Safari/537.36 MMWEBID/2901 MicroMessenger/7.0.6.1460(0x2700066A) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; MI 8 Build/PKQ1.180729.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 XWEB/882 MMWEBSDK/190506 Mobile Safari/537.36 MMWEBID/409 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; MI 8 Lite Build/PKQ1.181007.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/1409 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; MI 8 Lite) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MI 8 SE Build/PKQ1.181121.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/7941 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; MI 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MI 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.42 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MI 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; MIX 2S Build/PKQ1.180729.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/8952 MicroMessenger/7.0.6.1460(0x27000679) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; Mi A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi A2 Lite) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi A2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi MIX 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Mi MIX 2S) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Moto Z3 Play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Nokia 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Nokia 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Nokia 7.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A3010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5010 Build/PKQ1.180716.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/1699 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A5010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6003) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6010) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6013) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.5 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; PH-1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; POCO F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; POCO F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; POCOPHONE F1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; POT-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; POT-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 2 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 2 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 2 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.18 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 3a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel 3a) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; REVVLRY) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; RMX1801) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; RMX1805) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; RMX1851) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; RMX1851) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi K20 Pro Build/PKQ1.181121.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/4406 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.80 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 5 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7 Build/PKQ1.180904.001) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7 Pro Build/PKQ1.181203.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/7272 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; Redmi Note 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G950F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G950U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G960F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/8.2 Chrome/63.0.3239.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G960U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G965F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G965U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.0 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G965W Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G970F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G973F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G975F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G975U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G975U1 Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-N950F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A505F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A505FM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A505FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A530W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A600G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A705GM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-A730F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G901F Build/PQ3A.190705.003) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G950U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G955F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G955N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G955U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G9600) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G960U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G960U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G960W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36 EdgA/42.0.2.3819",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G965U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G970U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G973F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G973F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G973U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G973W) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-G975F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-J701F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-M205FN) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-M305F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N950U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N950U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N960F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SM-N960U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; SNE-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; STF-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; STK-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; VKY-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; VOG-L09 Build/HUAWEIVOG-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.128 Mobile Safari/537.36 (Ecosia android@69.0.3497.128)",
+ "Mozilla/5.0 (Linux; Android 9; VOG-L29) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; VTR-AL00 Build/HUAWEIVTR-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044807 Mobile Safari/537.36 MMWEBID/6475 MicroMessenger/7.0.6.1460(0x27000634) Process/tools NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (Linux; Android 9; VTR-L09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto g(6) plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto g(6)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto g(6)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto g(7) play) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto g(7) power) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto x4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto x4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; moto x4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; motorola one vision) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; rv:75.0.3770.67) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.67 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; Android 9; vivo 1805) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.101 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522 (KHTML, like Gecko) Safari/419.3",
+ "Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
+ "Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
+ "Mozilla/5.0 (Linux; U; Android 1.5; de-ch; HTC Hero Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; de-de; Galaxy Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; de-de; HTC Magic Build/PLAT-RC33) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1 FirePHP/0.3",
+ "Mozilla/5.0 (Linux; U; Android 1.5; en-gb; T-Mobile_G2_Touch Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; en-us; SPH-M900 Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; en-us; T-Mobile G1 Build/CRB43) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari 525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; en-us; htc_bahamas Build/CRB17) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; en-us; sdk Build/CUPCAKE) AppleWebkit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.5; fr-fr; GT-I5700 Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.6; en-us; HTC_TATTOO_A3288 Build/DRC79) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.6; en-us; SonyEricssonX10i Build/R1AA056) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 1.6; es-es; SonyEricssonX10i Build/R1FA016) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
+ "Mozilla/5.0 (Linux; U; Android 2.0.1; de-de; Milestone Build/SHOLS_U2_01.14.0) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Milestone Build/ SHOLS_U2_01.03.1) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.1-update1; de-de; HTC Desire 1.19.161.5 Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.1; en-us; HTC Legend Build/cupcake) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-ca; GT-P1000M Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-us; ADR6300 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Droid Build/FRG22D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Sprint APA9292KT Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.3.3; en-us ; LS670 Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1/UCBrowser/8.6.1.262/145/355",
+ "Mozilla/5.0 (Linux; U; Android 2.3.3; ko-kr; SHW-M250S Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; BNTV250 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1",
+ "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebkit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
+ "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
+ "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
+ "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
+ "Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
+ "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/2.1 Mobile Safari/535.19 Silk-Accelerated=true",
+ "Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; LG-P870/P87020d Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
+ "Mozilla/5.0 (Linux; U; Android 4.1; en-us; sdk Build/MR1) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.1 Safari/534.30",
+ "Mozilla/5.0 (Linux; U; Android 4.2; en-us; sdk Build/MR1) AppleWebKit/535.19 (KHTML, like Gecko) Version/4.2 Safari/535.19",
+ "Mozilla/5.0 (Linux; U; Android 4.3; en-us; sdk Build/MR1) AppleWebKit/536.23 (KHTML, like Gecko) Version/4.3 Mobile Safari/536.23",
+ "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; GT-P5210 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
+ "Mozilla/5.0 (Linux; U; Android 6.0; en-US; Redmi Note 4 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.13.0.1207 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 6.0; he-il; Redmi Note 4X Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 6.0; zh-CN; KNT-UL10 Build/HUAWEIKNT-UL10) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 Quark/3.0.2.943 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 7.0; en-US; PRA-LX1 Build/HUAWEIPRA-LX1) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.13.0.1207 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 7.0; es-es; Redmi Note 4 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 7.1.2; el-gr; Redmi 4X Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 8.1.0; en-US; Infinix X624B Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.13.0.1207 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 8.1.0; en-us; Redmi 5 Plus Build/OPM1.171019.019) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 8.1.0; es-us; Redmi Note 5 Build/OPM1.171019.011) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 8.1.0; zh-CN; EML-AL00 Build/HUAWEIEML-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 baidu.sogo.uc.UCBrowser/11.9.4.974 UWS/2.13.1.48 Mobile Safari/537.36 AliApp(DingTalk/4.5.11) com.alibaba.android.rimet/10487439 Channel/227200 language/zh-CN",
+ "Mozilla/5.0 (Linux; U; Android 8.1.0; zh-CN; Mi Note 3 Build/OPM1.171019.019) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.9.1039 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 9; en-US; ASUS_X00TD Build/PKQ1) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.12.8.1206 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 9; en-US; RMX1851 Build/PKQ1.190101.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.12.8.1206 Mobile Safari/537.36",
+ "Mozilla/5.0 (Linux; U; Android 9; en-gb; Redmi Note 7 Pro Build/PKQ1.181203.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.8-g",
+ "Mozilla/5.0 (Linux; U; Android 9; en-us; POCOPHONE F1 Build/PKQ1.180729.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/10.9.7-g",
+ "Mozilla/5.0 (Linux; U; Android 9; zh-cn; PCCM00 Build/PKQ1.190223.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36 OppoBrowser/20.6.0.0.2beta",
+ "Mozilla/5.0 (Linux; webOS/2.2.4; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) webOSBrowser/221.56 Safari/534.6 Pre/3.0",
+ "Mozilla/5.0 (MSIE 9.0; Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14931",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:55.0) Gecko/20100101 Firefox/55.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Camino/2.2.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre Camino/2.2a1pre",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20100101 Firefox/9.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:20.0) Gecko/20100101 Firefox/20.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20120813 Firefox/16.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:47.0) Gecko/20100101 Firefox/47.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 1083) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 OPR/28.0.1750.51",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.82 Safari/537.36 OPR/29.0.1795.41",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.105 Safari/537.36 Vivaldi/1.0.162.9",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2859.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.49 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Maxthon/4.5.2",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3833.99 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/10.1 Safari/603.1.30",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3312.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.101",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3542.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.88 Safari/537.36 Vivaldi/2.4.1488.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.119",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3803.0 Safari/537.36 Edg/76.0.174.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.4 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Reeder/3.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6; rv:57.0) Gecko/20100101 Firefox/57.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3864.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36 Edg/77.0.235.9",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.84 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.110 Safari/537.36 Vivaldi/2.7.1628.28",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3889.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 YaBrowser/19.6.0.1583 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3829.0 Safari/537.36 Edg/77.0.197.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.42 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Whale/1.5.75.9 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.119",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3792.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.4 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3882.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/607.2.6 (KHTML, like Gecko) Version/12.1.1 Safari/607.2.6 Maxthon/5.1.132",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.21 Safari/537.36 MMS/1.0.2531.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 YaBrowser/19.6.0.1583 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 YaBrowser/19.7.0.1990 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.119",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.110 Safari/537.36 Vivaldi/2.7.1628.30",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3835.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3872.0 Safari/537.36 Edg/78.0.244.0",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3876.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.4 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3888.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3889.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko)",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.54 Safari/535.2",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML like Gecko) Version/6.0.2 Safari/536.26.17",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.79 Safari/537.4",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.31 (KHTML like Gecko) Chrome/26.0.1410.63 Safari/537.31",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.1 (KHTML like Gecko) Version/7.0.6 Safari/537.78.1",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en; rv:1.9.2.28) Gecko/20120308 Camino/2.1.2 (like Firefox/3.6.28)",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110218 AlexaToolbar/alxf-2.0 Firefox/3.6.14",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/528.16 (KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7;en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.302.2 Safari/532.8",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.464.0 Safari/534.3",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; de-de) AppleWebKit/534.15 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.15 Safari/534.13",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_7; en-us) AppleWebKit/534.20.8 (KHTML, like Gecko) Version/5.1 Safari/534.20.8",
+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/528.16 (KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0.112941",
+ "Mozilla/5.0 (Macintosh; U; Mac OS X Mach-O; en-US; rv:2.0a) Gecko/20040614 Firefox/3.0.0",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/85.8",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.15",
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr-fr) AppleWebKit/312.5 (KHTML, like Gecko) Safari/312.3",
+ "Mozilla/5.0 (Maemo; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
+ "Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
+ "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
+ "Mozilla/5.0 (MeeGo; NokiaN950-00/00) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
+ "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 929) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537",
+ "Mozilla/5.0 (OS/2; U; OS/2; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Arora/0.11.0 Safari/533.3",
+ "Mozilla/5.0 (OS/2; U; OS/2; en-US) AppleWebKit/533.3 (KHTML, like Gecko) QupZilla/1.3.1 Safari/533.3",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.12) Gecko/20100101 Firefox/10.0.12",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.12) Gecko/20130108 Firefox/10.0.12 SeaMonkey/2.7.2",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:24.0) Gecko/20100101 Firefox/24.0",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:31.0) Gecko/20100101 Firefox/31.0",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:31.0) Gecko/20100101 Firefox/31.0 SeaMonkey/2.28",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101 Firefox/45.0",
+ "Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101 Firefox/45.0 SeaMonkey/2.42.9esr",
+ "Mozilla/5.0 (PLAYSTATION 3; 1.10)",
+ "Mozilla/5.0 (PLAYSTATION 3; 2.00)",
+ "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",
+ "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42",
"Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaC6-01/011.010; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.7.2 3gpp-gba",
"Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaC7-00/012.003; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.7.3 3gpp-gba",
- "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es50",
"Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaE6-00/021.002; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.16 Mobile Safari/533.4 3gpp-gba",
- "UCWEB/8.8 (SymbianOS/9.2; U; en-US; NokiaE63) AppleWebKit/534.1 UCBrowser/8.8.0.245 Mobile",
- "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es65",
"Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaE7-00/010.016; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.7.3 3gpp-gba",
+ "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/014.002; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.6.4 3gpp-gba",
+ "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaX7-00/021.004; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.21 Mobile Safari/533.4 3gpp-gba",
+ "Mozilla/5.0 (SymbianOS 9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344",
+ "Mozilla/5.0 (SymbianOS/9.1; U; de) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
+ "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
+ "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es50",
+ "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es65",
"Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es70",
+ "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 Nokia5700/3.27; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
+ "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 Nokia6120c/3.70; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
"Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE90-1/07.24.0.3; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.2.3.18.0",
- "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 530) like Gecko",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)",
- "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 630) like Gecko",
+ "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/10.0.018; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.3.0.0.0",
+ "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344",
+ "Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 SonyEricssonP100/01; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 Safari/525",
+ "Mozilla/5.0 (Unknown; U; UNIX BSD/SYSV system; C -) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.2",
+ "Mozilla/5.0 (Unknown; UNIX BSD/SYSV system) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.7.0 Safari/538.1",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.91 Safari/537.36 Vivaldi/1.92.917.39",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; ARM; Lumia 950 Dual SIM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.13705.206 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 OPR/36.0.2130.46",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.90 Safari/537.36 Vivaldi/1.4.589.11",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 AOL/11.0 AOLBUILD/11.0.1305 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36 LBBROWSER",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 OPR/47.0.2631.55",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.6.1000",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.2000",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.5000",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 YaBrowser/18.3.1.1220 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3676.400 QQBrowser/10.4.3469.400",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3704.400 QQBrowser/10.4.3587.400",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3722.400 QQBrowser/10.5.3739.400",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3722.400 QQBrowser/10.5.3763.400",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 YaBrowser/19.3.1.828 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.122 Safari/537.36 Vivaldi/2.3.1440.61",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Whale/1.5.75.9 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.105 Safari/537.36 Vivaldi/2.4.1488.38",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3724.8 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3730.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.1.114 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.2.455 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.2.470 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.2.516 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.35",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.25 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3879.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.4 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/5.0.4.3000 Chrome/47.0.2526.73 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/80.0.180 Chrome/74.0.3729.180 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; MATBJS; rv:11.0) like Gecko",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; MALNJS; rv:11.0) like Gecko",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0",
+ "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240&Win32",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2869.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3191.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.220 Whale/1.3.51.7 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3436.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.70",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.83",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.88 Safari/537.36 Vivaldi/2.4.1488.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.172 Safari/537.36 Vivaldi/2.5.1525.48",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3850.0 Iron Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.109",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.72",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.88",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.99",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.102 Safari/537.36 Vivaldi/2.6.1566.44",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116 (Edition Campaign 34)",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.117",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3798.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36 OPR/63.0.3368.35",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3835.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.10 Safari/537.36 Edg/77.0.235.5",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36 OPR/64.0.3409.0 (Edition developer)",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.42 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3866.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3872.0 Safari/537.36 Edg/78.0.244.0",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3879.0 Safari/537.36 Edg/78.0.249.1",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3880.4 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3881.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3887.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3887.7 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3889.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3890.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0",
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0",
+ "Mozilla/5.0 (Windows NT 10.0; rv:45.9) Gecko/20100101 Goanna/3.2 Firefox/45.9 PaleMoon/27.4.0",
+ "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 YaBrowser/17.3.0.1785 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) MxBrowser/4.5.10.7000 Chrome/30.0.1551.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0",
+ "Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35",
+ "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0",
+ "Mozilla/5.0 (Windows NT 5.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
+ "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2",
+ "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0",
+ "Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20100101 Firefox/14.0.1",
+ "Mozilla/5.0 (Windows NT 6.0; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36 OPR/15.0.1147.24 (Edition Next)",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.62 YaBrowser/19.9.0.918 (beta) Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 YaBrowser/19.9.1.64 (beta) Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) baidu.sogo.uc.Chrome/36.0.1985.125 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.71 (KHTML like Gecko) WebVideo/1.0.1.10 Version/7.0 Safari/537.71",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.27 (KHTML, like Gecko) Chrome/12.0.712.0 Safari/534.27",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Beamrise/17.2.0.9 Chrome/17.0.939.0 Safari/535.8",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML like Gecko) Maxthon/4.0.0.2000 Chrome/22.0.1229.79 Safari/537.1",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.12 Safari/537.36 OPR/14.0.1116.4",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36 OPR/19.0.1326.56",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36 OPR/20.0.1387.91",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.94.2 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36 OPR/31.0.1889.174",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.5977.400 LBBROWSER/10.1.3752.400",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3947.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3704.400 QQBrowser/10.4.3587.400",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3722.400 QQBrowser/10.5.3738.400",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.2.455 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.2.516 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.143 YaBrowser/19.7.3.172 Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.71 Safari/537.36 OPR/63.0.3368.17 (Edition beta)",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.6.1000 Chrome/30.0.1599.101 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) SFive/64.0 Chrome/64.0.3282.204 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/80.0.180 Chrome/74.0.3729.180 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120422 Firefox/12.0 SeaMonkey/2.9",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100815 Minefield/4.0b4pre",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0a2) Gecko/20110622 Firefox/6.0a2",
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; rv:68.0) Gecko/20100101 Firefox/68.0",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.102 Safari/537.36 Vivaldi/2.0.1309.3",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3542.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.132",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.122 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3724.8 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.99",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3786.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3804.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3835.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.19 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.42 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3879.0 Safari/537.36 Edg/78.0.249.0",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/29.0",
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:35.0) Gecko/20100101 Firefox/35.0",
+ "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0",
+ "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20130401 Firefox/21.0",
+ "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
+ "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6",
+ "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
"Mozilla/5.0 (Windows NT 6.2; ARM; Trident/7.0; Touch; rv:11.0; WPDesktop; NOKIA; Lumia 635) like Gecko",
"Mozilla/5.0 (Windows NT 6.2; ARM; Trident/7.0; Touch; rv:11.0; WPDesktop; NOKIA; Lumia 920) like Geckoo",
+ "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1469.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36 OPR/28.0.1750.40",
+ "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3068.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0",
+ "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0) Gecko/16.0 Firefox/16.0",
+ "Mozilla/5.0 (Windows NT 6.2; rv:19.0) Gecko/20121129 Firefox/19.0",
+ "Mozilla/5.0 (Windows NT 6.2; rv:20.0) Gecko/20121202 Firefox/20.0",
+ "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36 OPR/18.0.1284.49",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36 Maxthon/5.2.7.5000",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3800.0 Iron Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.109",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.117",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3875.0 Safari/537.36",
+ "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0",
+ "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0",
+ "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 530) like Gecko",
+ "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 630) like Gecko",
"Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920) like Gecko",
- "NokiaN70-1/5.0609.2.0.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.13.0",
- "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
- "NokiaN73-1/3.0649.0.0.1 Series60/3.0 Profile/MIDP2.0 Configuration/CLDC-1.1",
- "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/014.002; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.6.4 3gpp-gba",
- "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
- "Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
- "Mozilla/5.0 (SymbianOS/9.1; U; de) AppleWebKit/413 (KHTML, like Gecko) Safari/413",
- "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/10.0.018; Profile/MIDP-2.0 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.3.0.0.0",
- "Mozilla/5.0 (MeeGo; NokiaN950-00/00) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",
- "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344",
- "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaX7-00/021.004; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.21 Mobile Safari/533.4 3gpp-gba",
+ "Mozilla/5.0 (Windows; U; ; en-NZ) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.8.0",
+ "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko Netscape/7.1 (ax)",
+ "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021001 Phoenix/0.2",
+ "Mozilla/5.0 (Windows; U; Windows CE 5.1; rv:1.8.1a3) Gecko/20060610 Minimo/0.016",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; BOLT/2.800) AppleWebKit/534.6 (KHTML, like Gecko) Version/5.0 Safari/534.6.3",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0E)",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8",
+ "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.108 Safari/537.36 UCBrowser/12.13.0.1207",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9pre) Gecko/2008072421 Minefield/3.0.2pre",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Maxthon/3.0.8.2 Safari/533.1",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/9.0.601.0 Safari/534.14",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 GTB5",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.17) Gecko/20110123 (like Firefox/3.x) SeaMonkey/2.0.12",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.14 (KHTML, like Gecko) Chrome/10.0.601.0 Safari/534.14",
+ "Mozilla/5.0 (Windows; U; Windows NT 6.2; es-US ) AppleWebKit/540.0 (KHTML like Gecko) Version/6.0 Safari/8900.00",
+ "Mozilla/5.0 (Windows; U; Windows XP) Gecko MultiZilla/1.6.1.0a",
+ "Mozilla/5.0 (WindowsCE 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (X11; CentOS; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0",
+ "Mozilla/5.0 (X11; CrOS aarch64 12239.67.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.102 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",
+ "Mozilla/5.0 (X11; CrOS x86_64 11647.154.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.114 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS x86_64 12105.100.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.144 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS x86_64 12239.67.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.102 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS x86_64 12371.22.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS x86_64 12425.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3877.0 Safari/537.36",
+ "Mozilla/5.0 (X11; CrOS x86_64 5841.83.0) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.138 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3178.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0",
+ "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ Epiphany/2.30.6",
+ "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/536.5 (KHTML like Gecko) Chrome/19.0.1084.56 Safari/536.5",
+ "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36",
+ "Mozilla/5.0 (X11; FreeBSD amd64) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.79 Safari/537.4",
+ "Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20100101 Firefox/5.0",
+ "Mozilla/5.0 (X11; FreeBSD amd64; rv:54.0) Gecko/20100101 Firefox/54.0",
+ "Mozilla/5.0 (X11; FreeBSD i386; rv:28.0) Gecko/20100101 Firefox/28.0 SeaMonkey/2.25",
+ "Mozilla/5.0 (X11; Linux 3.8-6.dmz.1-liquorix-686) KHTML/4.8.4 (like Gecko) Konqueror/4.8",
+ "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/72.0.3626.121 Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3187.0 Safari/537.366",
+ "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) QupZilla/1.2.0 Safari/534.34",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.04 Chromium/14.0.825.0 Chrome/14.0.825.0 Safari/535.1",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.120 Chrome/15.0.874.120 Safari/535.2",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1478.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2166.2 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36 OPR/40.0.2308.62",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.78 Chrome/60.0.3112.78 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.6 Safari/538.1",
+ "Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1",
+ "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120502 Firefox/12.0 SeaMonkey/2.9.1",
+ "Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1 Iceweasel/14.0.1",
+ "Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (X11; Linux i686; rv:2.0b6pre) Gecko/20100907 Firefox/4.0b6pre",
+ "Mozilla/5.0 (X11; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:40.0) Gecko/20100101 Firefox/40.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:46.0) Gecko/20100101 Firefox/46.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46",
+ "Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0",
+ "Mozilla/5.0 (X11; Linux i686; rv:6.0a2) Gecko/20110615 Firefox/6.0a2 Iceweasel/6.0a2",
+ "Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.703.0 Chrome/12.0.703.0 Safari/534.24",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.20 Safari/535.1",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) konqueror/4.14.10 Safari/537.21",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.32 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.32 Epiphany/3.8.2",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/36.0.1985.125 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.166 Safari/537.36 OPR/20.0.1396.73172",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 OPR/32.0.1948.25",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36 Vivaldi/1.0.344.37",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2876.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3269.3 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.71",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 YaBrowser/18.11.1.715 (beta) Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.113 Safari/537.36 Vivaldi/2.1.1337.51",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.107",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.59",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.70",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.158 Safari/537.36 Vivaldi/2.5.1525.43",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 YaBrowser/19.6.2.594 (beta) Yowser/2.5 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36 OPR/62.0.3331.116",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.49",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.145 Safari/537.36 Vivaldi/2.6.1566.51",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.111 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3844.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.35 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3876.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3889.0 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Falkon/3.0.0 Chrome/65.0.3325.230 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/67.0.3396.99 Chrome/67.0.3396.99 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/68.0.3440.75 Chrome/68.0.3440.75 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/69.0.3497.81 Chrome/69.0.3497.81 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.86 Chrome/73.0.3683.86 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/74.0.3729.169 Chrome/74.0.3729.169 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/75.0.3770.142 Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/75.0.3770.90 Chrome/75.0.3770.90 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/76.0.3809.100 Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/76.0.3809.87 Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/75.0.3770.142 Chrome/75.0.3770.142 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/76.0.3809.100 Chrome/76.0.3809.100 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) snap Chromium/76.0.3809.87 Chrome/76.0.3809.87 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML like Gecko) Chrome/22.0.1229.56 Safari/537.4",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.9.0 Safari/538.1",
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/604.1 (KHTML, like Gecko) Version/11.0 Safari/604.1 Ubuntu/17.04 (3.24.1-0ubuntu1) Epiphany/3.24.1",
+ "Mozilla/5.0 (X11; Linux x86_64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36",
+ "Mozilla/5.0 (X11; Linux x86_64; en-US; rv:2.0b2pre) Gecko/20100712 Minefield/4.0b2pre",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120724 Debian Iceweasel/15.02",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 Iceweasel/19.0.2",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0",
+ "Mozilla/5.0 (X11; Linux x86_64; rv:7.0a1) Gecko/20110623 Firefox/7.0a1",
+ "Mozilla/5.0 (X11; Linux) KHTML/4.9.1 (like Gecko) Konqueror/4.9",
+ "Mozilla/5.0 (X11; NetBSD amd64; rv:16.0) Gecko/20121102 Firefox/16.0",
+ "Mozilla/5.0 (X11; NetBSD amd64; rv:30.0) Gecko/20100101 Firefox/30.0",
+ "Mozilla/5.0 (X11; NetBSD x86; en-us) AppleWebKit/666.6+ (KHTML, like Gecko) Chromium/20.0.0000.00 Chrome/20.0.0000.00 Safari/666.6+",
+ "Mozilla/5.0 (X11; NetBSD) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
+ "Mozilla/5.0 (X11; OpenBSD amd64; rv:28.0) Gecko/20100101 Firefox/28.0",
+ "Mozilla/5.0 (X11; OpenBSD amd64; rv:30.0) Gecko/20100101 Firefox/30.0",
+ "Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
+ "Mozilla/5.0 (X11; U; FreeBSD i386; de-CH; rv:1.9.2.8) Gecko/20100729 Firefox/3.6.8",
+ "Mozilla/5.0 (X11; U; FreeBSD i386; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.207.0 Safari/532.0",
+ "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15",
+ "Mozilla/5.0 (X11; U; FreeBSD x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16",
+ "Mozilla/5.0 (X11; U; FreeBSD; i386; en-US; rv:1.7) Gecko",
+ "Mozilla/5.0 (X11; U; Linux arm7tdmi; rv:1.8.1.11) Gecko/20071130 Minimo/0.025",
+ "Mozilla/5.0 (X11; U; Linux armv61; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1",
+ "Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020",
+ "Mozilla/5.0 (X11; U; Linux armv7l like Android; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/533.2+ Kindle/3.0+",
+ "Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.3) Gecko/20040924 Epiphany/1.4.4 (Ubuntu)",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Chrome/4.0.237.0 Safari/532.4 Debian",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Chrome/4.0.277.0 Safari/532.8",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.15 (KHTML, like Gecko) Ubuntu/10.10 Chromium/10.0.613.0 Chrome/10.0.613.0 Safari/534.15",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040614 Firefox/0.8",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 MG(Novarra-Vision/6.9)",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061024 Firefox/2.0 (Swiftfox)",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080716 (Gentoo) Galeon/2.0.6",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060309 Ubuntu/9.10 (karmic) Firefox/3.0.11",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko Galeon/2.0.6 (Ubuntu 2.0.6-2)",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120421 Gecko Firefox/11.0",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2",
+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a3pre) Gecko/20070330",
+ "Mozilla/5.0 (X11; U; Linux i686; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.0.5603M",
+ "Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/528.5 (KHTML, like Gecko, Safari/528.5 ) lt-GtkLauncher",
+ "Mozilla/5.0 (X11; U; Linux i686; it; rv:1.9.2.3) Gecko/20100406 Firefox/3.6.3 (Swiftfox)",
+ "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8",
+ "Mozilla/5.0 (X11; U; Linux i686; pt-PT; rv:1.9.2.3) Gecko/20100402 Iceweasel/3.6.3 (like Firefox/3.6.3) GTB7.0",
+ "Mozilla/5.0 (X11; U; Linux i686; rv:19.0) Gecko/20100101 Slackware/13 Firefox/19.0",
+ "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8.1.13) Gecko/20080313 Iceape/1.1.9 (Debian-1.1.9-5)",
+ "Mozilla/5.0 (X11; U; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.94 Safari/535.1",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-AU) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IT",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.309.0 Safari/532.9",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.15 (KHTML, like Gecko) Chrome/10.0.613.0 Safari/534.15",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.5.0IT",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/540.0 (KHTML, like Gecko) Ubuntu/10.10 Chrome/9.1.0.0 Safari/540.0",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092814 (Debian-3.0.1-1)",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.13) Gecko/20100916 Iceape/2.0.8",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20091020 Linux Mint/8 (Helena) Firefox/3.5.3",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091107 Firefox/3.5.5",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100915 Gentoo Firefox/3.6.9",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AT",
+ "Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36 Puffin/4.8.0.2965AT",
+ "Mozilla/5.0 (X11; U; Linux x86_64; sv-SE; rv:1.8.1.12) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12",
+ "Mozilla/5.0 (X11; U; Linux x86_64; us; rv:1.9.1.19) Gecko/20110430 shadowfox/7.0 (like Firefox/7.0",
+ "Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.10.1",
+ "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Debian/1.6-7",
+ "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Epiphany/1.2.5",
+ "Mozilla/5.0 (X11; U; Linux; i686; en-US; rv:1.6) Gecko Galeon/1.3.14",
+ "Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Namoroka/3.6.15",
+ "Mozilla/5.0 (X11; U; OpenBSD arm; en-us) AppleWebKit/531.2 (KHTML, like Gecko) Safari/531.2 Epiphany/2.30.0",
+ "Mozilla/5.0 (X11; U; OpenBSD i386; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.359.0 Safari/533.3",
+ "Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.1) Gecko/20090702 Firefox/3.5",
+ "Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.8.1.12) Gecko/20080303 SeaMonkey/1.1.8",
+ "Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1b3) Gecko/20090429 Firefox/3.1b3",
+ "Mozilla/5.0 (X11; U; SunOS sun4m; en-US; rv:1.4b) Gecko/20030517 Mozilla Firebird/0.6",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Safari/605.1.15 Epiphany/605.1.15",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0",
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0",
+ "Mozilla/5.0 (X11; Ubuntu; Linux; rv:67.0) Gecko/20100101 Firefox/67.0",
+ "Mozilla/5.0 (compatible; Exabot/3.0; http://www.exabot.com/go/robot)",
+ "Mozilla/5.0 (compatible; Googlebot/2.1; http://www.google.com/bot.html)",
+ "Mozilla/5.0 (compatible; Konqueror/3.3; Linux 2.6.8-gentoo-r3; X11;",
+ "Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.30-7.dmz.1-liquorix-686; X11) KHTML/3.5.10 (like Gecko) (Debian package 4:3.5.10.dfsg.1-1 b1)",
+ "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; en_US) KHTML/3.5.6 (like Gecko) (Kubuntu)",
+ "Mozilla/5.0 (compatible; Konqueror/3.5; NetBSD 4.0_RC3; X11) KHTML/3.5.7 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/3.5; SunOS) KHTML/3.5.1 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/4.1; DragonFly) KHTML/4.1.4 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/4.1; OpenBSD) KHTML/4.1.4 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.4 (like Gecko) Slackware/13.0",
+ "Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.1 (like Gecko) Fedora/4.3.1-3.fc11",
+ "Mozilla/5.0 (compatible; Konqueror/4.4; Linux 2.6.32-22-generic; X11; en_US) KHTML/4.4.3 (like Gecko) Kubuntu",
+ "Mozilla/5.0 (compatible; Konqueror/4.4; Linux) KHTML/4.4.1 (like Gecko) Fedora/4.4.1-1.fc12",
+ "Mozilla/5.0 (compatible; Konqueror/4.5; FreeBSD) KHTML/4.5.4 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; amd64; en_US) KHTML/4.5.4 (like Gecko)",
+ "Mozilla/5.0 (compatible; Konqueror/4.5; Windows) KHTML/4.5.4 (like Gecko)",
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch)",
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)",
+ "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Win64; x64; Trident/5.0; .NET CLR 3.7.50745; Media Center PC 6.0; Zune 4.7; .NET4.0C; en-MT)",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; XBLWP7; ZuneWP7) UCBrowser/2.9.0.263",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; Trident/5.0)",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; WOW64; Trident/5.0)",
+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)",
+ "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)",
+ "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)",
+ "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)",
+ "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
+ "Mozilla/5.0 (compatible; alexa site audit/1.0; +http://www.alexa.com/help/webmasters; )",
+ "Mozilla/5.0 (compatible; archive.org_bot +http://www.archive.org/details/archive.org_bot)",
+ "Mozilla/5.0 (compatible; archive.org_bot; Wayback Machine Live Record; +http://archive.org/details/archive.org_bot)",
+ "Mozilla/5.0 (compatible; bingbot/2.0 http://www.bing.com/bingbot.htm)",
+ "Mozilla/5.0 (en-us) AppleWebKit/525.13 (KHTML, like Gecko; Google Web Preview) Version/3.1 Safari/525.13",
+ "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.2; U; de-DE) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.40.1 Safari/534.6 TouchPad/1.0",
+ "Mozilla/5.0 (iPad; CPU OS 10_0 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/49.0.2623.109 Mobile/14A5335b Safari/601.1.46",
+ "Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5362a Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;WeRead/4.1.3 (iPad; iOS 12.3.1; Scale/2.00)",
+ "Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPad; CPU OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Flipboard/4.2.48",
+ "Mozilla/5.0 (iPad; CPU OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/79.0.259819395 Mobile/17A5556d Safari/604.1",
+ "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3",
+ "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25",
+ "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.12 Mobile/11A465 Safari/8536.25 (3B92C18B-D9DE-4CB7-A02A-22FD2AF17C8F)",
+ "Mozilla/5.0 (iPad; CPU OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",
+ "Mozilla/5.0 (iPad; CPU OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML like Gecko) Mobile/12A405 Version/7.0 Safari/9537.53",
+ "Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4",
+ "Mozilla/5.0 (iPad; CPU OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69",
+ "Mozilla/5.0 (iPad; CPU OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1",
+ "Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13G36 Safari/601.1",
+ "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
+ "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
+ "Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5",
+ "Mozilla/5.0 (iPad; U; CPU iPad OS 5_0_1 like Mac OS X; en-us) AppleWebKit/535.1+ (KHTML like Gecko) Version/7.2.0.0 Safari/6533.18.5",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/18.0.130791545 Mobile/14A5345a Safari/600.1.4",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A346 Safari/602.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 MicroMessenger/7.0.4(0x17000428) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Mobile/14G60 MicroMessenger/7.0.5(0x17000523) NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A356 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5362a Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0 Mobile/15C202 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_5 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0 Mobile/15D60 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0 Mobile/15D100 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15G77 MicroMessenger/7.0.3(0x17000321) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/67.0.3396.69 Mobile/16A366 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/74.0.3729.155 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/75.0.3770.103 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16B92 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16C104 MicroMessenger/7.0.5(0x17000523) NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/75.0.3770.103 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/71.0.3578.89 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/75.0.3770.103 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/80.0.262003652 Mobile/16F203 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.4(0x17000428) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/en",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.79 Mobile/16G77 Safari/602.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/74.0.3729.121 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.123 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/79.0.259819395 Mobile/16G77 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/80.0.262003652 Mobile/16G77 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.3(0x17000321) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.4(0x17000428) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/4G Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/605.1.15 Version/12.2.1.0.4",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) OPT/1.10.1 Mobile/15E148",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/76.0.3809.81 Mobile/15E148 Safari/605.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/8.0.57838 Mobile/12H321 Safari/600.1.4",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1",
+ "Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13C75 Safari/601.1",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.200",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/531.22.7",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; da-dk) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8F190",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; da-dk) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
+ "Mozilla/5.0 (iPhone; U; CPU iPhone OS) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
+ "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420 (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3",
+ "Mozilla/5.0 (iPod touch; CPU iPhone OS 7_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML like Gecko) Version/7.0 Mobile/11D167 Safari/123E71C",
+ "Mozilla/5.0 (iPod; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/44.0.2403.67 Mobile/12H143 Safari/600.1.4",
+ "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20",
+ "Mozilla/5.0 (iPod; U; CPU iPhone OS 3_1_1 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Mobile/7C145",
+ "Mozilla/5.0 (iPod; U; CPU iPhone OS 6_1 like Mac OS X; en-HK) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/3.9174IP Mobile",
"Mozilla/5.0 (webOS/1.3; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Desktop/1.0",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/hspr-H102; Blazer/4.0) 16;320x320",
- "SEC-SGHE900/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1378; nl; U; ssr)",
- "Mozilla/5.0 (Linux; U; Android 1.5; de-de; Galaxy Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-ca; GT-P1000M Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
- "Mozilla/5.0 (Linux; Android 4.3; SPH-L710 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.99 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.0.1; SCH-R970 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.84 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-G900A Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; GT-P5210 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
- "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebkit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
+ "Mozilla/5.0 Slackware/13.37 (X11; U; Linux x86_64; en-US) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41",
+ "NetSurf/1.2 (NetBSD; amd64)",
+ "Nokia3230/2.0 (5.0614.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0",
+ "Nokia6100/1.0 (04.01) Profile/MIDP-1.0 Configuration/CLDC-1.0",
+ "Nokia6230/2.0 (04.44) Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Nokia6230i/2.0 (03.80) Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Nokia6630/1.0 (2.3.129) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Nokia6630/1.0 (2.39.15) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Nokia7250/1.0 (3.14) Profile/MIDP-1.0 Configuration/CLDC-1.0",
+ "NokiaN70-1/5.0609.2.0.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.13.0",
+ "NokiaN73-1/3.0649.0.0.1 Series60/3.0 Profile/MIDP2.0 Configuration/CLDC-1.1",
+ "Offline Explorer/2.5",
+ "Opera/10.61 (J2ME/MIDP; Opera Mini/5.1.21219/19.999; en-US; rv:1.9.3a5) WebKit/534.5 Presto/2.6.30",
+ "Opera/7.50 (Windows ME; U) [en]",
+ "Opera/7.50 (Windows XP; U)",
+ "Opera/7.51 (Windows NT 5.1; U) [en]",
+ "Opera/8.01 (J2ME/MIDP; Opera Mini/1.0.1479/HiFi; SonyEricsson P900; no; U; ssr)",
+ "Opera/9.0 (Macintosh; PPC Mac OS X; U; en)",
+ "Opera/9.20 (Macintosh; Intel Mac OS X; U; en)",
+ "Opera/9.25 (Windows NT 6.0; U; en)",
+ "Opera/9.30 (Nintendo Wii; U; ; 2047-7; en)",
+ "Opera/9.5 (Microsoft Windows; PPC; Opera Mobi; U) SonyEricssonX1i/R2AA Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Opera/9.51 Beta (Microsoft Windows; PPC; Opera Mobi/1718; U; en)",
+ "Opera/9.60 (J2ME/MIDP; Opera Mini/4.1.11320/608; U; en) Presto/2.2.0",
+ "Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14320/554; U; cs) Presto/2.2.0",
+ "Opera/9.64 (Macintosh; PPC Mac OS X; U; en) Presto/2.1.1",
+ "Opera/9.64 (X11; Linux i686; U; Linux Mint; nb) Presto/2.1.1",
+ "Opera/9.80 (Android 4.0.4; Linux; Opera Mobi/ADR-1205181138; U; pl) Presto/2.10.254 Version/12.00",
+ "Opera/9.80 (Android; Opera Mini/42.0.2254/150.36; U; en) Presto/2.12.423 Version/12.16",
+ "Opera/9.80 (Android; Opera Mini/43.3.2254/150.36; U; en) Presto/2.12.423 Version/12.16",
+ "Opera/9.80 (Android; Opera Mini/7.5.33361/31.1543; U; en) Presto/2.8.119 Version/11.1010",
+ "Opera/9.80 (Android; Opera Mini/7.6.40234/151.113; U; en) Presto/2.12.423 Version/12.16",
+ "Opera/9.80 (Android; Opera Mini/9.0.1829/66.318; U; en) Presto/2.12.423 Version/12.16",
+ "Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.16823/1428; U; en) Presto/2.2.0",
+ "Opera/9.80 (J2ME/MIDP; Opera Mini/8.0.35626/37.8918; U; en) Presto/2.12.423 Version/12.16",
+ "Opera/9.80 (Linux i686; Opera Mobi/1040; U; en) Presto/2.5.24 Version/10.00",
+ "Opera/9.80 (Macintosh; Intel Mac OS X 10.4.11; U; en) Presto/2.7.62 Version/11.00",
+ "Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
+ "Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.6.30 Version/10.61",
+ "Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; ru) Presto/2.4.18 Version/10.00",
+ "Opera/9.80 (Windows NT 5.1; U; zh-tw) Presto/2.8.131 Version/11.10",
+ "Opera/9.80 (Windows NT 5.2; U; en) Presto/2.2.15 Version/10.10",
+ "Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14",
+ "Opera/9.80 (Windows NT 6.1; U; en) Presto/2.7.62 Version/11.01",
+ "Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
+ "Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.16",
+ "Opera/9.80 (X11; FreeBSD 8.1-RELEASE i386; Edition Next) Presto/2.12.388 Version/12.10",
+ "Opera/9.80 (X11; Linux i686) Presto/2.12.388 Version/12.16",
+ "Opera/9.80 (X11; Linux i686; U; en) Presto/2.2.15 Version/10.10",
+ "Opera/9.80 (X11; Linux x86_64; U; pl) Presto/2.7.62 Version/11.00",
+ "P3P Validator",
+ "POLARIS/6.01 (BREW 3.1.5; U; en-us; LG; LX265; POLARIS/6.01/WAP) MMP/2.0 profile/MIDP-2.1 Configuration/CLDC-1.1",
+ "POLARIS/6.01(BREW 3.1.5;U;en-us;LG;LX265;POLARIS/6.01/WAP;)MMP/2.0 profile/MIDP-201 Configuration /CLDC-1.1",
+ "Peach/1.01 (Ubuntu 8.04 LTS; U; en)",
+ "Python-urllib/2.5",
+ "Roku/DVP-4.1 (024.01E01250A)",
"SAMSUNG-S8000/S8000XXIF3 SHP/VPP/R5 Jasmine/1.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1 FirePHP/0.3",
- "Mozilla/5.0 (Linux; U; Android 1.5; en-us; SPH-M900 Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
"SAMSUNG-SGH-A867/A867UCHJ3 SHP/VPP/R5 NetFront/35 SMM-MMS/1.2.0 profile/MIDP-2.0 configuration/CLDC-1.1 UP.Link/6.3.0.0.0",
+ "SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
+ "SEC-SGHE900/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1378; nl; U; ssr)",
"SEC-SGHX210/1.0 UP.Link/6.3.1.13.0",
- "Mozilla/5.0 (Linux; Android 6.0.1; SM-G900H Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G925R6 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.4 Chrome/51.0.2704.106 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36",
- "Mozilla/5.0 (Linux; U; Android 1.5; fr-fr; GT-I5700 Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
"SEC-SGHX820/1.0 NetFront/3.2 Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "Screaming Frog SEO Spider/8.1",
+ "SearchExpress",
"SonyEricssonK310iv/R4DA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.13.0",
"SonyEricssonK550i/R1JD Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonK610i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonK750i/R1CA Browser/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.16823/1428; U; en) Presto/2.2.0",
"SonyEricssonK800i/R1CB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.0.0.0",
"SonyEricssonK810i/R1KG Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Opera/8.01 (J2ME/MIDP; Opera Mini/1.0.1479/HiFi; SonyEricsson P900; no; U; ssr)",
"SonyEricssonS500i/R6BC Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 SonyEricssonP100/01; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 Safari/525",
- "SonyEricssonT68/R201A",
"SonyEricssonT100/R101",
"SonyEricssonT610/R201 Profile/MIDP-1.0 Configuration/CLDC-1.0",
"SonyEricssonT650i/R7AA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
+ "SonyEricssonT68/R201A",
"SonyEricssonW580i/R6BC Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonW660i/R6AD Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonW810i/R4EA Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.0.0.0",
"SonyEricssonW850i/R1ED Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonW950i/R100 Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; 323) Opera 8.60 [en-US]",
"SonyEricssonW995/R1EA Profile/MIDP-2.1 Configuration/CLDC-1.1 UNTRUSTED/1.0",
- "Mozilla/5.0 (Linux; U; Android 1.6; es-es; SonyEricssonX10i Build/R1FA016) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 1.6; en-us; SonyEricssonX10i Build/R1AA056) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Opera/9.5 (Microsoft Windows; PPC; Opera Mobi; U) SonyEricssonX1i/R2AA Profile/MIDP-2.0 Configuration/CLDC-1.1",
"SonyEricssonZ800/R1Y Browser/SEMC-Browser/4.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.0.0.0",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12; Microsoft ZuneHD 4.3)",
- "Opera/9.80 (Android; Opera Mini/7.5.33361/31.1543; U; en) Presto/2.8.119 Version/11.1010",
- "Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0",
- "Mozilla/5.0 (Android 6.0.1; Mobile; rv:48.0) Gecko/48.0 Firefox/48.0",
- "Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522 (KHTML, like Gecko) Safari/419.3",
- "Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
- "HTC_Dream Mozilla/5.0 (Linux; U; Android 1.5; en-ca; Build/CUPCAKE) AppleWebKit/528.5 (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1",
- "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Sprint APA9292KT Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-us; ADR6300 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Linux; U; Android 2.2; en-ca; GT-P1000M Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
- "Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
- "Mozilla/5.0 (Linux; U; Android 3.0.1; fr-fr; A500 Build/HRI66) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
- "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
- "Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
- "Opera/9.80 (Android 4.0.4; Linux; Opera Mobi/ADR-1205181138; U; pl) Presto/2.10.254 Version/12.00",
- "Mozilla/5.0 (Android; Linux armv7l; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 Fennec/10.0.1",
- "Mozilla/5.0 (Linux; Android 4.1.2; SHV-E250S Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.82 Mobile Safari/537.36",
- "Mozilla/5.0 (Android 4.2; rv:19.0) Gecko/20121129 Firefox/19.0",
- "Mozilla/5.0 (Linux; U; Android 4.3; en-us; sdk Build/MR1) AppleWebKit/536.23 (KHTML, like Gecko) Version/4.3 Mobile Safari/536.23",
- "Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/BuildID) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-T537A Build/KOT49H) AppleWebKit/537.36 (KHTML like Gecko) Chrome/35.0.1916.141 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 4.4.2; SM-T230NU Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.0.1; SCH-R970 Build/LRX22C) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.84 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T530NU Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.2 Chrome/38.0.2125.102 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 7 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Safari/537.36 OPR/30.0.1856.93524",
- "Mozilla/5.0 (Linux; Android 6.0; HTC One M9 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 6.0; LG-D850 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.97 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 6.0; Nexus 5X Build/MDB08L) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 6.0.1; SM-G900H Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; Nexus 9 Build/NRD90R) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.124 Safari/537.36",
- "Mozilla/5.0 (Linux; Android 7.0; LG-H918 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (Linux; Android 8.0.0; Pixel XL Build/OPR6.170623.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.107 Mobile Safari/537.36",
- "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420 (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.200",
- "Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16",
- "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
- "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; da-dk) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8F190",
- "MobileSafari/600.1.4 CFNetwork/711.1.12 Darwin/14.0.0",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; da-dk) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13C75 Safari/601.1",
- "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5362a Safari/604.1",
- "Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
- "Mozilla/5.0 (Maemo; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1",
- "Mozilla/5.0 (webOS/1.3; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Desktop/1.0",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PalmSource/hspr-H102; Blazer/4.0) 16;320x320",
- "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaN8-00/014.002; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.2.6.4 3gpp-gba",
- "Mozilla/5.0 (Symbian/3; Series60/5.2 NokiaX7-00/021.004; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/533.4 (KHTML, like Gecko) NokiaBrowser/7.3.1.21 Mobile Safari/533.4 3gpp-gba",
- "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE90-1/07.24.0.3; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 UP.Link/6.2.3.18.0",
- "Mozilla/5.0 (SymbianOS 9.4; Series60/5.0 NokiaN97-1/10.0.012; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) WicKed/7.1.12344",
- "Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; ru) Presto/2.4.18 Version/10.00",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12; Microsoft ZuneHD 4.3)",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11) Sprint:PPC6800",
- "Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 8.12; MSIEMobile6.0)",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0) Asus;Galaxy6",
- "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0)",
- "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch)",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)",
- "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 530) like Gecko",
- "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)",
- "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 630) like Gecko",
- "Mozilla/5.0 (Windows NT 6.2; ARM; Trident/7.0; Touch; rv:11.0; WPDesktop; NOKIA; Lumia 635) like Gecko",
- "Mozilla/5.0 (Windows NT 6.2; ARM; Trident/7.0; Touch; rv:11.0; WPDesktop; NOKIA; Lumia 920) like Geckoo",
- "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920) like Gecko",
- "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 929) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537",
- "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; DEVICE INFO) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Mobile Safari/537.36 Edge/12.0",
- "Mozilla/5.0 (Windows NT 10.0; ARM; Lumia 950 Dual SIM) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393",
- "DoCoMo/2.0 SH901iC(c100;TB;W24H12)",
- "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 MG(Novarra-Vision/6.9)",
- "Mozilla/4.0 (compatible; MSIE 6.0; j2me) ReqwirelessWeb/3.5",
- "Vodafone/1.0/V802SE/SEJ001 Browser/SEMC-Browser/4.1",
- "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/5.0.3.3 UP.Link/5.1.2.12 (Google WAP Proxy/1.0)",
- "Nokia6100/1.0 (04.01) Profile/MIDP-1.0 Configuration/CLDC-1.0",
- "Nokia6630/1.0 (2.3.129) SymbianOS/8.0 Series60/2.6 Profile/MIDP-2.0 Configuration/CLDC-1.1",
- "Mozilla/2.0 (compatible; Ask Jeeves/Teoma)",
- "Baiduspider ( http://www.baidu.com/search/spider.htm)",
- "Mozilla/5.0 (compatible; bingbot/2.0 http://www.bing.com/bingbot.htm)",
- "Mozilla/5.0 (compatible; Exabot/3.0; http://www.exabot.com/go/robot)",
- "FAST-WebCrawler/3.8 (crawler at trd dot overture dot com; http://www.alltheweb.com/help/webmaster/crawler)",
- "AdsBot-Google ( http://www.google.com/adsbot.html)",
- "Mozilla/5.0 (compatible; Googlebot/2.1; http://www.google.com/bot.html)",
- "Googlebot/2.1 ( http://www.googlebot.com/bot.html)",
- "Googlebot-Image/1.0",
- "Mediapartners-Google",
- "DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
- "Mozilla/5.0 (iPhone; U; CPU iPhone OS) (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
- "SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; http://www.google.com/bot.html)",
- "Googlebot-News",
- "Googlebot-Video/1.0",
- "Mozilla/4.0 (compatible; GoogleToolbar 4.0.1019.5266-big; Windows XP 5.1; MSIE 6.0.2900.2180)",
- "Mozilla/5.0 (en-us) AppleWebKit/525.13 (KHTML, like Gecko; Google Web Preview) Version/3.1 Safari/525.13",
- "msnbot/1.0 ( http://search.msn.com/msnbot.htm)",
- "msnbot/1.1 ( http://search.msn.com/msnbot.htm)",
- "msnbot/0.11 ( http://search.msn.com/msnbot.htm)",
- "msnbot-media/1.1 ( http://search.msn.com/msnbot.htm)",
- "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)",
- "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)",
- "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)",
- "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
- "Mozilla/5.0 (compatible; archive.org_bot +http://www.archive.org/details/archive.org_bot)",
- "Mozilla/5.0 (compatible; archive.org_bot; Wayback Machine Live Record; +http://archive.org/details/archive.org_bot)",
- "Mozilla/5.0 (compatible; alexa site audit/1.0; +http://www.alexa.com/help/webmasters; )",
- "EmailWolf 1.00",
- "facebookexternalhit/1.1",
- "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)",
- "Facebot",
- "Gaisbot/3.0 (robot@gais.cs.ccu.edu.tw; http://gais.cs.ccu.edu.tw/robot.php)",
- "grub-client-1.5.3; (grub-client-1.5.3; Crawl your own stuff with http://grub.org)",
- "Gulper Web Bot 0.2.4 (www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot)",
- "Screaming Frog SEO Spider/8.1",
+ "SuperBot/4.4.0.60 (Windows XP)",
"TurnitinBot (https://turnitin.com/robot/crawlerinfo.html)",
"Twitterbot/1.0",
- "Xenu Link Sleuth/1.3.8",
- "Mozilla/3.0 (compatible; NetPositive/2.1.1; BeOS)",
- "Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20060702 SeaMonkey/1.5a",
- "Mozilla/5.0 (OS/2; U; OS/2; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Arora/0.11.0 Safari/533.3",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.12) Gecko/20100101 Firefox/10.0.12",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:24.0) Gecko/20100101 Firefox/24.0",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:31.0) Gecko/20100101 Firefox/31.0",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101 Firefox/45.0",
- "Mozilla/5.0 (OS/2; U; OS/2; en-US) AppleWebKit/533.3 (KHTML, like Gecko) QupZilla/1.3.1 Safari/533.3",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:10.0.12) Gecko/20130108 Firefox/10.0.12 SeaMonkey/2.7.2",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:31.0) Gecko/20100101 Firefox/31.0 SeaMonkey/2.28",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35",
- "Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101 Firefox/45.0 SeaMonkey/2.42.9esr",
- "Adobe Application Manager 2.0",
- "AndroidDownloadManager/5.1 (Linux; U; Android 5.1; Z820 Build/LMY47D)",
- "Download Demon/3.5.0.11",
- "Offline Explorer/2.5",
- "SuperBot/4.4.0.60 (Windows XP)",
- "WebCopier v4.6",
+ "UCWEB/8.8 (SymbianOS/9.2; U; en-US; NokiaE63) AppleWebKit/534.1 UCBrowser/8.8.0.245 Mobile",
+ "UCWEB/8.8 (iPhone; CPU OS_6; en-US)AppleWebKit/534.1 U3/3.0.0 Mobile",
+ "Uzbl (Webkit 1.3) (Linux i686 [i686])",
+ "Vodafone/1.0/V802SE/SEJ001 Browser/SEMC-Browser/4.1",
+ "W3C_Validator/1.305.2.12 libwww-perl/5.64",
+ "W3C_Validator/1.654",
+ "WDG_Validator/1.6.2",
"Web Downloader/6.9",
+ "WebCopier v4.6",
"WebZIP/3.5 (http://www.spidersoft.com)",
+ "Wget/1.12 (freebsd8.1)",
"Wget/1.9 cvs-stable (Red Hat modified)",
"Wget/1.9.1",
- "Wget/1.12 (freebsd8.1)",
- "Bloglines/3.1 (http://www.bloglines.com)",
+ "Xenu Link Sleuth/1.3.8",
"everyfeed-spider/2.0 (http://www.everyfeed.com)",
- "FeedFetcher-Google; ( http://www.google.com/feedfetcher.html)",
- "Gregarius/0.5.2 ( http://devlog.gregarius.net/docs/ua)",
- "Mozilla/5.0 (PLAYSTATION 3; 2.00)",
- "Mozilla/5.0 (PLAYSTATION 3; 1.10)",
- "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",
- "Opera/9.30 (Nintendo Wii; U; ; 2047-7; en)",
- "wii libnup/1.0",
- "Java/1.6.0_13",
- "libwww-perl/5.820",
- "Peach/1.01 (Ubuntu 8.04 LTS; U; en)",
- "Python-urllib/2.5",
- "HTMLParser/1.6",
- "Jigsaw/2.2.5 W3C_CSS_Validator_JFouffa/2.0",
- "W3C_Validator/1.654",
- "W3C_Validator/1.305.2.12 libwww-perl/5.64",
- "P3P Validator",
- "CSSCheck/1.2.2",
- "WDG_Validator/1.6.2",
+ "facebookexternalhit/1.1",
+ "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)",
"facebookscraper/1.0( http://www.facebook.com/sharescraper_help.php)",
"grub-client-1.5.3; (grub-client-1.5.3; Crawl your own stuff with http://grub.org)",
"iTunes/4.2 (Macintosh; U; PPC Mac OS X 10.2)",
- "Microsoft URL Control - 6.00.8862",
- "Roku/DVP-4.1 (024.01E01250A)",
- "Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42",
- "SearchExpress",
+ "iTunes/9.0.2 (Windows; N)",
+ "iTunes/9.0.3 (Macintosh; U; Intel Mac OS X 10_6_2; en-ca)",
+ "libwww-perl/5.820",
+ "msnbot-media/1.1 ( http://search.msn.com/msnbot.htm)",
+ "msnbot/0.11 ( http://search.msn.com/msnbot.htm)",
+ "msnbot/1.0 ( http://search.msn.com/msnbot.htm)",
+ "msnbot/1.1 ( http://search.msn.com/msnbot.htm)",
+ "mukewang/7.2.0 (iPhone; iOS 12.3.1; Scale/2.00) webview",
+ "nook browser/1.0",
+ "osee2unifiedRelease/1466 osee2unifiedReleaseVersion/6.9.1 Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148",
+ "portalmmm/2.0 N410i(c20;TB)",
+ "w3m/0.5.1",
+ "wii libnup/1.0",
}
)
diff --git a/vendor/github.com/disintegration/imaging/.travis.yml b/vendor/github.com/disintegration/imaging/.travis.yml
index 1d4bdd5c03..7ae5e4b25a 100644
--- a/vendor/github.com/disintegration/imaging/.travis.yml
+++ b/vendor/github.com/disintegration/imaging/.travis.yml
@@ -1,10 +1,8 @@
language: go
go:
- - "1.7.x"
- - "1.8.x"
- - "1.9.x"
- "1.10.x"
- "1.11.x"
+ - "1.12.x"
before_install:
- go get github.com/mattn/goveralls
diff --git a/vendor/github.com/disintegration/imaging/README.md b/vendor/github.com/disintegration/imaging/README.md
index f7d6fb4d64..a1fd764d2c 100644
--- a/vendor/github.com/disintegration/imaging/README.md
+++ b/vendor/github.com/disintegration/imaging/README.md
@@ -129,6 +129,35 @@ Original image | Saturation = 30
-----------------------------------|----------------------------------------------|---------------------------------------------
 |  | 
+## FAQ
+
+### Incorrect image orientation after processing (e.g. an image appears rotated after resizing)
+
+Most probably, the given image contains the EXIF orientation tag.
+The stadard `image/*` packages do not support loading and saving
+this kind of information. To fix the issue, try opening images with
+the `AutoOrientation` decode option. If this option is set to `true`,
+the image orientation is changed after decoding, according to the
+orientation tag (if present). Here's the example:
+
+```go
+img, err := imaging.Open("test.jpg", imaging.AutoOrientation(true))
+```
+
+### What's the difference between `imaging` and `gift` packages?
+
+[imaging](https://github.com/disintegration/imaging)
+is designed to be a lightweight and simple image manipulation package.
+It provides basic image processing functions and a few helper functions
+such as `Open` and `Save`. It consistently returns *image.NRGBA image
+type (8 bits per channel, RGBA).
+
+[gift](https://github.com/disintegration/gift)
+supports more advanced image processing, for example, sRGB/Linear color
+space conversions. It also supports different output image types
+(e.g. 16 bits per channel) and provides easy-to-use API for chaining
+multiple processing steps together.
+
## Example code
```go
diff --git a/vendor/github.com/disintegration/imaging/adjust.go b/vendor/github.com/disintegration/imaging/adjust.go
index 9e628ffced..daaf1de860 100644
--- a/vendor/github.com/disintegration/imaging/adjust.go
+++ b/vendor/github.com/disintegration/imaging/adjust.go
@@ -91,11 +91,12 @@ func AdjustContrast(img image.Image, percentage float64) *image.NRGBA {
v := (100.0 + percentage) / 100.0
for i := 0; i < 256; i++ {
- if 0 <= v && v <= 1 {
+ switch {
+ case 0 <= v && v <= 1:
lut[i] = clamp((0.5 + (float64(i)/255.0-0.5)*v) * 255.0)
- } else if 1 < v && v < 2 {
+ case 1 < v && v < 2:
lut[i] = clamp((0.5 + (float64(i)/255.0-0.5)*(1/(2.0-v))) * 255.0)
- } else {
+ default:
lut[i] = uint8(float64(i)/255.0+0.5) * 255
}
}
diff --git a/vendor/github.com/go-redis/redis/.travis.yml b/vendor/github.com/go-redis/redis/.travis.yml
index 6b110b4cbb..06d7897b4e 100644
--- a/vendor/github.com/go-redis/redis/.travis.yml
+++ b/vendor/github.com/go-redis/redis/.travis.yml
@@ -8,6 +8,7 @@ go:
- 1.9.x
- 1.10.x
- 1.11.x
+ - 1.12.x
- tip
matrix:
diff --git a/vendor/github.com/go-redis/redis/README.md b/vendor/github.com/go-redis/redis/README.md
index 7d05b44661..6c8d99af72 100644
--- a/vendor/github.com/go-redis/redis/README.md
+++ b/vendor/github.com/go-redis/redis/README.md
@@ -9,7 +9,7 @@ Supports:
- Redis 3 commands except QUIT, MONITOR, SLOWLOG and SYNC.
- Automatic connection pooling with [circuit breaker](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) support.
- [Pub/Sub](https://godoc.org/github.com/go-redis/redis#PubSub).
-- [Transactions](https://godoc.org/github.com/go-redis/redis#Multi).
+- [Transactions](https://godoc.org/github.com/go-redis/redis#example-Client-TxPipeline).
- [Pipeline](https://godoc.org/github.com/go-redis/redis#example-Client-Pipeline) and [TxPipeline](https://godoc.org/github.com/go-redis/redis#example-Client-TxPipeline).
- [Scripting](https://godoc.org/github.com/go-redis/redis#Script).
- [Timeouts](https://godoc.org/github.com/go-redis/redis#Options).
@@ -143,4 +143,4 @@ BenchmarkRedisClusterPing-4 100000 11535 ns/op 117 B/op
- [Golang PostgreSQL ORM](https://github.com/go-pg/pg)
- [Golang msgpack](https://github.com/vmihailenco/msgpack)
-- [Golang message task queue](https://github.com/go-msgqueue/msgqueue)
+- [Golang message task queue](https://github.com/vmihailenco/taskq)
diff --git a/vendor/github.com/go-redis/redis/cluster.go b/vendor/github.com/go-redis/redis/cluster.go
index 0cecc62c4b..ab2c76f05e 100644
--- a/vendor/github.com/go-redis/redis/cluster.go
+++ b/vendor/github.com/go-redis/redis/cluster.go
@@ -703,12 +703,12 @@ func (c *ClusterClient) WithContext(ctx context.Context) *ClusterClient {
if ctx == nil {
panic("nil context")
}
- c2 := c.copy()
+ c2 := c.clone()
c2.ctx = ctx
return c2
}
-func (c *ClusterClient) copy() *ClusterClient {
+func (c *ClusterClient) clone() *ClusterClient {
cp := *c
cp.init()
return &cp
@@ -1198,6 +1198,7 @@ func (c *ClusterClient) WrapProcessPipeline(
fn func(oldProcess func([]Cmder) error) func([]Cmder) error,
) {
c.processPipeline = fn(c.processPipeline)
+ c.processTxPipeline = fn(c.processTxPipeline)
}
func (c *ClusterClient) defaultProcessPipeline(cmds []Cmder) error {
@@ -1537,16 +1538,21 @@ func (c *ClusterClient) pubSub() *PubSub {
panic("node != nil")
}
- slot := hashtag.Slot(channels[0])
-
var err error
- node, err = c.slotMasterNode(slot)
+ if len(channels) > 0 {
+ slot := hashtag.Slot(channels[0])
+ node, err = c.slotMasterNode(slot)
+ } else {
+ node, err = c.nodes.Random()
+ }
if err != nil {
return nil, err
}
cn, err := node.Client.newConn()
if err != nil {
+ node = nil
+
return nil, err
}
diff --git a/vendor/github.com/go-redis/redis/command.go b/vendor/github.com/go-redis/redis/command.go
index cb4f94b122..dde513be2d 100644
--- a/vendor/github.com/go-redis/redis/command.go
+++ b/vendor/github.com/go-redis/redis/command.go
@@ -218,6 +218,25 @@ func (cmd *Cmd) Uint64() (uint64, error) {
}
}
+func (cmd *Cmd) Float32() (float32, error) {
+ if cmd.err != nil {
+ return 0, cmd.err
+ }
+ switch val := cmd.val.(type) {
+ case int64:
+ return float32(val), nil
+ case string:
+ f, err := strconv.ParseFloat(val, 32)
+ if err != nil {
+ return 0, err
+ }
+ return float32(f), nil
+ default:
+ err := fmt.Errorf("redis: unexpected type=%T for Float32", val)
+ return 0, err
+ }
+}
+
func (cmd *Cmd) Float64() (float64, error) {
if cmd.err != nil {
return 0, cmd.err
@@ -585,6 +604,17 @@ func (cmd *StringCmd) Uint64() (uint64, error) {
return strconv.ParseUint(cmd.Val(), 10, 64)
}
+func (cmd *StringCmd) Float32() (float32, error) {
+ if cmd.err != nil {
+ return 0, cmd.err
+ }
+ f, err := strconv.ParseFloat(cmd.Val(), 32)
+ if err != nil {
+ return 0, err
+ }
+ return float32(f), nil
+}
+
func (cmd *StringCmd) Float64() (float64, error) {
if cmd.err != nil {
return 0, cmd.err
@@ -687,12 +717,12 @@ func (cmd *StringSliceCmd) readReply(rd *proto.Reader) error {
func stringSliceParser(rd *proto.Reader, n int64) (interface{}, error) {
ss := make([]string, 0, n)
for i := int64(0); i < n; i++ {
- s, err := rd.ReadString()
- if err == Nil {
+ switch s, err := rd.ReadString(); {
+ case err == Nil:
ss = append(ss, "")
- } else if err != nil {
+ case err != nil:
return nil, err
- } else {
+ default:
ss = append(ss, s)
}
}
diff --git a/vendor/github.com/go-redis/redis/internal/pool/conn.go b/vendor/github.com/go-redis/redis/internal/pool/conn.go
index 1095bfe59b..ac48113b63 100644
--- a/vendor/github.com/go-redis/redis/internal/pool/conn.go
+++ b/vendor/github.com/go-redis/redis/internal/pool/conn.go
@@ -17,14 +17,16 @@ type Conn struct {
rdLocked bool
wr *proto.Writer
- InitedAt time.Time
- pooled bool
- usedAt atomic.Value
+ Inited bool
+ pooled bool
+ createdAt time.Time
+ usedAt atomic.Value
}
func NewConn(netConn net.Conn) *Conn {
cn := &Conn{
- netConn: netConn,
+ netConn: netConn,
+ createdAt: time.Now(),
}
cn.rd = proto.NewReader(netConn)
cn.wr = proto.NewWriter(netConn)
diff --git a/vendor/github.com/go-redis/redis/internal/pool/pool.go b/vendor/github.com/go-redis/redis/internal/pool/pool.go
index 9cecee8ad4..cd4c8d69cc 100644
--- a/vendor/github.com/go-redis/redis/internal/pool/pool.go
+++ b/vendor/github.com/go-redis/redis/internal/pool/pool.go
@@ -38,7 +38,7 @@ type Pooler interface {
Get() (*Conn, error)
Put(*Conn)
- Remove(*Conn)
+ Remove(*Conn, error)
Len() int
IdleLen() int
@@ -289,7 +289,7 @@ func (p *ConnPool) popIdle() *Conn {
func (p *ConnPool) Put(cn *Conn) {
if !cn.pooled {
- p.Remove(cn)
+ p.Remove(cn, nil)
return
}
@@ -300,7 +300,7 @@ func (p *ConnPool) Put(cn *Conn) {
p.freeTurn()
}
-func (p *ConnPool) Remove(cn *Conn) {
+func (p *ConnPool) Remove(cn *Conn, reason error) {
p.removeConn(cn)
p.freeTurn()
_ = p.closeConn(cn)
@@ -468,7 +468,7 @@ func (p *ConnPool) isStaleConn(cn *Conn) bool {
if p.opt.IdleTimeout > 0 && now.Sub(cn.UsedAt()) >= p.opt.IdleTimeout {
return true
}
- if p.opt.MaxConnAge > 0 && now.Sub(cn.InitedAt) >= p.opt.MaxConnAge {
+ if p.opt.MaxConnAge > 0 && now.Sub(cn.createdAt) >= p.opt.MaxConnAge {
return true
}
diff --git a/vendor/github.com/go-redis/redis/internal/pool/pool_single.go b/vendor/github.com/go-redis/redis/internal/pool/pool_single.go
index b35b78afbd..cd0289b684 100644
--- a/vendor/github.com/go-redis/redis/internal/pool/pool_single.go
+++ b/vendor/github.com/go-redis/redis/internal/pool/pool_single.go
@@ -1,53 +1,203 @@
package pool
+import (
+ "fmt"
+ "sync/atomic"
+)
+
+const (
+ stateDefault = 0
+ stateInited = 1
+ stateClosed = 2
+)
+
+type BadConnError struct {
+ wrapped error
+}
+
+var _ error = (*BadConnError)(nil)
+
+func (e BadConnError) Error() string {
+ return "pg: Conn is in a bad state"
+}
+
+func (e BadConnError) Unwrap() error {
+ return e.wrapped
+}
+
type SingleConnPool struct {
- cn *Conn
+ pool Pooler
+ level int32 // atomic
+
+ state uint32 // atomic
+ ch chan *Conn
+
+ _badConnError atomic.Value
}
var _ Pooler = (*SingleConnPool)(nil)
-func NewSingleConnPool(cn *Conn) *SingleConnPool {
- return &SingleConnPool{
- cn: cn,
+func NewSingleConnPool(pool Pooler) *SingleConnPool {
+ p, ok := pool.(*SingleConnPool)
+ if !ok {
+ p = &SingleConnPool{
+ pool: pool,
+ ch: make(chan *Conn, 1),
+ }
+ }
+ atomic.AddInt32(&p.level, 1)
+ return p
+}
+
+func (p *SingleConnPool) SetConn(cn *Conn) {
+ if atomic.CompareAndSwapUint32(&p.state, stateDefault, stateInited) {
+ p.ch <- cn
+ } else {
+ panic("not reached")
}
}
func (p *SingleConnPool) NewConn() (*Conn, error) {
- panic("not implemented")
+ return p.pool.NewConn()
}
-func (p *SingleConnPool) CloseConn(*Conn) error {
- panic("not implemented")
+func (p *SingleConnPool) CloseConn(cn *Conn) error {
+ return p.pool.CloseConn(cn)
}
func (p *SingleConnPool) Get() (*Conn, error) {
- return p.cn, nil
+ // In worst case this races with Close which is not a very common operation.
+ for i := 0; i < 1000; i++ {
+ switch atomic.LoadUint32(&p.state) {
+ case stateDefault:
+ cn, err := p.pool.Get()
+ if err != nil {
+ return nil, err
+ }
+ if atomic.CompareAndSwapUint32(&p.state, stateDefault, stateInited) {
+ return cn, nil
+ }
+ p.pool.Remove(cn, ErrClosed)
+ case stateInited:
+ if err := p.badConnError(); err != nil {
+ return nil, err
+ }
+ cn, ok := <-p.ch
+ if !ok {
+ return nil, ErrClosed
+ }
+ return cn, nil
+ case stateClosed:
+ return nil, ErrClosed
+ default:
+ panic("not reached")
+ }
+ }
+ return nil, fmt.Errorf("pg: SingleConnPool.Get: infinite loop")
}
func (p *SingleConnPool) Put(cn *Conn) {
- if p.cn != cn {
- panic("p.cn != cn")
+ defer func() {
+ if recover() != nil {
+ p.freeConn(cn)
+ }
+ }()
+ p.ch <- cn
+}
+
+func (p *SingleConnPool) freeConn(cn *Conn) {
+ if err := p.badConnError(); err != nil {
+ p.pool.Remove(cn, err)
+ } else {
+ p.pool.Put(cn)
}
}
-func (p *SingleConnPool) Remove(cn *Conn) {
- if p.cn != cn {
- panic("p.cn != cn")
- }
+func (p *SingleConnPool) Remove(cn *Conn, reason error) {
+ defer func() {
+ if recover() != nil {
+ p.pool.Remove(cn, ErrClosed)
+ }
+ }()
+ p._badConnError.Store(BadConnError{wrapped: reason})
+ p.ch <- cn
}
func (p *SingleConnPool) Len() int {
- return 1
+ switch atomic.LoadUint32(&p.state) {
+ case stateDefault:
+ return 0
+ case stateInited:
+ return 1
+ case stateClosed:
+ return 0
+ default:
+ panic("not reached")
+ }
}
func (p *SingleConnPool) IdleLen() int {
- return 0
+ return len(p.ch)
}
func (p *SingleConnPool) Stats() *Stats {
- return nil
+ return &Stats{}
}
func (p *SingleConnPool) Close() error {
+ level := atomic.AddInt32(&p.level, -1)
+ if level > 0 {
+ return nil
+ }
+
+ for i := 0; i < 1000; i++ {
+ state := atomic.LoadUint32(&p.state)
+ if state == stateClosed {
+ return ErrClosed
+ }
+ if atomic.CompareAndSwapUint32(&p.state, state, stateClosed) {
+ close(p.ch)
+ cn, ok := <-p.ch
+ if ok {
+ p.freeConn(cn)
+ }
+ return nil
+ }
+ }
+
+ return fmt.Errorf("pg: SingleConnPool.Close: infinite loop")
+}
+
+func (p *SingleConnPool) Reset() error {
+ if p.badConnError() == nil {
+ return nil
+ }
+
+ select {
+ case cn, ok := <-p.ch:
+ if !ok {
+ return ErrClosed
+ }
+ p.pool.Remove(cn, ErrClosed)
+ p._badConnError.Store(BadConnError{wrapped: nil})
+ default:
+ return fmt.Errorf("pg: SingleConnPool does not have a Conn")
+ }
+
+ if !atomic.CompareAndSwapUint32(&p.state, stateInited, stateDefault) {
+ state := atomic.LoadUint32(&p.state)
+ return fmt.Errorf("pg: invalid SingleConnPool state: %d", state)
+ }
+
+ return nil
+}
+
+func (p *SingleConnPool) badConnError() error {
+ if v := p._badConnError.Load(); v != nil {
+ err := v.(BadConnError)
+ if err.wrapped != nil {
+ return err
+ }
+ }
return nil
}
diff --git a/vendor/github.com/go-redis/redis/internal/pool/pool_sticky.go b/vendor/github.com/go-redis/redis/internal/pool/pool_sticky.go
index 91bd913330..3e8f503633 100644
--- a/vendor/github.com/go-redis/redis/internal/pool/pool_sticky.go
+++ b/vendor/github.com/go-redis/redis/internal/pool/pool_sticky.go
@@ -55,13 +55,13 @@ func (p *StickyConnPool) putUpstream() {
func (p *StickyConnPool) Put(cn *Conn) {}
-func (p *StickyConnPool) removeUpstream() {
- p.pool.Remove(p.cn)
+func (p *StickyConnPool) removeUpstream(reason error) {
+ p.pool.Remove(p.cn, reason)
p.cn = nil
}
-func (p *StickyConnPool) Remove(cn *Conn) {
- p.removeUpstream()
+func (p *StickyConnPool) Remove(cn *Conn, reason error) {
+ p.removeUpstream(reason)
}
func (p *StickyConnPool) Len() int {
@@ -101,7 +101,7 @@ func (p *StickyConnPool) Close() error {
if p.reusable {
p.putUpstream()
} else {
- p.removeUpstream()
+ p.removeUpstream(ErrClosed)
}
}
diff --git a/vendor/github.com/go-redis/redis/internal/util.go b/vendor/github.com/go-redis/redis/internal/util.go
index ffd2353e0e..80a600381d 100644
--- a/vendor/github.com/go-redis/redis/internal/util.go
+++ b/vendor/github.com/go-redis/redis/internal/util.go
@@ -27,3 +27,13 @@ func isLower(s string) bool {
}
return true
}
+
+func Unwrap(err error) error {
+ u, ok := err.(interface {
+ Unwrap() error
+ })
+ if !ok {
+ return nil
+ }
+ return u.Unwrap()
+}
diff --git a/vendor/github.com/go-redis/redis/pipeline.go b/vendor/github.com/go-redis/redis/pipeline.go
index b3a8844af0..2714ceb81d 100644
--- a/vendor/github.com/go-redis/redis/pipeline.go
+++ b/vendor/github.com/go-redis/redis/pipeline.go
@@ -8,6 +8,19 @@ import (
type pipelineExecer func([]Cmder) error
+// Pipeliner is an mechanism to realise Redis Pipeline technique.
+//
+// Pipelining is a technique to extremely speed up processing by packing
+// operations to batches, send them at once to Redis and read a replies in a
+// singe step.
+// See https://redis.io/topics/pipelining
+//
+// Pay attention, that Pipeline is not a transaction, so you can get unexpected
+// results in case of big pipelines and small read/write timeouts.
+// Redis client has retransmission logic in case of timeouts, pipeline
+// can be retransmitted and commands can be executed more then once.
+// To avoid this: it is good idea to use reasonable bigger read/write timeouts
+// depends of your batch size and/or use TxPipeline.
type Pipeliner interface {
StatefulCmdable
Do(args ...interface{}) *Cmd
diff --git a/vendor/github.com/go-redis/redis/pubsub.go b/vendor/github.com/go-redis/redis/pubsub.go
index 0afb47cda3..03b01566ba 100644
--- a/vendor/github.com/go-redis/redis/pubsub.go
+++ b/vendor/github.com/go-redis/redis/pubsub.go
@@ -3,6 +3,7 @@ package redis
import (
"errors"
"fmt"
+ "strings"
"sync"
"time"
@@ -13,7 +14,7 @@ import (
var errPingTimeout = errors.New("redis: ping timeout")
-// PubSub implements Pub/Sub commands bas described in
+// PubSub implements Pub/Sub commands as described in
// http://redis.io/topics/pubsub. Message receiving is NOT safe
// for concurrent use by multiple goroutines.
//
@@ -29,8 +30,9 @@ type PubSub struct {
cn *pool.Conn
channels map[string]struct{}
patterns map[string]struct{}
- closed bool
- exit chan struct{}
+
+ closed bool
+ exit chan struct{}
cmd *Cmd
@@ -39,6 +41,12 @@ type PubSub struct {
ping chan struct{}
}
+func (c *PubSub) String() string {
+ channels := mapKeys(c.channels)
+ channels = append(channels, mapKeys(c.patterns)...)
+ return fmt.Sprintf("PubSub(%s)", strings.Join(channels, ", "))
+}
+
func (c *PubSub) init() {
c.exit = make(chan struct{})
}
@@ -389,16 +397,39 @@ func (c *PubSub) ReceiveMessage() (*Message, error) {
// It periodically sends Ping messages to test connection health.
// The channel is closed with PubSub. Receive* APIs can not be used
// after channel is created.
+//
+// If the Go channel is full for 30 seconds the message is dropped.
func (c *PubSub) Channel() <-chan *Message {
- c.chOnce.Do(c.initChannel)
+ return c.channel(100)
+}
+
+// ChannelSize is like Channel, but creates a Go channel
+// with specified buffer size.
+func (c *PubSub) ChannelSize(size int) <-chan *Message {
+ return c.channel(size)
+}
+
+func (c *PubSub) channel(size int) <-chan *Message {
+ c.chOnce.Do(func() {
+ c.initChannel(size)
+ })
+ if cap(c.ch) != size {
+ err := fmt.Errorf("redis: PubSub.Channel is called with different buffer size")
+ panic(err)
+ }
return c.ch
}
-func (c *PubSub) initChannel() {
- c.ch = make(chan *Message, 100)
- c.ping = make(chan struct{}, 10)
+func (c *PubSub) initChannel(size int) {
+ const timeout = 30 * time.Second
+
+ c.ch = make(chan *Message, size)
+ c.ping = make(chan struct{}, 1)
go func() {
+ timer := time.NewTimer(timeout)
+ timer.Stop()
+
var errCount int
for {
msg, err := c.Receive()
@@ -413,6 +444,7 @@ func (c *PubSub) initChannel() {
errCount++
continue
}
+
errCount = 0
// Any message is as good as a ping.
@@ -427,16 +459,24 @@ func (c *PubSub) initChannel() {
case *Pong:
// Ignore.
case *Message:
- c.ch <- msg
+ timer.Reset(timeout)
+ select {
+ case c.ch <- msg:
+ if !timer.Stop() {
+ <-timer.C
+ }
+ case <-timer.C:
+ internal.Logf(
+ "redis: %s channel is full for %s (message is dropped)",
+ c, timeout)
+ }
default:
- internal.Logf("redis: unknown message: %T", msg)
+ internal.Logf("redis: unknown message type: %T", msg)
}
}
}()
go func() {
- const timeout = 5 * time.Second
-
timer := time.NewTimer(timeout)
timer.Stop()
diff --git a/vendor/github.com/go-redis/redis/redis.go b/vendor/github.com/go-redis/redis/redis.go
index aca30648f5..2a6013c332 100644
--- a/vendor/github.com/go-redis/redis/redis.go
+++ b/vendor/github.com/go-redis/redis/redis.go
@@ -51,11 +51,10 @@ func (c *baseClient) newConn() (*pool.Conn, error) {
return nil, err
}
- if cn.InitedAt.IsZero() {
- if err := c.initConn(cn); err != nil {
- _ = c.connPool.CloseConn(cn)
- return nil, err
- }
+ err = c.initConn(cn)
+ if err != nil {
+ _ = c.connPool.CloseConn(cn)
+ return nil, err
}
return cn, nil
@@ -85,12 +84,13 @@ func (c *baseClient) _getConn() (*pool.Conn, error) {
return nil, err
}
- if cn.InitedAt.IsZero() {
- err := c.initConn(cn)
- if err != nil {
- c.connPool.Remove(cn)
+ err = c.initConn(cn)
+ if err != nil {
+ c.connPool.Remove(cn, err)
+ if err := internal.Unwrap(err); err != nil {
return nil, err
}
+ return nil, err
}
return cn, nil
@@ -102,7 +102,7 @@ func (c *baseClient) releaseConn(cn *pool.Conn, err error) {
}
if internal.IsBadConn(err, false) {
- c.connPool.Remove(cn)
+ c.connPool.Remove(cn, err)
} else {
c.connPool.Put(cn)
}
@@ -116,12 +116,15 @@ func (c *baseClient) releaseConnStrict(cn *pool.Conn, err error) {
if err == nil || internal.IsRedisError(err) {
c.connPool.Put(cn)
} else {
- c.connPool.Remove(cn)
+ c.connPool.Remove(cn, err)
}
}
func (c *baseClient) initConn(cn *pool.Conn) error {
- cn.InitedAt = time.Now()
+ if cn.Inited {
+ return nil
+ }
+ cn.Inited = true
if c.opt.Password == "" &&
c.opt.DB == 0 &&
@@ -201,9 +204,7 @@ func (c *baseClient) defaultProcess(cmd Cmder) error {
return err
}
- err = cn.WithReader(c.cmdTimeout(cmd), func(rd *proto.Reader) error {
- return cmd.readReply(rd)
- })
+ err = cn.WithReader(c.cmdTimeout(cmd), cmd.readReply)
c.releaseConn(cn, err)
if err != nil && internal.IsRetryableError(err, cmd.readTimeout() == nil) {
continue
@@ -237,7 +238,7 @@ func (c *baseClient) cmdTimeout(cmd Cmder) time.Duration {
func (c *baseClient) Close() error {
var firstErr error
if c.onClose != nil {
- if err := c.onClose(); err != nil && firstErr == nil {
+ if err := c.onClose(); err != nil {
firstErr = err
}
}
@@ -543,10 +544,12 @@ type Conn struct {
}
func newConn(opt *Options, cn *pool.Conn) *Conn {
+ connPool := pool.NewSingleConnPool(nil)
+ connPool.SetConn(cn)
c := Conn{
baseClient: baseClient{
opt: opt,
- connPool: pool.NewSingleConnPool(cn),
+ connPool: connPool,
},
}
c.baseClient.init()
diff --git a/vendor/github.com/go-redis/redis/ring.go b/vendor/github.com/go-redis/redis/ring.go
index 250e5f640c..5956b71a5d 100644
--- a/vendor/github.com/go-redis/redis/ring.go
+++ b/vendor/github.com/go-redis/redis/ring.go
@@ -273,9 +273,13 @@ func (c *ringShards) Heartbeat(frequency time.Duration) {
// rebalance removes dead shards from the Ring.
func (c *ringShards) rebalance() {
+ c.mu.RLock()
+ shards := c.shards
+ c.mu.RUnlock()
+
hash := newConsistentHash(c.opt)
var shardsNum int
- for name, shard := range c.shards {
+ for name, shard := range shards {
if shard.IsUp() {
hash.Add(name)
shardsNum++
@@ -357,7 +361,8 @@ func NewRing(opt *RingOptions) *Ring {
ring.process = ring.defaultProcess
ring.processPipeline = ring.defaultProcessPipeline
- ring.cmdable.setProcessor(ring.Process)
+
+ ring.init()
for name, addr := range opt.Addrs {
clopt := opt.clientOptions()
@@ -370,6 +375,10 @@ func NewRing(opt *RingOptions) *Ring {
return ring
}
+func (c *Ring) init() {
+ c.cmdable.setProcessor(c.Process)
+}
+
func (c *Ring) Context() context.Context {
if c.ctx != nil {
return c.ctx
@@ -381,13 +390,15 @@ func (c *Ring) WithContext(ctx context.Context) *Ring {
if ctx == nil {
panic("nil context")
}
- c2 := c.copy()
+ c2 := c.clone()
c2.ctx = ctx
return c2
}
-func (c *Ring) copy() *Ring {
+func (c *Ring) clone() *Ring {
cp := *c
+ cp.init()
+
return &cp
}
@@ -653,6 +664,39 @@ func (c *Ring) Close() error {
return c.shards.Close()
}
+func (c *Ring) Watch(fn func(*Tx) error, keys ...string) error {
+ if len(keys) == 0 {
+ return fmt.Errorf("redis: Watch requires at least one key")
+ }
+
+ var shards []*ringShard
+ for _, key := range keys {
+ if key != "" {
+ shard, err := c.shards.GetByKey(hashtag.Key(key))
+ if err != nil {
+ return err
+ }
+
+ shards = append(shards, shard)
+ }
+ }
+
+ if len(shards) == 0 {
+ return fmt.Errorf("redis: Watch requires at least one shard")
+ }
+
+ if len(shards) > 1 {
+ for _, shard := range shards[1:] {
+ if shard.Client != shards[0].Client {
+ err := fmt.Errorf("redis: Watch requires all keys to be in the same shard")
+ return err
+ }
+ }
+ }
+
+ return shards[0].Client.Watch(fn, keys...)
+}
+
func newConsistentHash(opt *RingOptions) *consistenthash.Map {
return consistenthash.New(opt.HashReplicas, consistenthash.Hash(opt.Hash))
}
diff --git a/vendor/github.com/go-redis/redis/sentinel.go b/vendor/github.com/go-redis/redis/sentinel.go
index 7cbb90bdb4..016aa76574 100644
--- a/vendor/github.com/go-redis/redis/sentinel.go
+++ b/vendor/github.com/go-redis/redis/sentinel.go
@@ -90,9 +90,7 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client {
opt: opt,
connPool: failover.Pool(),
- onClose: func() error {
- return failover.Close()
- },
+ onClose: failover.Close,
},
}
c.baseClient.init()
@@ -182,6 +180,21 @@ func (c *SentinelClient) Reset(pattern string) *IntCmd {
return cmd
}
+// FlushConfig forces Sentinel to rewrite its configuration on disk, including
+// the current Sentinel state.
+func (c *SentinelClient) FlushConfig() *StatusCmd {
+ cmd := NewStatusCmd("sentinel", "flushconfig")
+ c.Process(cmd)
+ return cmd
+}
+
+// Master shows the state and info of the specified master.
+func (c *SentinelClient) Master(name string) *StringStringMapCmd {
+ cmd := NewStringStringMapCmd("sentinel", "master", name)
+ c.Process(cmd)
+ return cmd
+}
+
type sentinelFailover struct {
sentinelAddrs []string
@@ -376,8 +389,7 @@ func (c *sentinelFailover) listen(pubsub *PubSub) {
break
}
- switch msg.Channel {
- case "+switch-master":
+ if msg.Channel == "+switch-master" {
parts := strings.Split(msg.Payload, " ")
if parts[0] != c.masterName {
internal.Logf("sentinel: ignore addr for master=%q", parts[0])
diff --git a/vendor/github.com/go-redis/redis/universal.go b/vendor/github.com/go-redis/redis/universal.go
index a607562464..03bfa0fad3 100644
--- a/vendor/github.com/go-redis/redis/universal.go
+++ b/vendor/github.com/go-redis/redis/universal.go
@@ -155,6 +155,7 @@ type UniversalClient interface {
Watch(fn func(*Tx) error, keys ...string) error
Process(cmd Cmder) error
WrapProcess(fn func(oldProcess func(cmd Cmder) error) func(cmd Cmder) error)
+ WrapProcessPipeline(fn func(oldProcess func([]Cmder) error) func([]Cmder) error)
Subscribe(channels ...string) *PubSub
PSubscribe(channels ...string) *PubSub
Close() error
diff --git a/vendor/github.com/google/btree/btree_mem.go b/vendor/github.com/google/btree/btree_mem.go
deleted file mode 100644
index cb95b7fa1b..0000000000
--- a/vendor/github.com/google/btree/btree_mem.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +build ignore
-
-// This binary compares memory usage between btree and gollrb.
-package main
-
-import (
- "flag"
- "fmt"
- "math/rand"
- "runtime"
- "time"
-
- "github.com/google/btree"
- "github.com/petar/GoLLRB/llrb"
-)
-
-var (
- size = flag.Int("size", 1000000, "size of the tree to build")
- degree = flag.Int("degree", 8, "degree of btree")
- gollrb = flag.Bool("llrb", false, "use llrb instead of btree")
-)
-
-func main() {
- flag.Parse()
- vals := rand.Perm(*size)
- var t, v interface{}
- v = vals
- var stats runtime.MemStats
- for i := 0; i < 10; i++ {
- runtime.GC()
- }
- fmt.Println("-------- BEFORE ----------")
- runtime.ReadMemStats(&stats)
- fmt.Printf("%+v\n", stats)
- start := time.Now()
- if *gollrb {
- tr := llrb.New()
- for _, v := range vals {
- tr.ReplaceOrInsert(llrb.Int(v))
- }
- t = tr // keep it around
- } else {
- tr := btree.New(*degree)
- for _, v := range vals {
- tr.ReplaceOrInsert(btree.Int(v))
- }
- t = tr // keep it around
- }
- fmt.Printf("%v inserts in %v\n", *size, time.Since(start))
- fmt.Println("-------- AFTER ----------")
- runtime.ReadMemStats(&stats)
- fmt.Printf("%+v\n", stats)
- for i := 0; i < 10; i++ {
- runtime.GC()
- }
- fmt.Println("-------- AFTER GC ----------")
- runtime.ReadMemStats(&stats)
- fmt.Printf("%+v\n", stats)
- if t == v {
- fmt.Println("to make sure vals and tree aren't GC'd")
- }
-}
diff --git a/vendor/github.com/gorilla/handlers/README.md b/vendor/github.com/gorilla/handlers/README.md
index 296a956b88..6eba66bf30 100644
--- a/vendor/github.com/gorilla/handlers/README.md
+++ b/vendor/github.com/gorilla/handlers/README.md
@@ -1,6 +1,7 @@
gorilla/handlers
================
-[](https://godoc.org/github.com/gorilla/handlers) [](https://travis-ci.org/gorilla/handlers)
+[](https://godoc.org/github.com/gorilla/handlers)
+[](https://circleci.com/gh/gorilla/handlers)
[](https://sourcegraph.com/github.com/gorilla/handlers?badge)
diff --git a/vendor/github.com/gorilla/handlers/compress.go b/vendor/github.com/gorilla/handlers/compress.go
index e8345d792a..e46a7bfd6c 100644
--- a/vendor/github.com/gorilla/handlers/compress.go
+++ b/vendor/github.com/gorilla/handlers/compress.go
@@ -80,6 +80,7 @@ func CompressHandlerLevel(h http.Handler, level int) http.Handler {
switch strings.TrimSpace(enc) {
case "gzip":
w.Header().Set("Content-Encoding", "gzip")
+ r.Header.Del("Accept-Encoding")
w.Header().Add("Vary", "Accept-Encoding")
gw, _ := gzip.NewWriterLevel(w, level)
@@ -111,6 +112,7 @@ func CompressHandlerLevel(h http.Handler, level int) http.Handler {
break L
case "deflate":
w.Header().Set("Content-Encoding", "deflate")
+ r.Header.Del("Accept-Encoding")
w.Header().Add("Vary", "Accept-Encoding")
fw, _ := flate.NewWriter(w, level)
diff --git a/vendor/github.com/gorilla/handlers/logging.go b/vendor/github.com/gorilla/handlers/logging.go
index a540714982..88c25e72dc 100644
--- a/vendor/github.com/gorilla/handlers/logging.go
+++ b/vendor/github.com/gorilla/handlers/logging.go
@@ -43,6 +43,9 @@ func (h loggingHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
url := *req.URL
h.handler.ServeHTTP(logger, req)
+ if req.MultipartForm != nil {
+ req.MultipartForm.RemoveAll()
+ }
params := LogFormatterParams{
Request: req,
diff --git a/vendor/github.com/gorilla/handlers/proxy_headers.go b/vendor/github.com/gorilla/handlers/proxy_headers.go
index 0be750fd7b..ed939dcef5 100644
--- a/vendor/github.com/gorilla/handlers/proxy_headers.go
+++ b/vendor/github.com/gorilla/handlers/proxy_headers.go
@@ -31,8 +31,8 @@ var (
// ProxyHeaders inspects common reverse proxy headers and sets the corresponding
// fields in the HTTP request struct. These are X-Forwarded-For and X-Real-IP
// for the remote (client) IP address, X-Forwarded-Proto or X-Forwarded-Scheme
-// for the scheme (http|https) and the RFC7239 Forwarded header, which may
-// include both client IPs and schemes.
+// for the scheme (http|https), X-Forwarded-Host for the host and the RFC7239
+// Forwarded header, which may include both client IPs and schemes.
//
// NOTE: This middleware should only be used when behind a reverse
// proxy like nginx, HAProxy or Apache. Reverse proxies that don't (or are
diff --git a/vendor/github.com/gorilla/websocket/.travis.yml b/vendor/github.com/gorilla/websocket/.travis.yml
deleted file mode 100644
index a49db51c43..0000000000
--- a/vendor/github.com/gorilla/websocket/.travis.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-language: go
-sudo: false
-
-matrix:
- include:
- - go: 1.7.x
- - go: 1.8.x
- - go: 1.9.x
- - go: 1.10.x
- - go: 1.11.x
- - go: tip
- allow_failures:
- - go: tip
-
-script:
- - go get -t -v ./...
- - diff -u <(echo -n) <(gofmt -d .)
- - go vet $(go list ./... | grep -v /vendor/)
- - go test -v -race ./...
diff --git a/vendor/github.com/gorilla/websocket/README.md b/vendor/github.com/gorilla/websocket/README.md
index 20e391f865..0827d059c1 100644
--- a/vendor/github.com/gorilla/websocket/README.md
+++ b/vendor/github.com/gorilla/websocket/README.md
@@ -1,11 +1,11 @@
# Gorilla WebSocket
+[](https://godoc.org/github.com/gorilla/websocket)
+[](https://circleci.com/gh/gorilla/websocket)
+
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol.
-[](https://travis-ci.org/gorilla/websocket)
-[](https://godoc.org/github.com/gorilla/websocket)
-
### Documentation
* [API Reference](http://godoc.org/github.com/gorilla/websocket)
@@ -27,7 +27,7 @@ package API is stable.
### Protocol Compliance
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
-Suite](http://autobahn.ws/testsuite) using the application in the [examples/autobahn
+Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
### Gorilla WebSocket compared with other packages
@@ -40,7 +40,7 @@ subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn
| RFC 6455 Features |
-| Passes Autobahn Test Suite | Yes | No |
+| Passes Autobahn Test Suite | Yes | No |
| Receive fragmented message | Yes | No, see note 1 |
| Send close message | Yes | No |
| Send pings and receive pongs | Yes | No |
diff --git a/vendor/github.com/gorilla/websocket/client.go b/vendor/github.com/gorilla/websocket/client.go
index 2e32fd506e..962c06a391 100644
--- a/vendor/github.com/gorilla/websocket/client.go
+++ b/vendor/github.com/gorilla/websocket/client.go
@@ -70,7 +70,7 @@ type Dialer struct {
// HandshakeTimeout specifies the duration for the handshake to complete.
HandshakeTimeout time.Duration
- // ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer
+ // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer
// size is zero, then a useful default size is used. The I/O buffer sizes
// do not limit the size of the messages that can be sent or received.
ReadBufferSize, WriteBufferSize int
@@ -140,7 +140,7 @@ var nilDialer = *DefaultDialer
// Use the response.Header to get the selected subprotocol
// (Sec-WebSocket-Protocol) and cookies (Set-Cookie).
//
-// The context will be used in the request and in the Dialer
+// The context will be used in the request and in the Dialer.
//
// If the WebSocket handshake fails, ErrBadHandshake is returned along with a
// non-nil *http.Response so that callers can handle redirects, authentication,
diff --git a/vendor/github.com/gorilla/websocket/conn.go b/vendor/github.com/gorilla/websocket/conn.go
index d2a21c148b..6f17cd2998 100644
--- a/vendor/github.com/gorilla/websocket/conn.go
+++ b/vendor/github.com/gorilla/websocket/conn.go
@@ -260,10 +260,12 @@ type Conn struct {
newCompressionWriter func(io.WriteCloser, int) io.WriteCloser
// Read fields
- reader io.ReadCloser // the current reader returned to the application
- readErr error
- br *bufio.Reader
- readRemaining int64 // bytes remaining in current frame.
+ reader io.ReadCloser // the current reader returned to the application
+ readErr error
+ br *bufio.Reader
+ // bytes remaining in current frame.
+ // set setReadRemaining to safely update this value and prevent overflow
+ readRemaining int64
readFinal bool // true the current message has more frames.
readLength int64 // Message size.
readLimit int64 // Maximum message size.
@@ -320,6 +322,17 @@ func newConn(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int,
return c
}
+// setReadRemaining tracks the number of bytes remaining on the connection. If n
+// overflows, an ErrReadLimit is returned.
+func (c *Conn) setReadRemaining(n int64) error {
+ if n < 0 {
+ return ErrReadLimit
+ }
+
+ c.readRemaining = n
+ return nil
+}
+
// Subprotocol returns the negotiated protocol for the connection.
func (c *Conn) Subprotocol() string {
return c.subprotocol
@@ -451,7 +464,8 @@ func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) er
return err
}
-func (c *Conn) prepWrite(messageType int) error {
+// beginMessage prepares a connection and message writer for a new message.
+func (c *Conn) beginMessage(mw *messageWriter, messageType int) error {
// Close previous writer if not already closed by the application. It's
// probably better to return an error in this situation, but we cannot
// change this without breaking existing applications.
@@ -471,6 +485,10 @@ func (c *Conn) prepWrite(messageType int) error {
return err
}
+ mw.c = c
+ mw.frameType = messageType
+ mw.pos = maxFrameHeaderSize
+
if c.writeBuf == nil {
wpd, ok := c.writePool.Get().(writePoolData)
if ok {
@@ -491,16 +509,11 @@ func (c *Conn) prepWrite(messageType int) error {
// All message types (TextMessage, BinaryMessage, CloseMessage, PingMessage and
// PongMessage) are supported.
func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) {
- if err := c.prepWrite(messageType); err != nil {
+ var mw messageWriter
+ if err := c.beginMessage(&mw, messageType); err != nil {
return nil, err
}
-
- mw := &messageWriter{
- c: c,
- frameType: messageType,
- pos: maxFrameHeaderSize,
- }
- c.writer = mw
+ c.writer = &mw
if c.newCompressionWriter != nil && c.enableWriteCompression && isData(messageType) {
w := c.newCompressionWriter(c.writer, c.compressionLevel)
mw.compress = true
@@ -517,10 +530,16 @@ type messageWriter struct {
err error
}
-func (w *messageWriter) fatal(err error) error {
+func (w *messageWriter) endMessage(err error) error {
if w.err != nil {
- w.err = err
- w.c.writer = nil
+ return err
+ }
+ c := w.c
+ w.err = err
+ c.writer = nil
+ if c.writePool != nil {
+ c.writePool.Put(writePoolData{buf: c.writeBuf})
+ c.writeBuf = nil
}
return err
}
@@ -534,7 +553,7 @@ func (w *messageWriter) flushFrame(final bool, extra []byte) error {
// Check for invalid control frames.
if isControl(w.frameType) &&
(!final || length > maxControlFramePayloadSize) {
- return w.fatal(errInvalidControlFrame)
+ return w.endMessage(errInvalidControlFrame)
}
b0 := byte(w.frameType)
@@ -579,7 +598,7 @@ func (w *messageWriter) flushFrame(final bool, extra []byte) error {
copy(c.writeBuf[maxFrameHeaderSize-4:], key[:])
maskBytes(key, 0, c.writeBuf[maxFrameHeaderSize:w.pos])
if len(extra) > 0 {
- return c.writeFatal(errors.New("websocket: internal error, extra used in client mode"))
+ return w.endMessage(c.writeFatal(errors.New("websocket: internal error, extra used in client mode")))
}
}
@@ -600,15 +619,11 @@ func (w *messageWriter) flushFrame(final bool, extra []byte) error {
c.isWriting = false
if err != nil {
- return w.fatal(err)
+ return w.endMessage(err)
}
if final {
- c.writer = nil
- if c.writePool != nil {
- c.writePool.Put(writePoolData{buf: c.writeBuf})
- c.writeBuf = nil
- }
+ w.endMessage(errWriteClosed)
return nil
}
@@ -706,11 +721,7 @@ func (w *messageWriter) Close() error {
if w.err != nil {
return w.err
}
- if err := w.flushFrame(true, nil); err != nil {
- return err
- }
- w.err = errWriteClosed
- return nil
+ return w.flushFrame(true, nil)
}
// WritePreparedMessage writes prepared message into connection.
@@ -742,10 +753,10 @@ func (c *Conn) WriteMessage(messageType int, data []byte) error {
if c.isServer && (c.newCompressionWriter == nil || !c.enableWriteCompression) {
// Fast path with no allocations and single frame.
- if err := c.prepWrite(messageType); err != nil {
+ var mw messageWriter
+ if err := c.beginMessage(&mw, messageType); err != nil {
return err
}
- mw := messageWriter{c: c, frameType: messageType, pos: maxFrameHeaderSize}
n := copy(c.writeBuf[mw.pos:], data)
mw.pos += n
data = data[n:]
@@ -792,7 +803,7 @@ func (c *Conn) advanceFrame() (int, error) {
final := p[0]&finalBit != 0
frameType := int(p[0] & 0xf)
mask := p[1]&maskBit != 0
- c.readRemaining = int64(p[1] & 0x7f)
+ c.setReadRemaining(int64(p[1] & 0x7f))
c.readDecompress = false
if c.newDecompressionReader != nil && (p[0]&rsv1Bit) != 0 {
@@ -826,7 +837,17 @@ func (c *Conn) advanceFrame() (int, error) {
return noFrame, c.handleProtocolError("unknown opcode " + strconv.Itoa(frameType))
}
- // 3. Read and parse frame length.
+ // 3. Read and parse frame length as per
+ // https://tools.ietf.org/html/rfc6455#section-5.2
+ //
+ // The length of the "Payload data", in bytes: if 0-125, that is the payload
+ // length.
+ // - If 126, the following 2 bytes interpreted as a 16-bit unsigned
+ // integer are the payload length.
+ // - If 127, the following 8 bytes interpreted as
+ // a 64-bit unsigned integer (the most significant bit MUST be 0) are the
+ // payload length. Multibyte length quantities are expressed in network byte
+ // order.
switch c.readRemaining {
case 126:
@@ -834,13 +855,19 @@ func (c *Conn) advanceFrame() (int, error) {
if err != nil {
return noFrame, err
}
- c.readRemaining = int64(binary.BigEndian.Uint16(p))
+
+ if err := c.setReadRemaining(int64(binary.BigEndian.Uint16(p))); err != nil {
+ return noFrame, err
+ }
case 127:
p, err := c.read(8)
if err != nil {
return noFrame, err
}
- c.readRemaining = int64(binary.BigEndian.Uint64(p))
+
+ if err := c.setReadRemaining(int64(binary.BigEndian.Uint64(p))); err != nil {
+ return noFrame, err
+ }
}
// 4. Handle frame masking.
@@ -863,6 +890,12 @@ func (c *Conn) advanceFrame() (int, error) {
if frameType == continuationFrame || frameType == TextMessage || frameType == BinaryMessage {
c.readLength += c.readRemaining
+ // Don't allow readLength to overflow in the presence of a large readRemaining
+ // counter.
+ if c.readLength < 0 {
+ return noFrame, ErrReadLimit
+ }
+
if c.readLimit > 0 && c.readLength > c.readLimit {
c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait))
return noFrame, ErrReadLimit
@@ -876,7 +909,7 @@ func (c *Conn) advanceFrame() (int, error) {
var payload []byte
if c.readRemaining > 0 {
payload, err = c.read(int(c.readRemaining))
- c.readRemaining = 0
+ c.setReadRemaining(0)
if err != nil {
return noFrame, err
}
@@ -949,6 +982,7 @@ func (c *Conn) NextReader() (messageType int, r io.Reader, err error) {
c.readErr = hideTempErr(err)
break
}
+
if frameType == TextMessage || frameType == BinaryMessage {
c.messageReader = &messageReader{c}
c.reader = c.messageReader
@@ -989,7 +1023,9 @@ func (r *messageReader) Read(b []byte) (int, error) {
if c.isServer {
c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n])
}
- c.readRemaining -= int64(n)
+ rem := c.readRemaining
+ rem -= int64(n)
+ c.setReadRemaining(rem)
if c.readRemaining > 0 && c.readErr == io.EOF {
c.readErr = errUnexpectedEOF
}
@@ -1041,7 +1077,7 @@ func (c *Conn) SetReadDeadline(t time.Time) error {
return c.conn.SetReadDeadline(t)
}
-// SetReadLimit sets the maximum size for a message read from the peer. If a
+// SetReadLimit sets the maximum size in bytes for a message read from the peer. If a
// message exceeds the limit, the connection sends a close message to the peer
// and returns ErrReadLimit to the application.
func (c *Conn) SetReadLimit(limit int64) {
diff --git a/vendor/github.com/gorilla/websocket/doc.go b/vendor/github.com/gorilla/websocket/doc.go
index dcce1a63c0..c6f4df8960 100644
--- a/vendor/github.com/gorilla/websocket/doc.go
+++ b/vendor/github.com/gorilla/websocket/doc.go
@@ -151,6 +151,53 @@
// checking. The application is responsible for checking the Origin header
// before calling the Upgrade function.
//
+// Buffers
+//
+// Connections buffer network input and output to reduce the number
+// of system calls when reading or writing messages.
+//
+// Write buffers are also used for constructing WebSocket frames. See RFC 6455,
+// Section 5 for a discussion of message framing. A WebSocket frame header is
+// written to the network each time a write buffer is flushed to the network.
+// Decreasing the size of the write buffer can increase the amount of framing
+// overhead on the connection.
+//
+// The buffer sizes in bytes are specified by the ReadBufferSize and
+// WriteBufferSize fields in the Dialer and Upgrader. The Dialer uses a default
+// size of 4096 when a buffer size field is set to zero. The Upgrader reuses
+// buffers created by the HTTP server when a buffer size field is set to zero.
+// The HTTP server buffers have a size of 4096 at the time of this writing.
+//
+// The buffer sizes do not limit the size of a message that can be read or
+// written by a connection.
+//
+// Buffers are held for the lifetime of the connection by default. If the
+// Dialer or Upgrader WriteBufferPool field is set, then a connection holds the
+// write buffer only when writing a message.
+//
+// Applications should tune the buffer sizes to balance memory use and
+// performance. Increasing the buffer size uses more memory, but can reduce the
+// number of system calls to read or write the network. In the case of writing,
+// increasing the buffer size can reduce the number of frame headers written to
+// the network.
+//
+// Some guidelines for setting buffer parameters are:
+//
+// Limit the buffer sizes to the maximum expected message size. Buffers larger
+// than the largest message do not provide any benefit.
+//
+// Depending on the distribution of message sizes, setting the buffer size to
+// to a value less than the maximum expected message size can greatly reduce
+// memory use with a small impact on performance. Here's an example: If 99% of
+// the messages are smaller than 256 bytes and the maximum message size is 512
+// bytes, then a buffer size of 256 bytes will result in 1.01 more system calls
+// than a buffer size of 512 bytes. The memory savings is 50%.
+//
+// A write buffer pool is useful when the application has a modest number
+// writes over a large number of connections. when buffers are pooled, a larger
+// buffer size has a reduced impact on total memory use and has the benefit of
+// reducing system calls and frame overhead.
+//
// Compression EXPERIMENTAL
//
// Per message compression extensions (RFC 7692) are experimentally supported
diff --git a/vendor/github.com/gorilla/websocket/go.mod b/vendor/github.com/gorilla/websocket/go.mod
new file mode 100644
index 0000000000..1a7afd5028
--- /dev/null
+++ b/vendor/github.com/gorilla/websocket/go.mod
@@ -0,0 +1,3 @@
+module github.com/gorilla/websocket
+
+go 1.12
diff --git a/vendor/github.com/gorilla/websocket/go.sum b/vendor/github.com/gorilla/websocket/go.sum
new file mode 100644
index 0000000000..cf4fbbaa07
--- /dev/null
+++ b/vendor/github.com/gorilla/websocket/go.sum
@@ -0,0 +1,2 @@
+github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
diff --git a/vendor/github.com/gorilla/websocket/join.go b/vendor/github.com/gorilla/websocket/join.go
new file mode 100644
index 0000000000..c64f8c8290
--- /dev/null
+++ b/vendor/github.com/gorilla/websocket/join.go
@@ -0,0 +1,42 @@
+// Copyright 2019 The Gorilla WebSocket Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package websocket
+
+import (
+ "io"
+ "strings"
+)
+
+// JoinMessages concatenates received messages to create a single io.Reader.
+// The string term is appended to each message. The returned reader does not
+// support concurrent calls to the Read method.
+func JoinMessages(c *Conn, term string) io.Reader {
+ return &joinReader{c: c, term: term}
+}
+
+type joinReader struct {
+ c *Conn
+ term string
+ r io.Reader
+}
+
+func (r *joinReader) Read(p []byte) (int, error) {
+ if r.r == nil {
+ var err error
+ _, r.r, err = r.c.NextReader()
+ if err != nil {
+ return 0, err
+ }
+ if r.term != "" {
+ r.r = io.MultiReader(r.r, strings.NewReader(r.term))
+ }
+ }
+ n, err := r.r.Read(p)
+ if err == io.EOF {
+ err = nil
+ r.r = nil
+ }
+ return n, err
+}
diff --git a/vendor/github.com/gorilla/websocket/proxy.go b/vendor/github.com/gorilla/websocket/proxy.go
index bf2478e430..e87a8c9f0c 100644
--- a/vendor/github.com/gorilla/websocket/proxy.go
+++ b/vendor/github.com/gorilla/websocket/proxy.go
@@ -22,18 +22,18 @@ func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) {
func init() {
proxy_RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy_Dialer) (proxy_Dialer, error) {
- return &httpProxyDialer{proxyURL: proxyURL, fowardDial: forwardDialer.Dial}, nil
+ return &httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDialer.Dial}, nil
})
}
type httpProxyDialer struct {
- proxyURL *url.URL
- fowardDial func(network, addr string) (net.Conn, error)
+ proxyURL *url.URL
+ forwardDial func(network, addr string) (net.Conn, error)
}
func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) {
hostPort, _ := hostPortNoPort(hpd.proxyURL)
- conn, err := hpd.fowardDial(network, hostPort)
+ conn, err := hpd.forwardDial(network, hostPort)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/gorilla/websocket/server.go b/vendor/github.com/gorilla/websocket/server.go
index a761824b33..887d558918 100644
--- a/vendor/github.com/gorilla/websocket/server.go
+++ b/vendor/github.com/gorilla/websocket/server.go
@@ -27,7 +27,7 @@ type Upgrader struct {
// HandshakeTimeout specifies the duration for the handshake to complete.
HandshakeTimeout time.Duration
- // ReadBufferSize and WriteBufferSize specify I/O buffer sizes. If a buffer
+ // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer
// size is zero, then buffers allocated by the HTTP server are used. The
// I/O buffer sizes do not limit the size of the messages that can be sent
// or received.
@@ -153,7 +153,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
challengeKey := r.Header.Get("Sec-Websocket-Key")
if challengeKey == "" {
- return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: `Sec-WebSocket-Key' header is missing or blank")
+ return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'Sec-WebSocket-Key' header is missing or blank")
}
subprotocol := u.selectSubprotocol(r, responseHeader)
diff --git a/vendor/github.com/gorilla/websocket/util.go b/vendor/github.com/gorilla/websocket/util.go
index 354001e1ed..7bf2f66c67 100644
--- a/vendor/github.com/gorilla/websocket/util.go
+++ b/vendor/github.com/gorilla/websocket/util.go
@@ -31,68 +31,113 @@ func generateChallengeKey() (string, error) {
return base64.StdEncoding.EncodeToString(p), nil
}
-// Octet types from RFC 2616.
-var octetTypes [256]byte
-
-const (
- isTokenOctet = 1 << iota
- isSpaceOctet
-)
-
-func init() {
- // From RFC 2616
- //
- // OCTET =
- // CHAR =
- // CTL =
- // CR =
- // LF =
- // SP =
- // HT =
- // <"> =
- // CRLF = CR LF
- // LWS = [CRLF] 1*( SP | HT )
- // TEXT =
- // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <">
- // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
- // token = 1*
- // qdtext = >
-
- for c := 0; c < 256; c++ {
- var t byte
- isCtl := c <= 31 || c == 127
- isChar := 0 <= c && c <= 127
- isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0
- if strings.IndexRune(" \t\r\n", rune(c)) >= 0 {
- t |= isSpaceOctet
- }
- if isChar && !isCtl && !isSeparator {
- t |= isTokenOctet
- }
- octetTypes[c] = t
- }
+// Token octets per RFC 2616.
+var isTokenOctet = [256]bool{
+ '!': true,
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+ '*': true,
+ '+': true,
+ '-': true,
+ '.': true,
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+ 'A': true,
+ 'B': true,
+ 'C': true,
+ 'D': true,
+ 'E': true,
+ 'F': true,
+ 'G': true,
+ 'H': true,
+ 'I': true,
+ 'J': true,
+ 'K': true,
+ 'L': true,
+ 'M': true,
+ 'N': true,
+ 'O': true,
+ 'P': true,
+ 'Q': true,
+ 'R': true,
+ 'S': true,
+ 'T': true,
+ 'U': true,
+ 'W': true,
+ 'V': true,
+ 'X': true,
+ 'Y': true,
+ 'Z': true,
+ '^': true,
+ '_': true,
+ '`': true,
+ 'a': true,
+ 'b': true,
+ 'c': true,
+ 'd': true,
+ 'e': true,
+ 'f': true,
+ 'g': true,
+ 'h': true,
+ 'i': true,
+ 'j': true,
+ 'k': true,
+ 'l': true,
+ 'm': true,
+ 'n': true,
+ 'o': true,
+ 'p': true,
+ 'q': true,
+ 'r': true,
+ 's': true,
+ 't': true,
+ 'u': true,
+ 'v': true,
+ 'w': true,
+ 'x': true,
+ 'y': true,
+ 'z': true,
+ '|': true,
+ '~': true,
}
+// skipSpace returns a slice of the string s with all leading RFC 2616 linear
+// whitespace removed.
func skipSpace(s string) (rest string) {
i := 0
for ; i < len(s); i++ {
- if octetTypes[s[i]]&isSpaceOctet == 0 {
+ if b := s[i]; b != ' ' && b != '\t' {
break
}
}
return s[i:]
}
+// nextToken returns the leading RFC 2616 token of s and the string following
+// the token.
func nextToken(s string) (token, rest string) {
i := 0
for ; i < len(s); i++ {
- if octetTypes[s[i]]&isTokenOctet == 0 {
+ if !isTokenOctet[s[i]] {
break
}
}
return s[:i], s[i:]
}
+// nextTokenOrQuoted returns the leading token or quoted string per RFC 2616
+// and the string following the token or quoted string.
func nextTokenOrQuoted(s string) (value string, rest string) {
if !strings.HasPrefix(s, "\"") {
return nextToken(s)
@@ -128,7 +173,8 @@ func nextTokenOrQuoted(s string) (value string, rest string) {
return "", ""
}
-// equalASCIIFold returns true if s is equal to t with ASCII case folding.
+// equalASCIIFold returns true if s is equal to t with ASCII case folding as
+// defined in RFC 4790.
func equalASCIIFold(s, t string) bool {
for s != "" && t != "" {
sr, size := utf8.DecodeRuneInString(s)
diff --git a/vendor/github.com/hashicorp/golang-lru/go.mod b/vendor/github.com/hashicorp/golang-lru/go.mod
index 824cb97e83..8ad8826b36 100644
--- a/vendor/github.com/hashicorp/golang-lru/go.mod
+++ b/vendor/github.com/hashicorp/golang-lru/go.mod
@@ -1 +1,3 @@
module github.com/hashicorp/golang-lru
+
+go 1.12
diff --git a/vendor/github.com/hashicorp/golang-lru/lru.go b/vendor/github.com/hashicorp/golang-lru/lru.go
index 1cbe04b7d0..052a38b4c4 100644
--- a/vendor/github.com/hashicorp/golang-lru/lru.go
+++ b/vendor/github.com/hashicorp/golang-lru/lru.go
@@ -86,17 +86,35 @@ func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) {
}
// Remove removes the provided key from the cache.
-func (c *Cache) Remove(key interface{}) {
+func (c *Cache) Remove(key interface{}) (present bool) {
c.lock.Lock()
- c.lru.Remove(key)
+ present = c.lru.Remove(key)
c.lock.Unlock()
+ return
+}
+
+// Resize changes the cache size.
+func (c *Cache) Resize(size int) (evicted int) {
+ c.lock.Lock()
+ evicted = c.lru.Resize(size)
+ c.lock.Unlock()
+ return evicted
}
// RemoveOldest removes the oldest item from the cache.
-func (c *Cache) RemoveOldest() {
+func (c *Cache) RemoveOldest() (key interface{}, value interface{}, ok bool) {
c.lock.Lock()
- c.lru.RemoveOldest()
+ key, value, ok = c.lru.RemoveOldest()
c.lock.Unlock()
+ return
+}
+
+// GetOldest returns the oldest entry
+func (c *Cache) GetOldest() (key interface{}, value interface{}, ok bool) {
+ c.lock.Lock()
+ key, value, ok = c.lru.GetOldest()
+ c.lock.Unlock()
+ return
}
// Keys returns a slice of the keys in the cache, from oldest to newest.
diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go
index 5673773b22..a86c8539e0 100644
--- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go
+++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go
@@ -73,6 +73,9 @@ func (c *LRU) Add(key, value interface{}) (evicted bool) {
func (c *LRU) Get(key interface{}) (value interface{}, ok bool) {
if ent, ok := c.items[key]; ok {
c.evictList.MoveToFront(ent)
+ if ent.Value.(*entry) == nil {
+ return nil, false
+ }
return ent.Value.(*entry).value, true
}
return
@@ -142,6 +145,19 @@ func (c *LRU) Len() int {
return c.evictList.Len()
}
+// Resize changes the cache size.
+func (c *LRU) Resize(size int) (evicted int) {
+ diff := c.Len() - size
+ if diff < 0 {
+ diff = 0
+ }
+ for i := 0; i < diff; i++ {
+ c.removeOldest()
+ }
+ c.size = size
+ return diff
+}
+
// removeOldest removes the oldest item from the cache.
func (c *LRU) removeOldest() {
ent := c.evictList.Back()
diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
index 74c7077440..92d70934d6 100644
--- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
+++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
@@ -10,7 +10,7 @@ type LRUCache interface {
// updates the "recently used"-ness of the key. #value, isFound
Get(key interface{}) (value interface{}, ok bool)
- // Check if a key exsists in cache without updating the recent-ness.
+ // Checks if a key exists in cache without updating the recent-ness.
Contains(key interface{}) (ok bool)
// Returns key's value without updating the "recently used"-ness of the key.
@@ -31,6 +31,9 @@ type LRUCache interface {
// Returns the number of items in the cache.
Len() int
- // Clear all cache entries
+ // Clears all cache entries.
Purge()
+
+ // Resizes cache, returning number evicted
+ Resize(int) int
}
diff --git a/vendor/github.com/hashicorp/memberlist/net.go b/vendor/github.com/hashicorp/memberlist/net.go
index f6a0d45fed..068d8e1ade 100644
--- a/vendor/github.com/hashicorp/memberlist/net.go
+++ b/vendor/github.com/hashicorp/memberlist/net.go
@@ -522,7 +522,7 @@ func (m *Memberlist) handleIndirectPing(buf []byte, from net.Addr) {
// Send the ping.
addr := joinHostPort(net.IP(ind.Target).String(), ind.Port)
if err := m.encodeAndSendMsg(addr, pingMsg, &ping); err != nil {
- m.logger.Printf("[ERR] memberlist: Failed to send ping: %s %s", err, LogAddress(from))
+ m.logger.Printf("[ERR] memberlist: Failed to send indirect ping: %s %s", err, LogAddress(from))
}
// Setup a timer to fire off a nack if no ack is seen in time.
diff --git a/vendor/github.com/hashicorp/memberlist/state.go b/vendor/github.com/hashicorp/memberlist/state.go
index 1af62943e8..f5ed65a782 100644
--- a/vendor/github.com/hashicorp/memberlist/state.go
+++ b/vendor/github.com/hashicorp/memberlist/state.go
@@ -6,6 +6,7 @@ import (
"math"
"math/rand"
"net"
+ "strings"
"sync/atomic"
"time"
@@ -242,6 +243,21 @@ func (m *Memberlist) probeNodeByAddr(addr string) {
m.probeNode(n)
}
+// failedRemote checks the error and decides if it indicates a failure on the
+// other end.
+func failedRemote(err error) bool {
+ switch t := err.(type) {
+ case *net.OpError:
+ if strings.HasPrefix(t.Net, "tcp") {
+ switch t.Op {
+ case "dial", "read", "write":
+ return true
+ }
+ }
+ }
+ return false
+}
+
// probeNode handles a single round of failure checking on a node.
func (m *Memberlist) probeNode(node *nodeState) {
defer metrics.MeasureSince([]string{"memberlist", "probeNode"}, time.Now())
@@ -272,10 +288,20 @@ func (m *Memberlist) probeNode(node *nodeState) {
// soon as possible.
deadline := sent.Add(probeInterval)
addr := node.Address()
+
+ // Arrange for our self-awareness to get updated.
+ var awarenessDelta int
+ defer func() {
+ m.awareness.ApplyDelta(awarenessDelta)
+ }()
if node.State == stateAlive {
if err := m.encodeAndSendMsg(addr, pingMsg, &ping); err != nil {
m.logger.Printf("[ERR] memberlist: Failed to send ping: %s", err)
- return
+ if failedRemote(err) {
+ goto HANDLE_REMOTE_FAILURE
+ } else {
+ return
+ }
}
} else {
var msgs [][]byte
@@ -296,7 +322,11 @@ func (m *Memberlist) probeNode(node *nodeState) {
compound := makeCompoundMessage(msgs)
if err := m.rawSendMsgPacket(addr, &node.Node, compound.Bytes()); err != nil {
m.logger.Printf("[ERR] memberlist: Failed to send compound ping and suspect message to %s: %s", addr, err)
- return
+ if failedRemote(err) {
+ goto HANDLE_REMOTE_FAILURE
+ } else {
+ return
+ }
}
}
@@ -305,10 +335,7 @@ func (m *Memberlist) probeNode(node *nodeState) {
// which will improve our health until we get to the failure scenarios
// at the end of this function, which will alter this delta variable
// accordingly.
- awarenessDelta := -1
- defer func() {
- m.awareness.ApplyDelta(awarenessDelta)
- }()
+ awarenessDelta = -1
// Wait for response or round-trip-time.
select {
@@ -333,9 +360,10 @@ func (m *Memberlist) probeNode(node *nodeState) {
// probe interval it will give the TCP fallback more time, which
// is more active in dealing with lost packets, and it gives more
// time to wait for indirect acks/nacks.
- m.logger.Printf("[DEBUG] memberlist: Failed ping: %v (timeout reached)", node.Name)
+ m.logger.Printf("[DEBUG] memberlist: Failed ping: %s (timeout reached)", node.Name)
}
+HANDLE_REMOTE_FAILURE:
// Get some random live nodes.
m.nodeLock.RLock()
kNodes := kRandomNodes(m.config.IndirectChecks, m.nodes, func(n *nodeState) bool {
diff --git a/vendor/github.com/hashicorp/yamux/addr.go b/vendor/github.com/hashicorp/yamux/addr.go
index be6ebca9c7..f6a00199cd 100644
--- a/vendor/github.com/hashicorp/yamux/addr.go
+++ b/vendor/github.com/hashicorp/yamux/addr.go
@@ -54,7 +54,7 @@ func (s *Stream) LocalAddr() net.Addr {
return s.session.LocalAddr()
}
-// LocalAddr returns the remote address
+// RemoteAddr returns the remote address
func (s *Stream) RemoteAddr() net.Addr {
return s.session.RemoteAddr()
}
diff --git a/vendor/github.com/lib/pq/oid/gen.go b/vendor/github.com/lib/pq/oid/gen.go
deleted file mode 100644
index 7c634cdc5c..0000000000
--- a/vendor/github.com/lib/pq/oid/gen.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// +build ignore
-
-// Generate the table of OID values
-// Run with 'go run gen.go'.
-package main
-
-import (
- "database/sql"
- "fmt"
- "log"
- "os"
- "os/exec"
- "strings"
-
- _ "github.com/lib/pq"
-)
-
-// OID represent a postgres Object Identifier Type.
-type OID struct {
- ID int
- Type string
-}
-
-// Name returns an upper case version of the oid type.
-func (o OID) Name() string {
- return strings.ToUpper(o.Type)
-}
-
-func main() {
- datname := os.Getenv("PGDATABASE")
- sslmode := os.Getenv("PGSSLMODE")
-
- if datname == "" {
- os.Setenv("PGDATABASE", "pqgotest")
- }
-
- if sslmode == "" {
- os.Setenv("PGSSLMODE", "disable")
- }
-
- db, err := sql.Open("postgres", "")
- if err != nil {
- log.Fatal(err)
- }
- rows, err := db.Query(`
- SELECT typname, oid
- FROM pg_type WHERE oid < 10000
- ORDER BY oid;
- `)
- if err != nil {
- log.Fatal(err)
- }
- oids := make([]*OID, 0)
- for rows.Next() {
- var oid OID
- if err = rows.Scan(&oid.Type, &oid.ID); err != nil {
- log.Fatal(err)
- }
- oids = append(oids, &oid)
- }
- if err = rows.Err(); err != nil {
- log.Fatal(err)
- }
- cmd := exec.Command("gofmt")
- cmd.Stderr = os.Stderr
- w, err := cmd.StdinPipe()
- if err != nil {
- log.Fatal(err)
- }
- f, err := os.Create("types.go")
- if err != nil {
- log.Fatal(err)
- }
- cmd.Stdout = f
- err = cmd.Start()
- if err != nil {
- log.Fatal(err)
- }
- fmt.Fprintln(w, "// Code generated by gen.go. DO NOT EDIT.")
- fmt.Fprintln(w, "\npackage oid")
- fmt.Fprintln(w, "const (")
- for _, oid := range oids {
- fmt.Fprintf(w, "T_%s Oid = %d\n", oid.Type, oid.ID)
- }
- fmt.Fprintln(w, ")")
- fmt.Fprintln(w, "var TypeName = map[Oid]string{")
- for _, oid := range oids {
- fmt.Fprintf(w, "T_%s: \"%s\",\n", oid.Type, oid.Name())
- }
- fmt.Fprintln(w, "}")
- w.Close()
- cmd.Wait()
-}
diff --git a/vendor/github.com/mailru/easyjson/.travis.yml b/vendor/github.com/mailru/easyjson/.travis.yml
index 77891411a3..0ececa0718 100644
--- a/vendor/github.com/mailru/easyjson/.travis.yml
+++ b/vendor/github.com/mailru/easyjson/.travis.yml
@@ -2,8 +2,11 @@ language: go
go:
- tip
+ - stable
+
+matrix:
+ allow_failures:
+ - go: tip
+
install:
- - go get github.com/ugorji/go/codec
- - go get github.com/pquerna/ffjson/fflib/v1
- - go get github.com/json-iterator/go
- go get golang.org/x/lint/golint
diff --git a/vendor/github.com/mailru/easyjson/Makefile b/vendor/github.com/mailru/easyjson/Makefile
index 1604dfa9f5..7b9ac94535 100644
--- a/vendor/github.com/mailru/easyjson/Makefile
+++ b/vendor/github.com/mailru/easyjson/Makefile
@@ -1,64 +1,52 @@
-PKG=github.com/mailru/easyjson
-GOPATH:=$(PWD)/.root:$(GOPATH)
-export GOPATH
-
all: test
-.root/src/$(PKG):
- mkdir -p $@
- for i in $$PWD/* ; do ln -s $$i $@/`basename $$i` ; done
-
-root: .root/src/$(PKG)
-
clean:
- rm -rf .root
+ rm -rf bin
rm -rf tests/*_easyjson.go
+ rm -rf benchmark/*_easyjson.go
build:
- go build -i -o .root/bin/easyjson $(PKG)/easyjson
+ go build -i -o ./bin/easyjson ./easyjson
-generate: root build
- .root/bin/easyjson -stubs \
- .root/src/$(PKG)/tests/snake.go \
- .root/src/$(PKG)/tests/data.go \
- .root/src/$(PKG)/tests/omitempty.go \
- .root/src/$(PKG)/tests/nothing.go \
- .root/src/$(PKG)/tests/named_type.go \
- .root/src/$(PKG)/tests/custom_map_key_type.go \
- .root/src/$(PKG)/tests/embedded_type.go \
- .root/src/$(PKG)/tests/reference_to_pointer.go \
+generate: build
+ bin/easyjson -stubs \
+ ./tests/snake.go \
+ ./tests/data.go \
+ ./tests/omitempty.go \
+ ./tests/nothing.go \
+ ./tests/named_type.go \
+ ./tests/custom_map_key_type.go \
+ ./tests/embedded_type.go \
+ ./tests/reference_to_pointer.go \
- .root/bin/easyjson -all .root/src/$(PKG)/tests/data.go
- .root/bin/easyjson -all .root/src/$(PKG)/tests/nothing.go
- .root/bin/easyjson -all .root/src/$(PKG)/tests/errors.go
- .root/bin/easyjson -snake_case .root/src/$(PKG)/tests/snake.go
- .root/bin/easyjson -omit_empty .root/src/$(PKG)/tests/omitempty.go
- .root/bin/easyjson -build_tags=use_easyjson .root/src/$(PKG)/benchmark/data.go
- .root/bin/easyjson .root/src/$(PKG)/tests/nested_easy.go
- .root/bin/easyjson .root/src/$(PKG)/tests/named_type.go
- .root/bin/easyjson .root/src/$(PKG)/tests/custom_map_key_type.go
- .root/bin/easyjson .root/src/$(PKG)/tests/embedded_type.go
- .root/bin/easyjson .root/src/$(PKG)/tests/reference_to_pointer.go
- .root/bin/easyjson .root/src/$(PKG)/tests/key_marshaler_map.go
- .root/bin/easyjson -disallow_unknown_fields .root/src/$(PKG)/tests/disallow_unknown.go
+ bin/easyjson -all ./tests/data.go
+ bin/easyjson -all ./tests/nothing.go
+ bin/easyjson -all ./tests/errors.go
+ bin/easyjson -snake_case ./tests/snake.go
+ bin/easyjson -omit_empty ./tests/omitempty.go
+ bin/easyjson -build_tags=use_easyjson ./benchmark/data.go
+ bin/easyjson ./tests/nested_easy.go
+ bin/easyjson ./tests/named_type.go
+ bin/easyjson ./tests/custom_map_key_type.go
+ bin/easyjson ./tests/embedded_type.go
+ bin/easyjson ./tests/reference_to_pointer.go
+ bin/easyjson ./tests/key_marshaler_map.go
+ bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go
-test: generate root
+test: generate
go test \
- $(PKG)/tests \
- $(PKG)/jlexer \
- $(PKG)/gen \
- $(PKG)/buffer
- go test -benchmem -tags use_easyjson -bench . $(PKG)/benchmark
- golint -set_exit_status .root/src/$(PKG)/tests/*_easyjson.go
+ ./tests \
+ ./jlexer \
+ ./gen \
+ ./buffer
+ cd benchmark && go test -benchmem -tags use_easyjson -bench .
+ golint -set_exit_status ./tests/*_easyjson.go
-bench-other: generate root
- @go test -benchmem -bench . $(PKG)/benchmark
- @go test -benchmem -tags use_ffjson -bench . $(PKG)/benchmark
- @go test -benchmem -tags use_jsoniter -bench . $(PKG)/benchmark
- @go test -benchmem -tags use_codec -bench . $(PKG)/benchmark
+bench-other: generate
+ cd benchmark && make
bench-python:
benchmark/ujson.sh
-.PHONY: root clean generate test build
+.PHONY: clean generate test build
diff --git a/vendor/github.com/mailru/easyjson/go.mod b/vendor/github.com/mailru/easyjson/go.mod
new file mode 100644
index 0000000000..7bc4a65844
--- /dev/null
+++ b/vendor/github.com/mailru/easyjson/go.mod
@@ -0,0 +1,3 @@
+module github.com/mailru/easyjson
+
+go 1.12
diff --git a/vendor/github.com/mattermost/rsc/qr/coding/gen.go b/vendor/github.com/mattermost/rsc/qr/coding/gen.go
deleted file mode 100644
index a3857f277e..0000000000
--- a/vendor/github.com/mattermost/rsc/qr/coding/gen.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// +build ignore
-
-package main
-
-import "fmt"
-
-// tables from qrencode-3.1.1/qrspec.c
-
-var capacity = [41]struct {
- width int
- words int
- remainder int
- ec [4]int
-}{
- {0, 0, 0, [4]int{0, 0, 0, 0}},
- {21, 26, 0, [4]int{7, 10, 13, 17}}, // 1
- {25, 44, 7, [4]int{10, 16, 22, 28}},
- {29, 70, 7, [4]int{15, 26, 36, 44}},
- {33, 100, 7, [4]int{20, 36, 52, 64}},
- {37, 134, 7, [4]int{26, 48, 72, 88}}, // 5
- {41, 172, 7, [4]int{36, 64, 96, 112}},
- {45, 196, 0, [4]int{40, 72, 108, 130}},
- {49, 242, 0, [4]int{48, 88, 132, 156}},
- {53, 292, 0, [4]int{60, 110, 160, 192}},
- {57, 346, 0, [4]int{72, 130, 192, 224}}, //10
- {61, 404, 0, [4]int{80, 150, 224, 264}},
- {65, 466, 0, [4]int{96, 176, 260, 308}},
- {69, 532, 0, [4]int{104, 198, 288, 352}},
- {73, 581, 3, [4]int{120, 216, 320, 384}},
- {77, 655, 3, [4]int{132, 240, 360, 432}}, //15
- {81, 733, 3, [4]int{144, 280, 408, 480}},
- {85, 815, 3, [4]int{168, 308, 448, 532}},
- {89, 901, 3, [4]int{180, 338, 504, 588}},
- {93, 991, 3, [4]int{196, 364, 546, 650}},
- {97, 1085, 3, [4]int{224, 416, 600, 700}}, //20
- {101, 1156, 4, [4]int{224, 442, 644, 750}},
- {105, 1258, 4, [4]int{252, 476, 690, 816}},
- {109, 1364, 4, [4]int{270, 504, 750, 900}},
- {113, 1474, 4, [4]int{300, 560, 810, 960}},
- {117, 1588, 4, [4]int{312, 588, 870, 1050}}, //25
- {121, 1706, 4, [4]int{336, 644, 952, 1110}},
- {125, 1828, 4, [4]int{360, 700, 1020, 1200}},
- {129, 1921, 3, [4]int{390, 728, 1050, 1260}},
- {133, 2051, 3, [4]int{420, 784, 1140, 1350}},
- {137, 2185, 3, [4]int{450, 812, 1200, 1440}}, //30
- {141, 2323, 3, [4]int{480, 868, 1290, 1530}},
- {145, 2465, 3, [4]int{510, 924, 1350, 1620}},
- {149, 2611, 3, [4]int{540, 980, 1440, 1710}},
- {153, 2761, 3, [4]int{570, 1036, 1530, 1800}},
- {157, 2876, 0, [4]int{570, 1064, 1590, 1890}}, //35
- {161, 3034, 0, [4]int{600, 1120, 1680, 1980}},
- {165, 3196, 0, [4]int{630, 1204, 1770, 2100}},
- {169, 3362, 0, [4]int{660, 1260, 1860, 2220}},
- {173, 3532, 0, [4]int{720, 1316, 1950, 2310}},
- {177, 3706, 0, [4]int{750, 1372, 2040, 2430}}, //40
-}
-
-var eccTable = [41][4][2]int{
- {{0, 0}, {0, 0}, {0, 0}, {0, 0}},
- {{1, 0}, {1, 0}, {1, 0}, {1, 0}}, // 1
- {{1, 0}, {1, 0}, {1, 0}, {1, 0}},
- {{1, 0}, {1, 0}, {2, 0}, {2, 0}},
- {{1, 0}, {2, 0}, {2, 0}, {4, 0}},
- {{1, 0}, {2, 0}, {2, 2}, {2, 2}}, // 5
- {{2, 0}, {4, 0}, {4, 0}, {4, 0}},
- {{2, 0}, {4, 0}, {2, 4}, {4, 1}},
- {{2, 0}, {2, 2}, {4, 2}, {4, 2}},
- {{2, 0}, {3, 2}, {4, 4}, {4, 4}},
- {{2, 2}, {4, 1}, {6, 2}, {6, 2}}, //10
- {{4, 0}, {1, 4}, {4, 4}, {3, 8}},
- {{2, 2}, {6, 2}, {4, 6}, {7, 4}},
- {{4, 0}, {8, 1}, {8, 4}, {12, 4}},
- {{3, 1}, {4, 5}, {11, 5}, {11, 5}},
- {{5, 1}, {5, 5}, {5, 7}, {11, 7}}, //15
- {{5, 1}, {7, 3}, {15, 2}, {3, 13}},
- {{1, 5}, {10, 1}, {1, 15}, {2, 17}},
- {{5, 1}, {9, 4}, {17, 1}, {2, 19}},
- {{3, 4}, {3, 11}, {17, 4}, {9, 16}},
- {{3, 5}, {3, 13}, {15, 5}, {15, 10}}, //20
- {{4, 4}, {17, 0}, {17, 6}, {19, 6}},
- {{2, 7}, {17, 0}, {7, 16}, {34, 0}},
- {{4, 5}, {4, 14}, {11, 14}, {16, 14}},
- {{6, 4}, {6, 14}, {11, 16}, {30, 2}},
- {{8, 4}, {8, 13}, {7, 22}, {22, 13}}, //25
- {{10, 2}, {19, 4}, {28, 6}, {33, 4}},
- {{8, 4}, {22, 3}, {8, 26}, {12, 28}},
- {{3, 10}, {3, 23}, {4, 31}, {11, 31}},
- {{7, 7}, {21, 7}, {1, 37}, {19, 26}},
- {{5, 10}, {19, 10}, {15, 25}, {23, 25}}, //30
- {{13, 3}, {2, 29}, {42, 1}, {23, 28}},
- {{17, 0}, {10, 23}, {10, 35}, {19, 35}},
- {{17, 1}, {14, 21}, {29, 19}, {11, 46}},
- {{13, 6}, {14, 23}, {44, 7}, {59, 1}},
- {{12, 7}, {12, 26}, {39, 14}, {22, 41}}, //35
- {{6, 14}, {6, 34}, {46, 10}, {2, 64}},
- {{17, 4}, {29, 14}, {49, 10}, {24, 46}},
- {{4, 18}, {13, 32}, {48, 14}, {42, 32}},
- {{20, 4}, {40, 7}, {43, 22}, {10, 67}},
- {{19, 6}, {18, 31}, {34, 34}, {20, 61}}, //40
-}
-
-var align = [41][2]int{
- {0, 0},
- {0, 0}, {18, 0}, {22, 0}, {26, 0}, {30, 0}, // 1- 5
- {34, 0}, {22, 38}, {24, 42}, {26, 46}, {28, 50}, // 6-10
- {30, 54}, {32, 58}, {34, 62}, {26, 46}, {26, 48}, //11-15
- {26, 50}, {30, 54}, {30, 56}, {30, 58}, {34, 62}, //16-20
- {28, 50}, {26, 50}, {30, 54}, {28, 54}, {32, 58}, //21-25
- {30, 58}, {34, 62}, {26, 50}, {30, 54}, {26, 52}, //26-30
- {30, 56}, {34, 60}, {30, 58}, {34, 62}, {30, 54}, //31-35
- {24, 50}, {28, 54}, {32, 58}, {26, 54}, {30, 58}, //35-40
-}
-
-var versionPattern = [41]int{
- 0,
- 0, 0, 0, 0, 0, 0,
- 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d,
- 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9,
- 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75,
- 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64,
- 0x27541, 0x28c69,
-}
-
-func main() {
- fmt.Printf("\t{},\n")
- for i := 1; i <= 40; i++ {
- apos := align[i][0] - 2
- if apos < 0 {
- apos = 100
- }
- astride := align[i][1] - align[i][0]
- if astride < 1 {
- astride = 100
- }
- fmt.Printf("\t{%v, %v, %v, %#x, [4]level{{%v, %v}, {%v, %v}, {%v, %v}, {%v, %v}}}, // %v\n",
- apos, astride, capacity[i].words,
- versionPattern[i],
- eccTable[i][0][0]+eccTable[i][0][1],
- float64(capacity[i].ec[0])/float64(eccTable[i][0][0]+eccTable[i][0][1]),
- eccTable[i][1][0]+eccTable[i][1][1],
- float64(capacity[i].ec[1])/float64(eccTable[i][1][0]+eccTable[i][1][1]),
- eccTable[i][2][0]+eccTable[i][2][1],
- float64(capacity[i].ec[2])/float64(eccTable[i][2][0]+eccTable[i][2][1]),
- eccTable[i][3][0]+eccTable[i][3][1],
- float64(capacity[i].ec[3])/float64(eccTable[i][3][0]+eccTable[i][3][1]),
- i,
- )
- }
-}
diff --git a/vendor/github.com/miekg/dns/.travis.yml b/vendor/github.com/miekg/dns/.travis.yml
index 013b5ae44d..c450c9f956 100644
--- a/vendor/github.com/miekg/dns/.travis.yml
+++ b/vendor/github.com/miekg/dns/.travis.yml
@@ -2,15 +2,12 @@ language: go
sudo: false
go:
- - 1.10.x
- 1.11.x
- 1.12.x
- tip
-before_install:
- # don't use the miekg/dns when testing forks
- - mkdir -p $GOPATH/src/github.com/miekg
- - ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/miekg/ || true
+env:
+ - GO111MODULE=on
script:
- go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./...
diff --git a/vendor/github.com/miekg/dns/Gopkg.lock b/vendor/github.com/miekg/dns/Gopkg.lock
deleted file mode 100644
index 66be346a4b..0000000000
--- a/vendor/github.com/miekg/dns/Gopkg.lock
+++ /dev/null
@@ -1,33 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/crypto"
- packages = ["ed25519","ed25519/internal/edwards25519"]
- revision = "20be4c3c3ed52bfccdb2d59a412ee1a936d175a7"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/net"
- packages = ["bpf","internal/iana","internal/socket","ipv4","ipv6"]
- revision = "60506f45cf65977eb3a9c6e30f995f54a721c271"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/sync"
- packages = ["errgroup"]
- revision = "112230192c580c3556b8cee6403af37a4fc5f28c"
-
-[[projects]]
- branch = "master"
- name = "golang.org/x/sys"
- packages = ["unix","windows"]
- revision = "4c4f7f33c9ed00de01c4c741d2177abfcfe19307"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- inputs-digest = "fc70ece982d3660454fe1b9ccd5c91162a1cc080b58ad82aa065ad4a2ec93ce9"
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/vendor/github.com/miekg/dns/Gopkg.toml b/vendor/github.com/miekg/dns/Gopkg.toml
deleted file mode 100644
index 85e6ff31b2..0000000000
--- a/vendor/github.com/miekg/dns/Gopkg.toml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# Gopkg.toml example
-#
-# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-# name = "github.com/user/project"
-# version = "1.0.0"
-#
-# [[constraint]]
-# name = "github.com/user/project2"
-# branch = "dev"
-# source = "github.com/myfork/project2"
-#
-# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
-
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/crypto"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/net"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/sys"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/sync"
diff --git a/vendor/github.com/miekg/dns/duplicate_generate.go b/vendor/github.com/miekg/dns/duplicate_generate.go
deleted file mode 100644
index 9b7a71b16e..0000000000
--- a/vendor/github.com/miekg/dns/duplicate_generate.go
+++ /dev/null
@@ -1,144 +0,0 @@
-//+build ignore
-
-// types_generate.go is meant to run with go generate. It will use
-// go/{importer,types} to track down all the RR struct types. Then for each type
-// it will generate conversion tables (TypeToRR and TypeToString) and banal
-// methods (len, Header, copy) based on the struct tags. The generated source is
-// written to ztypes.go, and is meant to be checked into git.
-package main
-
-import (
- "bytes"
- "fmt"
- "go/format"
- "go/importer"
- "go/types"
- "log"
- "os"
-)
-
-var packageHdr = `
-// Code generated by "go run duplicate_generate.go"; DO NOT EDIT.
-
-package dns
-
-`
-
-func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) {
- st, ok := t.Underlying().(*types.Struct)
- if !ok {
- return nil, false
- }
- if st.Field(0).Type() == scope.Lookup("RR_Header").Type() {
- return st, false
- }
- if st.Field(0).Anonymous() {
- st, _ := getTypeStruct(st.Field(0).Type(), scope)
- return st, true
- }
- return nil, false
-}
-
-func main() {
- // Import and type-check the package
- pkg, err := importer.Default().Import("github.com/miekg/dns")
- fatalIfErr(err)
- scope := pkg.Scope()
-
- // Collect actual types (*X)
- var namedTypes []string
- for _, name := range scope.Names() {
- o := scope.Lookup(name)
- if o == nil || !o.Exported() {
- continue
- }
-
- if st, _ := getTypeStruct(o.Type(), scope); st == nil {
- continue
- }
-
- if name == "PrivateRR" || name == "OPT" {
- continue
- }
-
- namedTypes = append(namedTypes, o.Name())
- }
-
- b := &bytes.Buffer{}
- b.WriteString(packageHdr)
-
- // Generate the duplicate check for each type.
- fmt.Fprint(b, "// isDuplicate() functions\n\n")
- for _, name := range namedTypes {
-
- o := scope.Lookup(name)
- st, isEmbedded := getTypeStruct(o.Type(), scope)
- if isEmbedded {
- continue
- }
- fmt.Fprintf(b, "func (r1 *%s) isDuplicate(_r2 RR) bool {\n", name)
- fmt.Fprintf(b, "r2, ok := _r2.(*%s)\n", name)
- fmt.Fprint(b, "if !ok { return false }\n")
- fmt.Fprint(b, "_ = r2\n")
- for i := 1; i < st.NumFields(); i++ {
- field := st.Field(i).Name()
- o2 := func(s string) { fmt.Fprintf(b, s+"\n", field, field) }
- o3 := func(s string) { fmt.Fprintf(b, s+"\n", field, field, field) }
-
- // For some reason, a and aaaa don't pop up as *types.Slice here (mostly like because the are
- // *indirectly* defined as a slice in the net package).
- if _, ok := st.Field(i).Type().(*types.Slice); ok {
- o2("if len(r1.%s) != len(r2.%s) {\nreturn false\n}")
-
- if st.Tag(i) == `dns:"cdomain-name"` || st.Tag(i) == `dns:"domain-name"` {
- o3(`for i := 0; i < len(r1.%s); i++ {
- if !isDuplicateName(r1.%s[i], r2.%s[i]) {
- return false
- }
- }`)
-
- continue
- }
-
- o3(`for i := 0; i < len(r1.%s); i++ {
- if r1.%s[i] != r2.%s[i] {
- return false
- }
- }`)
-
- continue
- }
-
- switch st.Tag(i) {
- case `dns:"-"`:
- // ignored
- case `dns:"a"`, `dns:"aaaa"`:
- o2("if !r1.%s.Equal(r2.%s) {\nreturn false\n}")
- case `dns:"cdomain-name"`, `dns:"domain-name"`:
- o2("if !isDuplicateName(r1.%s, r2.%s) {\nreturn false\n}")
- default:
- o2("if r1.%s != r2.%s {\nreturn false\n}")
- }
- }
- fmt.Fprintf(b, "return true\n}\n\n")
- }
-
- // gofmt
- res, err := format.Source(b.Bytes())
- if err != nil {
- b.WriteTo(os.Stderr)
- log.Fatal(err)
- }
-
- // write result
- f, err := os.Create("zduplicate.go")
- fatalIfErr(err)
- defer f.Close()
- f.Write(res)
-}
-
-func fatalIfErr(err error) {
- if err != nil {
- log.Fatal(err)
- }
-}
diff --git a/vendor/github.com/miekg/dns/go.mod b/vendor/github.com/miekg/dns/go.mod
new file mode 100644
index 0000000000..5b9e187138
--- /dev/null
+++ b/vendor/github.com/miekg/dns/go.mod
@@ -0,0 +1,12 @@
+module github.com/miekg/dns
+
+go 1.12
+
+require (
+ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392
+ golang.org/x/net v0.0.0-20190923162816-aa69164e4478
+ golang.org/x/sync v0.0.0-20190423024810-112230192c58
+ golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe
+ golang.org/x/text v0.3.2 // indirect
+ golang.org/x/tools v0.0.0-20190907020128-2ca718005c18 // indirect
+)
diff --git a/vendor/github.com/miekg/dns/go.sum b/vendor/github.com/miekg/dns/go.sum
new file mode 100644
index 0000000000..482c403595
--- /dev/null
+++ b/vendor/github.com/miekg/dns/go.sum
@@ -0,0 +1,33 @@
+golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4 h1:Vk3wNqEZwyGyei9yq5ekj7frek2u7HUfffJ1/opblzc=
+golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM=
+golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M=
+golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
+golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 h1:dgd4x4kJt7G4k4m93AYLzM8Ni6h2qLTfh9n9vXJT3/0=
+golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g=
+golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611 h1:O33LKL7WyJgjN9CvxfTIomjIClbd/Kq86/iipowHQU0=
+golang.org/x/sys v0.0.0-20180928133829-e4b3c5e90611/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
+golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/vendor/github.com/miekg/dns/labels.go b/vendor/github.com/miekg/dns/labels.go
index e32d2a1d25..aa9dd41eec 100644
--- a/vendor/github.com/miekg/dns/labels.go
+++ b/vendor/github.com/miekg/dns/labels.go
@@ -13,27 +13,29 @@ func SplitDomainName(s string) (labels []string) {
if len(s) == 0 {
return nil
}
- fqdnEnd := 0 // offset of the final '.' or the length of the name
- idx := Split(s)
- begin := 0
+ if s == "." {
+ return nil
+ }
+ // offset of the final '.' or the length of the name
+ var fqdnEnd int
if IsFqdn(s) {
fqdnEnd = len(s) - 1
} else {
fqdnEnd = len(s)
}
-
- switch len(idx) {
- case 0:
- return nil
- case 1:
- // no-op
- default:
- for _, end := range idx[1:] {
- labels = append(labels, s[begin:end-1])
- begin = end
+ var (
+ begin int
+ off int
+ end bool
+ )
+ for {
+ off, end = NextLabel(s, off)
+ if end {
+ break
}
+ labels = append(labels, s[begin:off-1])
+ begin = off
}
-
return append(labels, s[begin:fqdnEnd])
}
@@ -52,52 +54,50 @@ func CompareDomainName(s1, s2 string) (n int) {
return 0
}
- l1 := Split(s1)
- l2 := Split(s2)
-
- j1 := len(l1) - 1 // end
- i1 := len(l1) - 2 // start
- j2 := len(l2) - 1
- i2 := len(l2) - 2
- // the second check can be done here: last/only label
- // before we fall through into the for-loop below
- if equal(s1[l1[j1]:], s2[l2[j2]:]) {
- n++
- } else {
- return
+ j1 := len(s1)
+ if s1[j1-1] == '.' {
+ j1--
}
+ j2 := len(s2)
+ if s2[j2-1] == '.' {
+ j2--
+ }
+ var i1, i2 int
for {
- if i1 < 0 || i2 < 0 {
- break
- }
- if equal(s1[l1[i1]:l1[j1]], s2[l2[i2]:l2[j2]]) {
+ i1 = prevLabel(s1, j1-1)
+ i2 = prevLabel(s2, j2-1)
+ if equal(s1[i1:j1], s2[i2:j2]) {
n++
} else {
break
}
- j1--
- i1--
- j2--
- i2--
+ if i1 == 0 || i2 == 0 {
+ break
+ }
+ j1 = i1 - 2
+ j2 = i2 - 2
}
return
}
// CountLabel counts the the number of labels in the string s.
// s must be a syntactically valid domain name.
-func CountLabel(s string) (labels int) {
+func CountLabel(s string) int {
if s == "." {
- return
+ return 0
}
- off := 0
- end := false
- for {
- off, end = NextLabel(s, off)
- labels++
- if end {
- return
+ labels := 1
+ for i := 0; i < len(s)-1; i++ {
+ c := s[i]
+ if c == '\\' {
+ i++
+ continue
+ }
+ if c == '.' {
+ labels++
}
}
+ return labels
}
// Split splits a name s into its label indexes.
@@ -126,40 +126,70 @@ func Split(s string) []int {
// The bool end is true when the end of the string has been reached.
// Also see PrevLabel.
func NextLabel(s string, offset int) (i int, end bool) {
- quote := false
for i = offset; i < len(s)-1; i++ {
- switch s[i] {
- case '\\':
- quote = !quote
- default:
- quote = false
- case '.':
- if quote {
- quote = !quote
- continue
- }
+ c := s[i]
+ if c == '\\' {
+ i++
+ continue
+ }
+ if c == '.' {
return i + 1, false
}
}
return i + 1, true
}
+func prevLabel(s string, offset int) int {
+ for i := offset; i >= 0; i-- {
+ if s[i] == '.' {
+ if i == 0 || s[i-1] != '\\' {
+ return i + 1 // the '.' is not escaped
+ }
+ // We are at '\.' and need to check if the '\' itself is escaped.
+ // We do this by walking backwards from '\.' and counting the
+ // number of '\' we encounter. If the number of '\' is even
+ // (though here it's actually odd since we start at '\.') the '\'
+ // is escaped.
+ j := i - 2
+ for ; j >= 0 && s[j] == '\\'; j-- {
+ }
+ // An odd number here indicates that the '\' preceding the '.'
+ // is escaped.
+ if (i-j)&1 == 1 {
+ return i + 1
+ }
+ i = j + 1
+ }
+ }
+ return 0
+}
+
// PrevLabel returns the index of the label when starting from the right and
// jumping n labels to the left.
// The bool start is true when the start of the string has been overshot.
// Also see NextLabel.
func PrevLabel(s string, n int) (i int, start bool) {
+ if s == "." {
+ return 0, true
+ }
if n == 0 {
return len(s), false
}
- lab := Split(s)
- if lab == nil {
+ i = len(s) - 1
+ if s[i] == '.' {
+ i--
+ }
+ for ; n > 0; n-- {
+ i = prevLabel(s, i)
+ if i == 0 {
+ break
+ }
+ i -= 2
+ }
+ if n > 0 {
return 0, true
}
- if n > len(lab) {
- return 0, true
- }
- return lab[len(lab)-n], false
+ return i + 2, false
}
// equal compares a and b while ignoring case. It returns true when equal otherwise false.
@@ -170,18 +200,19 @@ func equal(a, b string) bool {
if la != lb {
return false
}
-
- for i := la - 1; i >= 0; i-- {
- ai := a[i]
- bi := b[i]
- if ai >= 'A' && ai <= 'Z' {
- ai |= 'a' - 'A'
- }
- if bi >= 'A' && bi <= 'Z' {
- bi |= 'a' - 'A'
- }
- if ai != bi {
- return false
+ if a != b {
+ // case-insensitive comparison
+ for i := la - 1; i >= 0; i-- {
+ ai := a[i]
+ bi := b[i]
+ if ai != bi {
+ if bi < ai {
+ bi, ai = ai, bi
+ }
+ if !('A' <= ai && ai <= 'Z' && bi == ai+'a'-'A') {
+ return false
+ }
+ }
}
}
return true
diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go
index e04fb5d77a..a2e051b6a4 100644
--- a/vendor/github.com/miekg/dns/msg.go
+++ b/vendor/github.com/miekg/dns/msg.go
@@ -754,13 +754,24 @@ func (dns *Msg) Pack() (msg []byte, err error) {
return dns.PackBuffer(nil)
}
+var compressionPackPool = sync.Pool{
+ New: func() interface{} {
+ return make(map[string]uint16)
+ },
+}
+
// PackBuffer packs a Msg, using the given buffer buf. If buf is too small a new buffer is allocated.
func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) {
// If this message can't be compressed, avoid filling the
// compression map and creating garbage.
if dns.Compress && dns.isCompressible() {
- compression := make(map[string]uint16) // Compression pointer mappings.
- return dns.packBufferWithCompressionMap(buf, compressionMap{int: compression}, true)
+ compression := compressionPackPool.Get().(map[string]uint16)
+ msg, err := dns.packBufferWithCompressionMap(buf, compressionMap{int: compression}, true)
+ for k := range compression {
+ delete(compression, k)
+ }
+ compressionPackPool.Put(compression)
+ return msg, err
}
return dns.packBufferWithCompressionMap(buf, compressionMap{}, false)
@@ -972,6 +983,12 @@ func (dns *Msg) isCompressible() bool {
len(dns.Ns) > 0 || len(dns.Extra) > 0
}
+var compressionPool = sync.Pool{
+ New: func() interface{} {
+ return make(map[string]struct{})
+ },
+}
+
// Len returns the message length when in (un)compressed wire format.
// If dns.Compress is true compression it is taken into account. Len()
// is provided to be a faster way to get the size of the resulting packet,
@@ -980,8 +997,13 @@ func (dns *Msg) Len() int {
// If this message can't be compressed, avoid filling the
// compression map and creating garbage.
if dns.Compress && dns.isCompressible() {
- compression := make(map[string]struct{})
- return msgLenWithCompressionMap(dns, compression)
+ compression := compressionPool.Get().(map[string]struct{})
+ n := msgLenWithCompressionMap(dns, compression)
+ for k := range compression {
+ delete(compression, k)
+ }
+ compressionPool.Put(compression)
+ return n
}
return msgLenWithCompressionMap(dns, nil)
diff --git a/vendor/github.com/miekg/dns/msg_generate.go b/vendor/github.com/miekg/dns/msg_generate.go
deleted file mode 100644
index 721a0fce32..0000000000
--- a/vendor/github.com/miekg/dns/msg_generate.go
+++ /dev/null
@@ -1,328 +0,0 @@
-//+build ignore
-
-// msg_generate.go is meant to run with go generate. It will use
-// go/{importer,types} to track down all the RR struct types. Then for each type
-// it will generate pack/unpack methods based on the struct tags. The generated source is
-// written to zmsg.go, and is meant to be checked into git.
-package main
-
-import (
- "bytes"
- "fmt"
- "go/format"
- "go/importer"
- "go/types"
- "log"
- "os"
- "strings"
-)
-
-var packageHdr = `
-// Code generated by "go run msg_generate.go"; DO NOT EDIT.
-
-package dns
-
-`
-
-// getTypeStruct will take a type and the package scope, and return the
-// (innermost) struct if the type is considered a RR type (currently defined as
-// those structs beginning with a RR_Header, could be redefined as implementing
-// the RR interface). The bool return value indicates if embedded structs were
-// resolved.
-func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) {
- st, ok := t.Underlying().(*types.Struct)
- if !ok {
- return nil, false
- }
- if st.Field(0).Type() == scope.Lookup("RR_Header").Type() {
- return st, false
- }
- if st.Field(0).Anonymous() {
- st, _ := getTypeStruct(st.Field(0).Type(), scope)
- return st, true
- }
- return nil, false
-}
-
-func main() {
- // Import and type-check the package
- pkg, err := importer.Default().Import("github.com/miekg/dns")
- fatalIfErr(err)
- scope := pkg.Scope()
-
- // Collect actual types (*X)
- var namedTypes []string
- for _, name := range scope.Names() {
- o := scope.Lookup(name)
- if o == nil || !o.Exported() {
- continue
- }
- if st, _ := getTypeStruct(o.Type(), scope); st == nil {
- continue
- }
- if name == "PrivateRR" {
- continue
- }
-
- // Check if corresponding TypeX exists
- if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" {
- log.Fatalf("Constant Type%s does not exist.", o.Name())
- }
-
- namedTypes = append(namedTypes, o.Name())
- }
-
- b := &bytes.Buffer{}
- b.WriteString(packageHdr)
-
- fmt.Fprint(b, "// pack*() functions\n\n")
- for _, name := range namedTypes {
- o := scope.Lookup(name)
- st, _ := getTypeStruct(o.Type(), scope)
-
- fmt.Fprintf(b, "func (rr *%s) pack(msg []byte, off int, compression compressionMap, compress bool) (off1 int, err error) {\n", name)
- for i := 1; i < st.NumFields(); i++ {
- o := func(s string) {
- fmt.Fprintf(b, s, st.Field(i).Name())
- fmt.Fprint(b, `if err != nil {
-return off, err
-}
-`)
- }
-
- if _, ok := st.Field(i).Type().(*types.Slice); ok {
- switch st.Tag(i) {
- case `dns:"-"`: // ignored
- case `dns:"txt"`:
- o("off, err = packStringTxt(rr.%s, msg, off)\n")
- case `dns:"opt"`:
- o("off, err = packDataOpt(rr.%s, msg, off)\n")
- case `dns:"nsec"`:
- o("off, err = packDataNsec(rr.%s, msg, off)\n")
- case `dns:"domain-name"`:
- o("off, err = packDataDomainNames(rr.%s, msg, off, compression, false)\n")
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- continue
- }
-
- switch {
- case st.Tag(i) == `dns:"-"`: // ignored
- case st.Tag(i) == `dns:"cdomain-name"`:
- o("off, err = packDomainName(rr.%s, msg, off, compression, compress)\n")
- case st.Tag(i) == `dns:"domain-name"`:
- o("off, err = packDomainName(rr.%s, msg, off, compression, false)\n")
- case st.Tag(i) == `dns:"a"`:
- o("off, err = packDataA(rr.%s, msg, off)\n")
- case st.Tag(i) == `dns:"aaaa"`:
- o("off, err = packDataAAAA(rr.%s, msg, off)\n")
- case st.Tag(i) == `dns:"uint48"`:
- o("off, err = packUint48(rr.%s, msg, off)\n")
- case st.Tag(i) == `dns:"txt"`:
- o("off, err = packString(rr.%s, msg, off)\n")
-
- case strings.HasPrefix(st.Tag(i), `dns:"size-base32`): // size-base32 can be packed just like base32
- fallthrough
- case st.Tag(i) == `dns:"base32"`:
- o("off, err = packStringBase32(rr.%s, msg, off)\n")
-
- case strings.HasPrefix(st.Tag(i), `dns:"size-base64`): // size-base64 can be packed just like base64
- fallthrough
- case st.Tag(i) == `dns:"base64"`:
- o("off, err = packStringBase64(rr.%s, msg, off)\n")
-
- case strings.HasPrefix(st.Tag(i), `dns:"size-hex:SaltLength`):
- // directly write instead of using o() so we get the error check in the correct place
- field := st.Field(i).Name()
- fmt.Fprintf(b, `// Only pack salt if value is not "-", i.e. empty
-if rr.%s != "-" {
- off, err = packStringHex(rr.%s, msg, off)
- if err != nil {
- return off, err
- }
-}
-`, field, field)
- continue
- case strings.HasPrefix(st.Tag(i), `dns:"size-hex`): // size-hex can be packed just like hex
- fallthrough
- case st.Tag(i) == `dns:"hex"`:
- o("off, err = packStringHex(rr.%s, msg, off)\n")
- case st.Tag(i) == `dns:"any"`:
- o("off, err = packStringAny(rr.%s, msg, off)\n")
- case st.Tag(i) == `dns:"octet"`:
- o("off, err = packStringOctet(rr.%s, msg, off)\n")
- case st.Tag(i) == "":
- switch st.Field(i).Type().(*types.Basic).Kind() {
- case types.Uint8:
- o("off, err = packUint8(rr.%s, msg, off)\n")
- case types.Uint16:
- o("off, err = packUint16(rr.%s, msg, off)\n")
- case types.Uint32:
- o("off, err = packUint32(rr.%s, msg, off)\n")
- case types.Uint64:
- o("off, err = packUint64(rr.%s, msg, off)\n")
- case types.String:
- o("off, err = packString(rr.%s, msg, off)\n")
- default:
- log.Fatalln(name, st.Field(i).Name())
- }
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- }
- fmt.Fprintln(b, "return off, nil }\n")
- }
-
- fmt.Fprint(b, "// unpack*() functions\n\n")
- for _, name := range namedTypes {
- o := scope.Lookup(name)
- st, _ := getTypeStruct(o.Type(), scope)
-
- fmt.Fprintf(b, "func (rr *%s) unpack(msg []byte, off int) (off1 int, err error) {\n", name)
- fmt.Fprint(b, `rdStart := off
-_ = rdStart
-
-`)
- for i := 1; i < st.NumFields(); i++ {
- o := func(s string) {
- fmt.Fprintf(b, s, st.Field(i).Name())
- fmt.Fprint(b, `if err != nil {
-return off, err
-}
-`)
- }
-
- // size-* are special, because they reference a struct member we should use for the length.
- if strings.HasPrefix(st.Tag(i), `dns:"size-`) {
- structMember := structMember(st.Tag(i))
- structTag := structTag(st.Tag(i))
- switch structTag {
- case "hex":
- fmt.Fprintf(b, "rr.%s, off, err = unpackStringHex(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember)
- case "base32":
- fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase32(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember)
- case "base64":
- fmt.Fprintf(b, "rr.%s, off, err = unpackStringBase64(msg, off, off + int(rr.%s))\n", st.Field(i).Name(), structMember)
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- fmt.Fprint(b, `if err != nil {
-return off, err
-}
-`)
- continue
- }
-
- if _, ok := st.Field(i).Type().(*types.Slice); ok {
- switch st.Tag(i) {
- case `dns:"-"`: // ignored
- case `dns:"txt"`:
- o("rr.%s, off, err = unpackStringTxt(msg, off)\n")
- case `dns:"opt"`:
- o("rr.%s, off, err = unpackDataOpt(msg, off)\n")
- case `dns:"nsec"`:
- o("rr.%s, off, err = unpackDataNsec(msg, off)\n")
- case `dns:"domain-name"`:
- o("rr.%s, off, err = unpackDataDomainNames(msg, off, rdStart + int(rr.Hdr.Rdlength))\n")
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- continue
- }
-
- switch st.Tag(i) {
- case `dns:"-"`: // ignored
- case `dns:"cdomain-name"`:
- fallthrough
- case `dns:"domain-name"`:
- o("rr.%s, off, err = UnpackDomainName(msg, off)\n")
- case `dns:"a"`:
- o("rr.%s, off, err = unpackDataA(msg, off)\n")
- case `dns:"aaaa"`:
- o("rr.%s, off, err = unpackDataAAAA(msg, off)\n")
- case `dns:"uint48"`:
- o("rr.%s, off, err = unpackUint48(msg, off)\n")
- case `dns:"txt"`:
- o("rr.%s, off, err = unpackString(msg, off)\n")
- case `dns:"base32"`:
- o("rr.%s, off, err = unpackStringBase32(msg, off, rdStart + int(rr.Hdr.Rdlength))\n")
- case `dns:"base64"`:
- o("rr.%s, off, err = unpackStringBase64(msg, off, rdStart + int(rr.Hdr.Rdlength))\n")
- case `dns:"hex"`:
- o("rr.%s, off, err = unpackStringHex(msg, off, rdStart + int(rr.Hdr.Rdlength))\n")
- case `dns:"any"`:
- o("rr.%s, off, err = unpackStringAny(msg, off, rdStart + int(rr.Hdr.Rdlength))\n")
- case `dns:"octet"`:
- o("rr.%s, off, err = unpackStringOctet(msg, off)\n")
- case "":
- switch st.Field(i).Type().(*types.Basic).Kind() {
- case types.Uint8:
- o("rr.%s, off, err = unpackUint8(msg, off)\n")
- case types.Uint16:
- o("rr.%s, off, err = unpackUint16(msg, off)\n")
- case types.Uint32:
- o("rr.%s, off, err = unpackUint32(msg, off)\n")
- case types.Uint64:
- o("rr.%s, off, err = unpackUint64(msg, off)\n")
- case types.String:
- o("rr.%s, off, err = unpackString(msg, off)\n")
- default:
- log.Fatalln(name, st.Field(i).Name())
- }
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- // If we've hit len(msg) we return without error.
- if i < st.NumFields()-1 {
- fmt.Fprintf(b, `if off == len(msg) {
-return off, nil
- }
-`)
- }
- }
- fmt.Fprintf(b, "return off, nil }\n\n")
- }
-
- // gofmt
- res, err := format.Source(b.Bytes())
- if err != nil {
- b.WriteTo(os.Stderr)
- log.Fatal(err)
- }
-
- // write result
- f, err := os.Create("zmsg.go")
- fatalIfErr(err)
- defer f.Close()
- f.Write(res)
-}
-
-// structMember will take a tag like dns:"size-base32:SaltLength" and return the last part of this string.
-func structMember(s string) string {
- fields := strings.Split(s, ":")
- if len(fields) == 0 {
- return ""
- }
- f := fields[len(fields)-1]
- // f should have a closing "
- if len(f) > 1 {
- return f[:len(f)-1]
- }
- return f
-}
-
-// structTag will take a tag like dns:"size-base32:SaltLength" and return base32.
-func structTag(s string) string {
- fields := strings.Split(s, ":")
- if len(fields) < 2 {
- return ""
- }
- return fields[1][len("\"size-"):]
-}
-
-func fatalIfErr(err error) {
- if err != nil {
- log.Fatal(err)
- }
-}
diff --git a/vendor/github.com/miekg/dns/msg_helpers.go b/vendor/github.com/miekg/dns/msg_helpers.go
index cb4ae764b4..0e96f0f345 100644
--- a/vendor/github.com/miekg/dns/msg_helpers.go
+++ b/vendor/github.com/miekg/dns/msg_helpers.go
@@ -265,24 +265,36 @@ func unpackString(msg []byte, off int) (string, int, error) {
return "", off, &Error{err: "overflow unpacking txt"}
}
l := int(msg[off])
- if off+l+1 > len(msg) {
+ off++
+ if off+l > len(msg) {
return "", off, &Error{err: "overflow unpacking txt"}
}
var s strings.Builder
- s.Grow(l)
- for _, b := range msg[off+1 : off+1+l] {
+ consumed := 0
+ for i, b := range msg[off : off+l] {
switch {
case b == '"' || b == '\\':
+ if consumed == 0 {
+ s.Grow(l * 2)
+ }
+ s.Write(msg[off+consumed : off+i])
s.WriteByte('\\')
s.WriteByte(b)
+ consumed = i + 1
case b < ' ' || b > '~': // unprintable
+ if consumed == 0 {
+ s.Grow(l * 2)
+ }
+ s.Write(msg[off+consumed : off+i])
s.WriteString(escapeByte(b))
- default:
- s.WriteByte(b)
+ consumed = i + 1
}
}
- off += 1 + l
- return s.String(), off, nil
+ if consumed == 0 { // no escaping needed
+ return string(msg[off : off+l]), off + l, nil
+ }
+ s.Write(msg[off+consumed : off+l])
+ return s.String(), off + l, nil
}
func packString(s string, msg []byte, off int) (int, error) {
diff --git a/vendor/github.com/miekg/dns/msg_truncate.go b/vendor/github.com/miekg/dns/msg_truncate.go
index 89d40757db..a711f006d0 100644
--- a/vendor/github.com/miekg/dns/msg_truncate.go
+++ b/vendor/github.com/miekg/dns/msg_truncate.go
@@ -54,7 +54,7 @@ func (dns *Msg) Truncate(size int) {
size -= Len(edns0)
}
- compression := make(map[string]struct{})
+ compression := compressionPool.Get().(map[string]struct{})
l = headerSize
for _, r := range dns.Question {
@@ -88,6 +88,11 @@ func (dns *Msg) Truncate(size int) {
// Add the OPT record back onto the additional section.
dns.Extra = append(dns.Extra, edns0)
}
+
+ for k := range compression {
+ delete(compression, k)
+ }
+ compressionPool.Put(compression)
}
func truncateLoop(rrs []RR, size, l int, compression map[string]struct{}) (int, int) {
diff --git a/vendor/github.com/miekg/dns/serve_mux.go b/vendor/github.com/miekg/dns/serve_mux.go
index ae304db530..69deb33e80 100644
--- a/vendor/github.com/miekg/dns/serve_mux.go
+++ b/vendor/github.com/miekg/dns/serve_mux.go
@@ -36,33 +36,9 @@ func (mux *ServeMux) match(q string, t uint16) Handler {
return nil
}
+ q = strings.ToLower(q)
+
var handler Handler
-
- // TODO(tmthrgd): Once https://go-review.googlesource.com/c/go/+/137575
- // lands in a go release, replace the following with strings.ToLower.
- var sb strings.Builder
- for i := 0; i < len(q); i++ {
- c := q[i]
- if !(c >= 'A' && c <= 'Z') {
- continue
- }
-
- sb.Grow(len(q))
- sb.WriteString(q[:i])
-
- for ; i < len(q); i++ {
- c := q[i]
- if c >= 'A' && c <= 'Z' {
- c += 'a' - 'A'
- }
-
- sb.WriteByte(c)
- }
-
- q = sb.String()
- break
- }
-
for off, end := 0, false; !end; off, end = NextLabel(q, off) {
if h, ok := mux.z[q[off:]]; ok {
if t != TypeDS {
diff --git a/vendor/github.com/miekg/dns/types.go b/vendor/github.com/miekg/dns/types.go
index 6f79038b4a..95fce25df7 100644
--- a/vendor/github.com/miekg/dns/types.go
+++ b/vendor/github.com/miekg/dns/types.go
@@ -438,25 +438,54 @@ func (rr *TXT) String() string { return rr.Hdr.String() + sprintTxt(rr.Txt) }
func sprintName(s string) string {
var dst strings.Builder
- dst.Grow(len(s))
+
for i := 0; i < len(s); {
if i+1 < len(s) && s[i] == '\\' && s[i+1] == '.' {
- dst.WriteString(s[i : i+2])
+ if dst.Len() != 0 {
+ dst.WriteString(s[i : i+2])
+ }
i += 2
continue
}
b, n := nextByte(s, i)
- switch {
- case n == 0:
- i++ // dangling back slash
- case b == '.':
- dst.WriteByte('.')
+ if n == 0 {
+ i++
+ continue
+ }
+ if b == '.' {
+ if dst.Len() != 0 {
+ dst.WriteByte('.')
+ }
+ i += n
+ continue
+ }
+ switch b {
+ case ' ', '\'', '@', ';', '(', ')', '"', '\\': // additional chars to escape
+ if dst.Len() == 0 {
+ dst.Grow(len(s) * 2)
+ dst.WriteString(s[:i])
+ }
+ dst.WriteByte('\\')
+ dst.WriteByte(b)
default:
- writeDomainNameByte(&dst, b)
+ if ' ' <= b && b <= '~' {
+ if dst.Len() != 0 {
+ dst.WriteByte(b)
+ }
+ } else {
+ if dst.Len() == 0 {
+ dst.Grow(len(s) * 2)
+ dst.WriteString(s[:i])
+ }
+ dst.WriteString(escapeByte(b))
+ }
}
i += n
}
+ if dst.Len() == 0 {
+ return s
+ }
return dst.String()
}
@@ -510,16 +539,6 @@ func sprintTxt(txt []string) string {
return out.String()
}
-func writeDomainNameByte(s *strings.Builder, b byte) {
- switch b {
- case '.', ' ', '\'', '@', ';', '(', ')': // additional chars to escape
- s.WriteByte('\\')
- s.WriteByte(b)
- default:
- writeTXTStringByte(s, b)
- }
-}
-
func writeTXTStringByte(s *strings.Builder, b byte) {
switch {
case b == '"' || b == '\\':
diff --git a/vendor/github.com/miekg/dns/types_generate.go b/vendor/github.com/miekg/dns/types_generate.go
deleted file mode 100644
index 8cda2a74c5..0000000000
--- a/vendor/github.com/miekg/dns/types_generate.go
+++ /dev/null
@@ -1,285 +0,0 @@
-//+build ignore
-
-// types_generate.go is meant to run with go generate. It will use
-// go/{importer,types} to track down all the RR struct types. Then for each type
-// it will generate conversion tables (TypeToRR and TypeToString) and banal
-// methods (len, Header, copy) based on the struct tags. The generated source is
-// written to ztypes.go, and is meant to be checked into git.
-package main
-
-import (
- "bytes"
- "fmt"
- "go/format"
- "go/importer"
- "go/types"
- "log"
- "os"
- "strings"
- "text/template"
-)
-
-var skipLen = map[string]struct{}{
- "NSEC": {},
- "NSEC3": {},
- "OPT": {},
- "CSYNC": {},
-}
-
-var packageHdr = `
-// Code generated by "go run types_generate.go"; DO NOT EDIT.
-
-package dns
-
-import (
- "encoding/base64"
- "net"
-)
-
-`
-
-var TypeToRR = template.Must(template.New("TypeToRR").Parse(`
-// TypeToRR is a map of constructors for each RR type.
-var TypeToRR = map[uint16]func() RR{
-{{range .}}{{if ne . "RFC3597"}} Type{{.}}: func() RR { return new({{.}}) },
-{{end}}{{end}} }
-
-`))
-
-var typeToString = template.Must(template.New("typeToString").Parse(`
-// TypeToString is a map of strings for each RR type.
-var TypeToString = map[uint16]string{
-{{range .}}{{if ne . "NSAPPTR"}} Type{{.}}: "{{.}}",
-{{end}}{{end}} TypeNSAPPTR: "NSAP-PTR",
-}
-
-`))
-
-var headerFunc = template.Must(template.New("headerFunc").Parse(`
-{{range .}} func (rr *{{.}}) Header() *RR_Header { return &rr.Hdr }
-{{end}}
-
-`))
-
-// getTypeStruct will take a type and the package scope, and return the
-// (innermost) struct if the type is considered a RR type (currently defined as
-// those structs beginning with a RR_Header, could be redefined as implementing
-// the RR interface). The bool return value indicates if embedded structs were
-// resolved.
-func getTypeStruct(t types.Type, scope *types.Scope) (*types.Struct, bool) {
- st, ok := t.Underlying().(*types.Struct)
- if !ok {
- return nil, false
- }
- if st.Field(0).Type() == scope.Lookup("RR_Header").Type() {
- return st, false
- }
- if st.Field(0).Anonymous() {
- st, _ := getTypeStruct(st.Field(0).Type(), scope)
- return st, true
- }
- return nil, false
-}
-
-func main() {
- // Import and type-check the package
- pkg, err := importer.Default().Import("github.com/miekg/dns")
- fatalIfErr(err)
- scope := pkg.Scope()
-
- // Collect constants like TypeX
- var numberedTypes []string
- for _, name := range scope.Names() {
- o := scope.Lookup(name)
- if o == nil || !o.Exported() {
- continue
- }
- b, ok := o.Type().(*types.Basic)
- if !ok || b.Kind() != types.Uint16 {
- continue
- }
- if !strings.HasPrefix(o.Name(), "Type") {
- continue
- }
- name := strings.TrimPrefix(o.Name(), "Type")
- if name == "PrivateRR" {
- continue
- }
- numberedTypes = append(numberedTypes, name)
- }
-
- // Collect actual types (*X)
- var namedTypes []string
- for _, name := range scope.Names() {
- o := scope.Lookup(name)
- if o == nil || !o.Exported() {
- continue
- }
- if st, _ := getTypeStruct(o.Type(), scope); st == nil {
- continue
- }
- if name == "PrivateRR" {
- continue
- }
-
- // Check if corresponding TypeX exists
- if scope.Lookup("Type"+o.Name()) == nil && o.Name() != "RFC3597" {
- log.Fatalf("Constant Type%s does not exist.", o.Name())
- }
-
- namedTypes = append(namedTypes, o.Name())
- }
-
- b := &bytes.Buffer{}
- b.WriteString(packageHdr)
-
- // Generate TypeToRR
- fatalIfErr(TypeToRR.Execute(b, namedTypes))
-
- // Generate typeToString
- fatalIfErr(typeToString.Execute(b, numberedTypes))
-
- // Generate headerFunc
- fatalIfErr(headerFunc.Execute(b, namedTypes))
-
- // Generate len()
- fmt.Fprint(b, "// len() functions\n")
- for _, name := range namedTypes {
- if _, ok := skipLen[name]; ok {
- continue
- }
- o := scope.Lookup(name)
- st, isEmbedded := getTypeStruct(o.Type(), scope)
- if isEmbedded {
- continue
- }
- fmt.Fprintf(b, "func (rr *%s) len(off int, compression map[string]struct{}) int {\n", name)
- fmt.Fprintf(b, "l := rr.Hdr.len(off, compression)\n")
- for i := 1; i < st.NumFields(); i++ {
- o := func(s string) { fmt.Fprintf(b, s, st.Field(i).Name()) }
-
- if _, ok := st.Field(i).Type().(*types.Slice); ok {
- switch st.Tag(i) {
- case `dns:"-"`:
- // ignored
- case `dns:"cdomain-name"`:
- o("for _, x := range rr.%s { l += domainNameLen(x, off+l, compression, true) }\n")
- case `dns:"domain-name"`:
- o("for _, x := range rr.%s { l += domainNameLen(x, off+l, compression, false) }\n")
- case `dns:"txt"`:
- o("for _, x := range rr.%s { l += len(x) + 1 }\n")
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- continue
- }
-
- switch {
- case st.Tag(i) == `dns:"-"`:
- // ignored
- case st.Tag(i) == `dns:"cdomain-name"`:
- o("l += domainNameLen(rr.%s, off+l, compression, true)\n")
- case st.Tag(i) == `dns:"domain-name"`:
- o("l += domainNameLen(rr.%s, off+l, compression, false)\n")
- case st.Tag(i) == `dns:"octet"`:
- o("l += len(rr.%s)\n")
- case strings.HasPrefix(st.Tag(i), `dns:"size-base64`):
- fallthrough
- case st.Tag(i) == `dns:"base64"`:
- o("l += base64.StdEncoding.DecodedLen(len(rr.%s))\n")
- case strings.HasPrefix(st.Tag(i), `dns:"size-hex:`): // this has an extra field where the length is stored
- o("l += len(rr.%s)/2\n")
- case st.Tag(i) == `dns:"hex"`:
- o("l += len(rr.%s)/2\n")
- case st.Tag(i) == `dns:"any"`:
- o("l += len(rr.%s)\n")
- case st.Tag(i) == `dns:"a"`:
- o("if len(rr.%s) != 0 { l += net.IPv4len }\n")
- case st.Tag(i) == `dns:"aaaa"`:
- o("if len(rr.%s) != 0 { l += net.IPv6len }\n")
- case st.Tag(i) == `dns:"txt"`:
- o("for _, t := range rr.%s { l += len(t) + 1 }\n")
- case st.Tag(i) == `dns:"uint48"`:
- o("l += 6 // %s\n")
- case st.Tag(i) == "":
- switch st.Field(i).Type().(*types.Basic).Kind() {
- case types.Uint8:
- o("l++ // %s\n")
- case types.Uint16:
- o("l += 2 // %s\n")
- case types.Uint32:
- o("l += 4 // %s\n")
- case types.Uint64:
- o("l += 8 // %s\n")
- case types.String:
- o("l += len(rr.%s) + 1\n")
- default:
- log.Fatalln(name, st.Field(i).Name())
- }
- default:
- log.Fatalln(name, st.Field(i).Name(), st.Tag(i))
- }
- }
- fmt.Fprintf(b, "return l }\n")
- }
-
- // Generate copy()
- fmt.Fprint(b, "// copy() functions\n")
- for _, name := range namedTypes {
- o := scope.Lookup(name)
- st, isEmbedded := getTypeStruct(o.Type(), scope)
- if isEmbedded {
- continue
- }
- fmt.Fprintf(b, "func (rr *%s) copy() RR {\n", name)
- fields := []string{"rr.Hdr"}
- for i := 1; i < st.NumFields(); i++ {
- f := st.Field(i).Name()
- if sl, ok := st.Field(i).Type().(*types.Slice); ok {
- t := sl.Underlying().String()
- t = strings.TrimPrefix(t, "[]")
- if strings.Contains(t, ".") {
- splits := strings.Split(t, ".")
- t = splits[len(splits)-1]
- }
- // For the EDNS0 interface (used in the OPT RR), we need to call the copy method on each element.
- if t == "EDNS0" {
- fmt.Fprintf(b, "%s := make([]%s, len(rr.%s));\nfor i,e := range rr.%s {\n %s[i] = e.copy()\n}\n",
- f, t, f, f, f)
- fields = append(fields, f)
- continue
- }
- fmt.Fprintf(b, "%s := make([]%s, len(rr.%s)); copy(%s, rr.%s)\n",
- f, t, f, f, f)
- fields = append(fields, f)
- continue
- }
- if st.Field(i).Type().String() == "net.IP" {
- fields = append(fields, "copyIP(rr."+f+")")
- continue
- }
- fields = append(fields, "rr."+f)
- }
- fmt.Fprintf(b, "return &%s{%s}\n", name, strings.Join(fields, ","))
- fmt.Fprintf(b, "}\n")
- }
-
- // gofmt
- res, err := format.Source(b.Bytes())
- if err != nil {
- b.WriteTo(os.Stderr)
- log.Fatal(err)
- }
-
- // write result
- f, err := os.Create("ztypes.go")
- fatalIfErr(err)
- defer f.Close()
- f.Write(res)
-}
-
-func fatalIfErr(err error) {
- if err != nil {
- log.Fatal(err)
- }
-}
diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go
index 2e0292eff6..b945243ec8 100644
--- a/vendor/github.com/miekg/dns/version.go
+++ b/vendor/github.com/miekg/dns/version.go
@@ -3,7 +3,7 @@ package dns
import "fmt"
// Version is current version of this library.
-var Version = V{1, 1, 15}
+var Version = V{1, 1, 19}
// V holds the version of this library.
type V struct {
diff --git a/vendor/github.com/minio/minio-go/v6/.travis.yml b/vendor/github.com/minio/minio-go/v6/.travis.yml
index 5dbda5e7de..e50cefee70 100644
--- a/vendor/github.com/minio/minio-go/v6/.travis.yml
+++ b/vendor/github.com/minio/minio-go/v6/.travis.yml
@@ -8,7 +8,7 @@ env:
- ARCH=x86_64
go:
-- 1.12.x
+- 1.13.x
- tip
matrix:
@@ -18,10 +18,11 @@ matrix:
before_install:
- sudo apt-get install devscripts
- - curl -O https://dl.minio.io/server/minio/release/linux-amd64/minio && chmod +x ./minio
+ - mkdir /tmp/minio
+ - (cd /tmp/minio; GO111MODULE=on go get github.com/minio/minio)
- sudo cp testcerts/public.crt /usr/local/share/ca-certificates/
- sudo update-ca-certificates
- - MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=minio123 ./minio server --compat --quiet --certs-dir testcerts data 2>&1 > minio.log &
+ - MINIO_ACCESS_KEY=minio MINIO_SECRET_KEY=minio123 ${GOPATH}/bin/minio server --compat --quiet --certs-dir testcerts data 2>&1 > minio.log &
script:
- diff -au <(gofmt -d .) <(printf "")
diff --git a/vendor/github.com/minio/minio-go/v6/Makefile b/vendor/github.com/minio/minio-go/v6/Makefile
index 892f8cf507..5cfe33a46c 100644
--- a/vendor/github.com/minio/minio-go/v6/Makefile
+++ b/vendor/github.com/minio/minio-go/v6/Makefile
@@ -2,7 +2,7 @@ all: checks
.PHONY: examples docs
-checks: vet test examples docs functional-test
+checks: vet test examples functional-test
vet:
@GO111MODULE=on go vet ./...
@@ -13,8 +13,5 @@ test:
examples:
@mkdir -p /tmp/examples && for i in $(echo examples/s3/*); do go build -o /tmp/examples/$(basename ${i:0:-3}) ${i}; done
-docs:
- @(cd docs; GO111MODULE=on go build validator.go && ./validator -m ../docs/API.md -t checker.go.tpl)
-
functional-test:
@GO111MODULE=on SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minio SECRET_KEY=minio123 ENABLE_HTTPS=1 MINT_MODE=full go run functional_tests.go
diff --git a/vendor/github.com/minio/minio-go/v6/README.md b/vendor/github.com/minio/minio-go/v6/README.md
index 81320a14fb..810a93941c 100644
--- a/vendor/github.com/minio/minio-go/v6/README.md
+++ b/vendor/github.com/minio/minio-go/v6/README.md
@@ -4,11 +4,11 @@ The MinIO Go Client SDK provides simple APIs to access any Amazon S3 compatible
This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the [Go Client API Reference](https://docs.min.io/docs/golang-client-api-reference).
-This document assumes that you have a working [Go development environment](https://docs.min.io/docs/how-to-install-golang).
+This document assumes that you have a working [Go development environment](https://golang.org/doc/install).
## Download from Github
```sh
-go get -u github.com/minio/minio-go
+GO111MODULE=on go get github.com/minio/minio-go/v6
```
## Initialize MinIO Client
diff --git a/vendor/github.com/minio/minio-go/v6/README_zh_CN.md b/vendor/github.com/minio/minio-go/v6/README_zh_CN.md
index bc0c45c0fe..b5ba0c1d02 100644
--- a/vendor/github.com/minio/minio-go/v6/README_zh_CN.md
+++ b/vendor/github.com/minio/minio-go/v6/README_zh_CN.md
@@ -16,7 +16,7 @@ MinIO Go Client SDK提供了简单的API来访问任何与Amazon S3兼容的对
本文我们将学习如何安装MinIO client SDK,连接到MinIO,并提供一下文件上传的示例。对于完整的API以及示例,请参考[Go Client API Reference](https://docs.min.io/docs/golang-client-api-reference)。
-本文假设你已经有 [Go开发环境](https://docs.min.io/docs/how-to-install-golang)。
+本文假设你已经有 [Go开发环境](https://golang.org/doc/install)。
## 从Github下载
```sh
diff --git a/vendor/github.com/minio/minio-go/v6/api-get-object-file.go b/vendor/github.com/minio/minio-go/v6/api-get-object-file.go
index 9c82a7c4f9..0684b2b3ae 100644
--- a/vendor/github.com/minio/minio-go/v6/api-get-object-file.go
+++ b/vendor/github.com/minio/minio-go/v6/api-get-object-file.go
@@ -100,7 +100,7 @@ func (c Client) fGetObjectWithContext(ctx context.Context, bucketName, objectNam
}
// Seek to current position for incoming reader.
- objectReader, objectStat, err := c.getObject(ctx, bucketName, objectName, opts)
+ objectReader, objectStat, _, err := c.getObject(ctx, bucketName, objectName, opts)
if err != nil {
return err
}
diff --git a/vendor/github.com/minio/minio-go/v6/api-get-object.go b/vendor/github.com/minio/minio-go/v6/api-get-object.go
index 5d03ea9bb7..1367828064 100644
--- a/vendor/github.com/minio/minio-go/v6/api-get-object.go
+++ b/vendor/github.com/minio/minio-go/v6/api-get-object.go
@@ -92,7 +92,7 @@ func (c Client) getObjectWithContext(ctx context.Context, bucketName, objectName
} else if req.Offset > 0 {
opts.SetRange(req.Offset, 0)
}
- httpReader, objectInfo, err = c.getObject(ctx, bucketName, objectName, opts)
+ httpReader, objectInfo, _, err = c.getObject(ctx, bucketName, objectName, opts)
if err != nil {
resCh <- getResponse{Error: err}
return
@@ -173,7 +173,7 @@ func (c Client) getObjectWithContext(ctx context.Context, bucketName, objectName
} else if req.Offset > 0 { // Range is set with respect to the offset.
opts.SetRange(req.Offset, 0)
}
- httpReader, objectInfo, err = c.getObject(ctx, bucketName, objectName, opts)
+ httpReader, objectInfo, _, err = c.getObject(ctx, bucketName, objectName, opts)
if err != nil {
resCh <- getResponse{
Error: err,
@@ -596,13 +596,13 @@ func newObject(reqCh chan<- getRequest, resCh <-chan getResponse, doneCh chan<-
//
// For more information about the HTTP Range header.
// go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
-func (c Client) getObject(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) {
+func (c Client) getObject(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, http.Header, error) {
// Validate input arguments.
if err := s3utils.CheckValidBucketName(bucketName); err != nil {
- return nil, ObjectInfo{}, err
+ return nil, ObjectInfo{}, nil, err
}
if err := s3utils.CheckValidObjectName(objectName); err != nil {
- return nil, ObjectInfo{}, err
+ return nil, ObjectInfo{}, nil, err
}
// Execute GET on objectName.
@@ -613,11 +613,11 @@ func (c Client) getObject(ctx context.Context, bucketName, objectName string, op
contentSHA256Hex: emptySHA256Hex,
})
if err != nil {
- return nil, ObjectInfo{}, err
+ return nil, ObjectInfo{}, nil, err
}
if resp != nil {
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent {
- return nil, ObjectInfo{}, httpRespToErrorResponse(resp, bucketName, objectName)
+ return nil, ObjectInfo{}, nil, httpRespToErrorResponse(resp, bucketName, objectName)
}
}
@@ -629,7 +629,7 @@ func (c Client) getObject(ctx context.Context, bucketName, objectName string, op
date, err := time.Parse(http.TimeFormat, resp.Header.Get("Last-Modified"))
if err != nil {
msg := "Last-Modified time format not recognized. " + reportIssue
- return nil, ObjectInfo{}, ErrorResponse{
+ return nil, ObjectInfo{}, nil, ErrorResponse{
Code: "InternalError",
Message: msg,
RequestID: resp.Header.Get("x-amz-request-id"),
@@ -657,5 +657,5 @@ func (c Client) getObject(ctx context.Context, bucketName, objectName string, op
}
// do not close body here, caller will close
- return resp.Body, objectStat, nil
+ return resp.Body, objectStat, resp.Header, nil
}
diff --git a/vendor/github.com/minio/minio-go/v6/api-list.go b/vendor/github.com/minio/minio-go/v6/api-list.go
index b9c0f5d8d0..2bd83fedad 100644
--- a/vendor/github.com/minio/minio-go/v6/api-list.go
+++ b/vendor/github.com/minio/minio-go/v6/api-list.go
@@ -142,10 +142,7 @@ func (c Client) ListObjectsV2(bucketName, objectPrefix string, recursive bool, d
for _, obj := range result.CommonPrefixes {
select {
// Send object prefixes.
- case objectStatCh <- ObjectInfo{
- Key: obj.Prefix,
- Size: 0,
- }:
+ case objectStatCh <- ObjectInfo{Key: obj.Prefix}:
// If receives done from the caller, return here.
case <-doneCh:
return
@@ -192,6 +189,9 @@ func (c Client) listObjectsV2Query(bucketName, objectPrefix, continuationToken s
// Always set list-type in ListObjects V2
urlValues.Set("list-type", "2")
+ // Always set encoding-type in ListObjects V2
+ urlValues.Set("encoding-type", "url")
+
// Set object prefix, prefix value to be set to empty is okay.
urlValues.Set("prefix", objectPrefix)
@@ -248,6 +248,20 @@ func (c Client) listObjectsV2Query(bucketName, objectPrefix, continuationToken s
return listBucketResult, errors.New("Truncated response should have continuation token set")
}
+ for _, obj := range listBucketResult.Contents {
+ obj.Key, err = url.QueryUnescape(obj.Key)
+ if err != nil {
+ return listBucketResult, err
+ }
+ }
+
+ for _, obj := range listBucketResult.CommonPrefixes {
+ obj.Prefix, err = url.QueryUnescape(obj.Prefix)
+ if err != nil {
+ return listBucketResult, err
+ }
+ }
+
// Success.
return listBucketResult, nil
}
@@ -331,12 +345,9 @@ func (c Client) ListObjects(bucketName, objectPrefix string, recursive bool, don
// Send all common prefixes if any.
// NOTE: prefixes are only present if the request is delimited.
for _, obj := range result.CommonPrefixes {
- object := ObjectInfo{}
- object.Key = obj.Prefix
- object.Size = 0
select {
// Send object prefixes.
- case objectStatCh <- object:
+ case objectStatCh <- ObjectInfo{Key: obj.Prefix}:
// If receives done from the caller, return here.
case <-doneCh:
return
@@ -397,6 +408,9 @@ func (c Client) listObjectsQuery(bucketName, objectPrefix, objectMarker, delimit
// Set max keys.
urlValues.Set("max-keys", fmt.Sprintf("%d", maxkeys))
+ // Always set encoding-type
+ urlValues.Set("encoding-type", "url")
+
// Execute GET on bucket to list objects.
resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{
bucketName: bucketName,
@@ -418,6 +432,28 @@ func (c Client) listObjectsQuery(bucketName, objectPrefix, objectMarker, delimit
if err != nil {
return listBucketResult, err
}
+
+ for _, obj := range listBucketResult.Contents {
+ obj.Key, err = url.QueryUnescape(obj.Key)
+ if err != nil {
+ return listBucketResult, err
+ }
+ }
+
+ for _, obj := range listBucketResult.CommonPrefixes {
+ obj.Prefix, err = url.QueryUnescape(obj.Prefix)
+ if err != nil {
+ return listBucketResult, err
+ }
+ }
+
+ if listBucketResult.NextMarker != "" {
+ listBucketResult.NextMarker, err = url.QueryUnescape(listBucketResult.NextMarker)
+ if err != nil {
+ return listBucketResult, err
+ }
+ }
+
return listBucketResult, nil
}
@@ -488,9 +524,9 @@ func (c Client) listIncompleteUploads(bucketName, objectPrefix string, recursive
}
return
}
- // Save objectMarker and uploadIDMarker for next request.
objectMarker = result.NextKeyMarker
uploadIDMarker = result.NextUploadIDMarker
+
// Send all multipart uploads.
for _, obj := range result.Uploads {
// Calculate total size of the uploaded parts if 'aggregateSize' is enabled.
@@ -515,12 +551,9 @@ func (c Client) listIncompleteUploads(bucketName, objectPrefix string, recursive
// Send all common prefixes if any.
// NOTE: prefixes are only present if the request is delimited.
for _, obj := range result.CommonPrefixes {
- object := ObjectMultipartInfo{}
- object.Key = obj.Prefix
- object.Size = 0
select {
// Send delimited prefixes here.
- case objectMultipartStatCh <- object:
+ case objectMultipartStatCh <- ObjectMultipartInfo{Key: obj.Prefix, Size: 0}:
// If done channel return here.
case <-doneCh:
return
@@ -567,6 +600,9 @@ func (c Client) listMultipartUploadsQuery(bucketName, keyMarker, uploadIDMarker,
// Set delimiter, delimiter value to be set to empty is okay.
urlValues.Set("delimiter", delimiter)
+ // Always set encoding-type
+ urlValues.Set("encoding-type", "url")
+
// maxUploads should be 1000 or less.
if maxUploads == 0 || maxUploads > 1000 {
maxUploads = 1000
@@ -595,6 +631,31 @@ func (c Client) listMultipartUploadsQuery(bucketName, keyMarker, uploadIDMarker,
if err != nil {
return listMultipartUploadsResult, err
}
+
+ listMultipartUploadsResult.NextKeyMarker, err = url.QueryUnescape(listMultipartUploadsResult.NextKeyMarker)
+ if err != nil {
+ return listMultipartUploadsResult, err
+ }
+
+ listMultipartUploadsResult.NextUploadIDMarker, err = url.QueryUnescape(listMultipartUploadsResult.NextUploadIDMarker)
+ if err != nil {
+ return listMultipartUploadsResult, err
+ }
+
+ for _, obj := range listMultipartUploadsResult.Uploads {
+ obj.Key, err = url.QueryUnescape(obj.Key)
+ if err != nil {
+ return listMultipartUploadsResult, err
+ }
+ }
+
+ for _, obj := range listMultipartUploadsResult.CommonPrefixes {
+ obj.Prefix, err = url.QueryUnescape(obj.Prefix)
+ if err != nil {
+ return listMultipartUploadsResult, err
+ }
+ }
+
return listMultipartUploadsResult, nil
}
diff --git a/vendor/github.com/minio/minio-go/v6/api-select.go b/vendor/github.com/minio/minio-go/v6/api-select.go
index b5ce131121..7ecd953802 100644
--- a/vendor/github.com/minio/minio-go/v6/api-select.go
+++ b/vendor/github.com/minio/minio-go/v6/api-select.go
@@ -251,6 +251,12 @@ func (c Client) SelectObjectContent(ctx context.Context, bucketName, objectName
return nil, err
}
+ return NewSelectResults(resp, bucketName)
+}
+
+// NewSelectResults creates a Select Result parser that parses the response
+// and returns a Reader that will return parsed and assembled select output.
+func NewSelectResults(resp *http.Response, bucketName string) (*SelectResults, error) {
if resp.StatusCode != http.StatusOK {
return nil, httpRespToErrorResponse(resp, bucketName, "")
}
diff --git a/vendor/github.com/minio/minio-go/v6/api.go b/vendor/github.com/minio/minio-go/v6/api.go
index 8e40219881..1daf055f23 100644
--- a/vendor/github.com/minio/minio-go/v6/api.go
+++ b/vendor/github.com/minio/minio-go/v6/api.go
@@ -21,7 +21,6 @@ import (
"bytes"
"context"
"crypto/md5"
- "crypto/sha256"
"errors"
"fmt"
"hash"
@@ -39,6 +38,8 @@ import (
"sync"
"time"
+ "github.com/minio/sha256-simd"
+
"golang.org/x/net/publicsuffix"
"github.com/minio/minio-go/v6/pkg/credentials"
@@ -103,7 +104,7 @@ type Options struct {
// Global constants.
const (
libraryName = "minio-go"
- libraryVersion = "v6.0.34"
+ libraryVersion = "v6.0.38"
)
// User Agent should always following the below style.
diff --git a/vendor/github.com/minio/minio-go/v6/core.go b/vendor/github.com/minio/minio-go/v6/core.go
index 4f57193435..9dae1a3bad 100644
--- a/vendor/github.com/minio/minio-go/v6/core.go
+++ b/vendor/github.com/minio/minio-go/v6/core.go
@@ -20,6 +20,7 @@ package minio
import (
"context"
"io"
+ "net/http"
"strings"
"github.com/minio/minio-go/v6/pkg/encrypt"
@@ -176,14 +177,14 @@ func (c Core) PutBucketPolicy(bucket, bucketPolicy string) error {
// GetObjectWithContext is a lower level API implemented to support reading
// partial objects and also downloading objects with special conditions
// matching etag, modtime etc.
-func (c Core) GetObjectWithContext(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) {
+func (c Core) GetObjectWithContext(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, http.Header, error) {
return c.getObject(ctx, bucketName, objectName, opts)
}
// GetObject is a lower level API implemented to support reading
// partial objects and also downloading objects with special conditions
// matching etag, modtime etc.
-func (c Core) GetObject(bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) {
+func (c Core) GetObject(bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, http.Header, error) {
return c.GetObjectWithContext(context.Background(), bucketName, objectName, opts)
}
diff --git a/vendor/github.com/minio/minio-go/v6/functional_tests.go b/vendor/github.com/minio/minio-go/v6/functional_tests.go
deleted file mode 100644
index 463552ce12..0000000000
--- a/vendor/github.com/minio/minio-go/v6/functional_tests.go
+++ /dev/null
@@ -1,10196 +0,0 @@
-// +build ignore
-
-/*
- * MinIO Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2015-2017 MinIO, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package main
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "math/rand"
- "mime/multipart"
- "net/http"
- "net/url"
- "os"
- "path/filepath"
- "reflect"
- "runtime"
- "strconv"
- "strings"
- "time"
-
- humanize "github.com/dustin/go-humanize"
- log "github.com/sirupsen/logrus"
-
- "github.com/minio/minio-go/v6"
- "github.com/minio/minio-go/v6/pkg/encrypt"
-)
-
-const letterBytes = "abcdefghijklmnopqrstuvwxyz01234569"
-const (
- letterIdxBits = 6 // 6 bits to represent a letter index
- letterIdxMask = 1<= 0; {
- if remain == 0 {
- cache, remain = src.Int63(), letterIdxMax
- }
- if idx := int(cache & letterIdxMask); idx < len(letterBytes) {
- b[i] = letterBytes[idx]
- i--
- }
- cache >>= letterIdxBits
- remain--
- }
- return prefix + string(b[0:30-len(prefix)])
-}
-
-var dataFileMap = map[string]int{
- "datafile-1-b": 1,
- "datafile-10-kB": 10 * humanize.KiByte,
- "datafile-33-kB": 33 * humanize.KiByte,
- "datafile-100-kB": 100 * humanize.KiByte,
- "datafile-1.03-MB": 1056 * humanize.KiByte,
- "datafile-1-MB": 1 * humanize.MiByte,
- "datafile-5-MB": 5 * humanize.MiByte,
- "datafile-6-MB": 6 * humanize.MiByte,
- "datafile-11-MB": 11 * humanize.MiByte,
- "datafile-129-MB": 129 * humanize.MiByte,
-}
-
-func isFullMode() bool {
- return os.Getenv("MINT_MODE") == "full"
-}
-
-func getFuncName() string {
- pc, _, _, _ := runtime.Caller(1)
- return strings.TrimPrefix(runtime.FuncForPC(pc).Name(), "main.")
-}
-
-// Tests bucket re-create errors.
-func testMakeBucketError() {
- region := "eu-central-1"
-
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "MakeBucket(bucketName, region)"
- // initialize logging params
- args := map[string]interface{}{
- "bucketName": "",
- "region": region,
- }
-
- // skipping region functional tests for non s3 runs
- if os.Getenv(serverEndpoint) != "s3.amazonaws.com" {
- ignoredLog(testName, function, args, startTime, "Skipped region functional tests for non s3 runs").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket in 'eu-central-1'.
- if err = c.MakeBucket(bucketName, region); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket Failed", err)
- return
- }
- if err = c.MakeBucket(bucketName, region); err == nil {
- logError(testName, function, args, startTime, "", "Bucket already exists", err)
- return
- }
- // Verify valid error response from server.
- if minio.ToErrorResponse(err).Code != "BucketAlreadyExists" &&
- minio.ToErrorResponse(err).Code != "BucketAlreadyOwnedByYou" {
- logError(testName, function, args, startTime, "", "Invalid error returned by server", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testMetadataSizeLimit() {
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, objectSize, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "opts.UserMetadata": "",
- }
- rand.Seed(startTime.Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client creation failed", err)
- return
- }
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "Make bucket failed", err)
- return
- }
-
- const HeaderSizeLimit = 8 * 1024
- const UserMetadataLimit = 2 * 1024
-
- // Meta-data greater than the 2 KB limit of AWS - PUT calls with this meta-data should fail
- metadata := make(map[string]string)
- metadata["X-Amz-Meta-Mint-Test"] = string(bytes.Repeat([]byte("m"), 1+UserMetadataLimit-len("X-Amz-Meta-Mint-Test")))
- args["metadata"] = fmt.Sprint(metadata)
-
- _, err = c.PutObject(bucketName, objectName, bytes.NewReader(nil), 0, minio.PutObjectOptions{UserMetadata: metadata})
- if err == nil {
- logError(testName, function, args, startTime, "", "Created object with user-defined metadata exceeding metadata size limits", nil)
- return
- }
-
- // Meta-data (headers) greater than the 8 KB limit of AWS - PUT calls with this meta-data should fail
- metadata = make(map[string]string)
- metadata["X-Amz-Mint-Test"] = string(bytes.Repeat([]byte("m"), 1+HeaderSizeLimit-len("X-Amz-Mint-Test")))
- args["metadata"] = fmt.Sprint(metadata)
- _, err = c.PutObject(bucketName, objectName, bytes.NewReader(nil), 0, minio.PutObjectOptions{UserMetadata: metadata})
- if err == nil {
- logError(testName, function, args, startTime, "", "Created object with headers exceeding header size limits", nil)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests various bucket supported formats.
-func testMakeBucketRegions() {
- region := "eu-central-1"
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "MakeBucket(bucketName, region)"
- // initialize logging params
- args := map[string]interface{}{
- "bucketName": "",
- "region": region,
- }
-
- // skipping region functional tests for non s3 runs
- if os.Getenv(serverEndpoint) != "s3.amazonaws.com" {
- ignoredLog(testName, function, args, startTime, "Skipped region functional tests for non s3 runs").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket in 'eu-central-1'.
- if err = c.MakeBucket(bucketName, region); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- // Make a new bucket with '.' in its name, in 'us-west-2'. This
- // request is internally staged into a path style instead of
- // virtual host style.
- region = "us-west-2"
- args["region"] = region
- if err = c.MakeBucket(bucketName+".withperiod", region); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName+".withperiod", c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test PutObject using a large data to trigger multipart readat
-func testPutObjectReadAt() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "opts": "objectContentType",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "Make bucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Object content type
- objectContentType := "binary/octet-stream"
- args["objectContentType"] = objectContentType
-
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: objectContentType})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes returned by PutObject does not match, expected "+string(bufSize)+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "Get Object failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat Object failed", err)
- return
- }
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Number of bytes in stat does not match, expected %d got %d", bufSize, st.Size), err)
- return
- }
- if st.ContentType != objectContentType && st.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "Content types don't match", err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "Object Close failed", err)
- return
- }
- if err := r.Close(); err == nil {
- logError(testName, function, args, startTime, "", "Object is already closed, didn't return error on Close", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test PutObject using a large data to trigger multipart readat
-func testPutObjectWithMetadata() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader,size, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "opts": "minio.PutObjectOptions{UserMetadata: metadata, Progress: progress}",
- }
-
- if !isFullMode() {
- ignoredLog(testName, function, args, startTime, "Skipping functional tests for short/quick runs").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "Make bucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Object custom metadata
- customContentType := "custom/contenttype"
-
- args["metadata"] = map[string][]string{
- "Content-Type": {customContentType},
- "X-Amz-Meta-CustomKey": {"extra spaces in value"},
- }
-
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{
- ContentType: customContentType})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes returned by PutObject does not match, expected "+string(bufSize)+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes returned by PutObject does not match GetObject, expected "+string(bufSize)+" got "+string(st.Size), err)
- return
- }
- if st.ContentType != customContentType && st.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "ContentType does not match, expected "+customContentType+" got "+st.ContentType, err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "Object Close failed", err)
- return
- }
- if err := r.Close(); err == nil {
- logError(testName, function, args, startTime, "", "Object already closed, should respond with error", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testPutObjectWithContentLanguage() {
- // initialize logging params
- objectName := "test-object"
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, size, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": objectName,
- "size": -1,
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- data := bytes.Repeat([]byte("a"), int(0))
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(data), int64(0), minio.PutObjectOptions{
- ContentLanguage: "en",
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != 0 {
- logError(testName, function, args, startTime, "", "Expected upload object '0' doesn't match with PutObject return value", err)
- return
- }
-
- objInfo, err := c.StatObject(bucketName, objectName, minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
-
- if objInfo.Metadata.Get("Content-Language") != "en" {
- logError(testName, function, args, startTime, "", "Expected content-language 'en' doesn't match with StatObject return value", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test put object with streaming signature.
-func testPutObjectStreaming() {
- // initialize logging params
- objectName := "test-object"
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader,size,opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": objectName,
- "size": -1,
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload an object.
- sizes := []int64{0, 64*1024 - 1, 64 * 1024}
-
- for _, size := range sizes {
- data := bytes.Repeat([]byte("a"), int(size))
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(data), int64(size), minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectStreaming failed", err)
- return
- }
-
- if n != size {
- logError(testName, function, args, startTime, "", "Expected upload object size doesn't match with PutObjectStreaming return value", err)
- return
- }
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test get object seeker from the end, using whence set to '2'.
-func testGetObjectSeekEnd() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes read does not match, expected "+string(int64(bufSize))+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes read does not match, expected "+string(int64(bufSize))+" got "+string(st.Size), err)
- return
- }
-
- pos, err := r.Seek(-100, 2)
- if err != nil {
- logError(testName, function, args, startTime, "", "Object Seek failed", err)
- return
- }
- if pos != st.Size-100 {
- logError(testName, function, args, startTime, "", "Incorrect position", err)
- return
- }
- buf2 := make([]byte, 100)
- m, err := io.ReadFull(r, buf2)
- if err != nil {
- logError(testName, function, args, startTime, "", "Error reading through io.ReadFull", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "Number of bytes dont match, expected "+string(len(buf2))+" got "+string(m), err)
- return
- }
- hexBuf1 := fmt.Sprintf("%02x", buf[len(buf)-100:])
- hexBuf2 := fmt.Sprintf("%02x", buf2[:m])
- if hexBuf1 != hexBuf2 {
- logError(testName, function, args, startTime, "", "Values at same index dont match", err)
- return
- }
- pos, err = r.Seek(-100, 2)
- if err != nil {
- logError(testName, function, args, startTime, "", "Object Seek failed", err)
- return
- }
- if pos != st.Size-100 {
- logError(testName, function, args, startTime, "", "Incorrect position", err)
- return
- }
- if err = r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "ObjectClose failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test get object reader to not throw error on being closed twice.
-func testGetObjectClosedTwice() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "PutObject response doesn't match sent bytes, expected "+string(int64(bufSize))+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+" got "+string(st.Size), err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "Object Close failed", err)
- return
- }
- if err := r.Close(); err == nil {
- logError(testName, function, args, startTime, "", "Already closed object. No error returned", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test RemoveObjectsWithContext request context cancels after timeout
-func testRemoveObjectsWithContext() {
- // Initialize logging params.
- startTime := time.Now()
- testName := getFuncName()
- function := "RemoveObjectsWithContext(ctx, bucketName, objectsCh)"
- args := map[string]interface{}{
- "bucketName": "",
- }
-
- // Seed random based on current tie.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
- // Enable tracing, write to stdout.
- // c.TraceOn(os.Stderr)
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
-
- // Generate put data.
- r := bytes.NewReader(bytes.Repeat([]byte("a"), 8))
-
- // Multi remove of 20 objects.
- nrObjects := 20
- objectsCh := make(chan string)
- go func() {
- defer close(objectsCh)
- for i := 0; i < nrObjects; i++ {
- objectName := "sample" + strconv.Itoa(i) + ".txt"
- _, err = c.PutObject(bucketName, objectName, r, 8, minio.PutObjectOptions{ContentType: "application/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- continue
- }
- objectsCh <- objectName
- }
- }()
- // Set context to cancel in 1 nanosecond.
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- // Call RemoveObjectsWithContext API with short timeout.
- errorCh := c.RemoveObjectsWithContext(ctx, bucketName, objectsCh)
- // Check for error.
- select {
- case r := <-errorCh:
- if r.Err == nil {
- logError(testName, function, args, startTime, "", "RemoveObjectsWithContext should fail on short timeout", err)
- return
- }
- }
- // Set context with longer timeout.
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- args["ctx"] = ctx
- defer cancel()
- // Perform RemoveObjectsWithContext with the longer timeout. Expect the removals to succeed.
- errorCh = c.RemoveObjectsWithContext(ctx, bucketName, objectsCh)
- select {
- case r, more := <-errorCh:
- if more || r.Err != nil {
- logError(testName, function, args, startTime, "", "Unexpected error", r.Err)
- return
- }
- }
-
- // Delete all objects and buckets.
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test removing multiple objects with Remove API
-func testRemoveMultipleObjects() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "RemoveObjects(bucketName, objectsCh)"
- args := map[string]interface{}{
- "bucketName": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
-
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Enable tracing, write to stdout.
- // c.TraceOn(os.Stderr)
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- r := bytes.NewReader(bytes.Repeat([]byte("a"), 8))
-
- // Multi remove of 1100 objects
- nrObjects := 200
-
- objectsCh := make(chan string)
-
- go func() {
- defer close(objectsCh)
- // Upload objects and send them to objectsCh
- for i := 0; i < nrObjects; i++ {
- objectName := "sample" + strconv.Itoa(i) + ".txt"
- _, err = c.PutObject(bucketName, objectName, r, 8, minio.PutObjectOptions{ContentType: "application/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- continue
- }
- objectsCh <- objectName
- }
- }()
-
- // Call RemoveObjects API
- errorCh := c.RemoveObjects(bucketName, objectsCh)
-
- // Check if errorCh doesn't receive any error
- select {
- case r, more := <-errorCh:
- if more {
- logError(testName, function, args, startTime, "", "Unexpected error", r.Err)
- return
- }
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests FPutObject of a big file to trigger multipart
-func testFPutObjectMultipart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutObject(bucketName, objectName, fileName, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload 4 parts to utilize all 3 'workers' in multipart and still have a part to upload.
- var fileName = getMintDataDirFilePath("datafile-129-MB")
- if fileName == "" {
- // Make a temp file with minPartSize bytes of data.
- file, err := ioutil.TempFile(os.TempDir(), "FPutObjectTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile creation failed", err)
- return
- }
- // Upload 2 parts to utilize all 3 'workers' in multipart and still have a part to upload.
- if _, err = io.Copy(file, getDataReader("datafile-129-MB")); err != nil {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- if err = file.Close(); err != nil {
- logError(testName, function, args, startTime, "", "File Close failed", err)
- return
- }
- fileName = file.Name()
- args["fileName"] = fileName
- }
- totalSize := dataFileMap["datafile-129-MB"]
- // Set base object name
- objectName := bucketName + "FPutObject" + "-standard"
- args["objectName"] = objectName
-
- objectContentType := "testapplication/octet-stream"
- args["objectContentType"] = objectContentType
-
- // Perform standard FPutObject with contentType provided (Expecting application/octet-stream)
- n, err := c.FPutObject(bucketName, objectName, fileName, minio.PutObjectOptions{ContentType: objectContentType})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
-
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- objInfo, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Unexpected error", err)
- return
- }
- if objInfo.Size != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(totalSize))+" got "+string(objInfo.Size), err)
- return
- }
- if objInfo.ContentType != objectContentType && objInfo.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "ContentType doesn't match", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests FPutObject with null contentType (default = application/octet-stream)
-func testFPutObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutObject(bucketName, objectName, fileName, opts)"
-
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- location := "us-east-1"
-
- // Make a new bucket.
- args["bucketName"] = bucketName
- args["location"] = location
- function = "MakeBucket()bucketName, location"
- err = c.MakeBucket(bucketName, location)
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload 3 parts worth of data to use all 3 of multiparts 'workers' and have an extra part.
- // Use different data in part for multipart tests to check parts are uploaded in correct order.
- var fName = getMintDataDirFilePath("datafile-129-MB")
- if fName == "" {
- // Make a temp file with minPartSize bytes of data.
- file, err := ioutil.TempFile(os.TempDir(), "FPutObjectTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile creation failed", err)
- return
- }
-
- // Upload 3 parts to utilize all 3 'workers' in multipart and still have a part to upload.
- if _, err = io.Copy(file, getDataReader("datafile-129-MB")); err != nil {
- logError(testName, function, args, startTime, "", "File copy failed", err)
- return
- }
- // Close the file pro-actively for windows.
- if err = file.Close(); err != nil {
- logError(testName, function, args, startTime, "", "File close failed", err)
- return
- }
- defer os.Remove(file.Name())
- fName = file.Name()
- }
- totalSize := dataFileMap["datafile-129-MB"]
-
- // Set base object name
- function = "FPutObject(bucketName, objectName, fileName, opts)"
- objectName := bucketName + "FPutObject"
- args["objectName"] = objectName + "-standard"
- args["fileName"] = fName
- args["opts"] = minio.PutObjectOptions{ContentType: "application/octet-stream"}
-
- // Perform standard FPutObject with contentType provided (Expecting application/octet-stream)
- n, err := c.FPutObject(bucketName, objectName+"-standard", fName, minio.PutObjectOptions{ContentType: "application/octet-stream"})
-
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(totalSize)+", got "+string(n), err)
- return
- }
-
- // Perform FPutObject with no contentType provided (Expecting application/octet-stream)
- args["objectName"] = objectName + "-Octet"
- n, err = c.FPutObject(bucketName, objectName+"-Octet", fName, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "File close failed", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(totalSize)+", got "+string(n), err)
- return
- }
- srcFile, err := os.Open(fName)
- if err != nil {
- logError(testName, function, args, startTime, "", "File open failed", err)
- return
- }
- defer srcFile.Close()
- // Add extension to temp file name
- tmpFile, err := os.Create(fName + ".gtar")
- if err != nil {
- logError(testName, function, args, startTime, "", "File create failed", err)
- return
- }
- defer tmpFile.Close()
- _, err = io.Copy(tmpFile, srcFile)
- if err != nil {
- logError(testName, function, args, startTime, "", "File copy failed", err)
- return
- }
-
- // Perform FPutObject with no contentType provided (Expecting application/x-gtar)
- args["objectName"] = objectName + "-GTar"
- args["opts"] = minio.PutObjectOptions{}
- n, err = c.FPutObject(bucketName, objectName+"-GTar", fName+".gtar", minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(totalSize)+", got "+string(n), err)
- return
- }
-
- // Check headers
- function = "StatObject(bucketName, objectName, opts)"
- args["objectName"] = objectName + "-standard"
- rStandard, err := c.StatObject(bucketName, objectName+"-standard", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rStandard.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "ContentType does not match, expected application/octet-stream, got "+rStandard.ContentType, err)
- return
- }
-
- function = "StatObject(bucketName, objectName, opts)"
- args["objectName"] = objectName + "-Octet"
- rOctet, err := c.StatObject(bucketName, objectName+"-Octet", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rOctet.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "ContentType does not match, expected application/octet-stream, got "+rOctet.ContentType, err)
- return
- }
-
- function = "StatObject(bucketName, objectName, opts)"
- args["objectName"] = objectName + "-GTar"
- rGTar, err := c.StatObject(bucketName, objectName+"-GTar", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rGTar.ContentType != "application/x-gtar" && rGTar.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "ContentType does not match, expected application/x-gtar or application/octet-stream, got "+rGTar.ContentType, err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- if err = os.Remove(fName + ".gtar"); err != nil {
- logError(testName, function, args, startTime, "", "File remove failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests FPutObjectWithContext request context cancels after timeout
-func testFPutObjectWithContext() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutObject(bucketName, objectName, fileName, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- "opts": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload 1 parts worth of data to use multipart upload.
- // Use different data in part for multipart tests to check parts are uploaded in correct order.
- var fName = getMintDataDirFilePath("datafile-1-MB")
- if fName == "" {
- // Make a temp file with 1 MiB bytes of data.
- file, err := ioutil.TempFile(os.TempDir(), "FPutObjectWithContextTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile creation failed", err)
- return
- }
-
- // Upload 1 parts to trigger multipart upload
- if _, err = io.Copy(file, getDataReader("datafile-1-MB")); err != nil {
- logError(testName, function, args, startTime, "", "File copy failed", err)
- return
- }
- // Close the file pro-actively for windows.
- if err = file.Close(); err != nil {
- logError(testName, function, args, startTime, "", "File close failed", err)
- return
- }
- defer os.Remove(file.Name())
- fName = file.Name()
- }
- totalSize := dataFileMap["datafile-1-MB"]
-
- // Set base object name
- objectName := bucketName + "FPutObjectWithContext"
- args["objectName"] = objectName
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- // Perform standard FPutObjectWithContext with contentType provided (Expecting application/octet-stream)
- _, err = c.FPutObjectWithContext(ctx, bucketName, objectName+"-Shorttimeout", fName, minio.PutObjectOptions{ContentType: "application/octet-stream"})
- if err == nil {
- logError(testName, function, args, startTime, "", "FPutObjectWithContext should fail on short timeout", err)
- return
- }
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- defer cancel()
- // Perform FPutObjectWithContext with a long timeout. Expect the put object to succeed
- n, err := c.FPutObjectWithContext(ctx, bucketName, objectName+"-Longtimeout", fName, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObjectWithContext shouldn't fail on long timeout", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(totalSize)+", got "+string(n), err)
- return
- }
-
- _, err = c.StatObject(bucketName, objectName+"-Longtimeout", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Tests FPutObjectWithContext request context cancels after timeout
-func testFPutObjectWithContextV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutObjectWithContext(ctx, bucketName, objectName, fileName, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "opts": "minio.PutObjectOptions{ContentType:objectContentType}",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload 1 parts worth of data to use multipart upload.
- // Use different data in part for multipart tests to check parts are uploaded in correct order.
- var fName = getMintDataDirFilePath("datafile-1-MB")
- if fName == "" {
- // Make a temp file with 1 MiB bytes of data.
- file, err := ioutil.TempFile(os.TempDir(), "FPutObjectWithContextTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "Temp file creation failed", err)
- return
- }
-
- // Upload 1 parts to trigger multipart upload
- if _, err = io.Copy(file, getDataReader("datafile-1-MB")); err != nil {
- logError(testName, function, args, startTime, "", "File copy failed", err)
- return
- }
-
- // Close the file pro-actively for windows.
- if err = file.Close(); err != nil {
- logError(testName, function, args, startTime, "", "File close failed", err)
- return
- }
- defer os.Remove(file.Name())
- fName = file.Name()
- }
- totalSize := dataFileMap["datafile-1-MB"]
-
- // Set base object name
- objectName := bucketName + "FPutObjectWithContext"
- args["objectName"] = objectName
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- // Perform standard FPutObjectWithContext with contentType provided (Expecting application/octet-stream)
- _, err = c.FPutObjectWithContext(ctx, bucketName, objectName+"-Shorttimeout", fName, minio.PutObjectOptions{ContentType: "application/octet-stream"})
- if err == nil {
- logError(testName, function, args, startTime, "", "FPutObjectWithContext should fail on short timeout", err)
- return
- }
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- defer cancel()
- // Perform FPutObjectWithContext with a long timeout. Expect the put object to succeed
- n, err := c.FPutObjectWithContext(ctx, bucketName, objectName+"-Longtimeout", fName, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObjectWithContext shouldn't fail on longer timeout", err)
- return
- }
- if n != int64(totalSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match:wanted"+string(totalSize)+" got "+string(n), err)
- return
- }
-
- _, err = c.StatObject(bucketName, objectName+"-Longtimeout", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test validates putObject with context to see if request cancellation is honored.
-func testPutObjectWithContext() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObjectWithContext(ctx, bucketName, objectName, fileName, opts)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- "opts": "",
- }
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Make a new bucket.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket call failed", err)
- return
- }
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
- objectName := fmt.Sprintf("test-file-%v", rand.Uint32())
- args["objectName"] = objectName
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- args["opts"] = minio.PutObjectOptions{ContentType: "binary/octet-stream"}
- defer cancel()
-
- _, err = c.PutObjectWithContext(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err == nil {
- logError(testName, function, args, startTime, "", "PutObjectWithContext should fail on short timeout", err)
- return
- }
-
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- args["ctx"] = ctx
-
- defer cancel()
- reader = getDataReader("datafile-33-kB")
- defer reader.Close()
- _, err = c.PutObjectWithContext(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithContext with long timeout failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Tests get object ReaderSeeker interface methods.
-func testGetObjectReadSeekFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- defer func() {
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- }()
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat object failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- // This following function helps us to compare data from the reader after seek
- // with the data from the original buffer
- cmpData := func(r io.Reader, start, end int) {
- if end-start == 0 {
- return
- }
- buffer := bytes.NewBuffer([]byte{})
- if _, err := io.CopyN(buffer, r, int64(bufSize)); err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "CopyN failed", err)
- return
- }
- }
- if !bytes.Equal(buf[start:end], buffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Incorrect read bytes v/s original buffer", err)
- return
- }
- }
-
- // Generic seek error for errors other than io.EOF
- seekErr := errors.New("seek error")
-
- testCases := []struct {
- offset int64
- whence int
- pos int64
- err error
- shouldCmp bool
- start int
- end int
- }{
- // Start from offset 0, fetch data and compare
- {0, 0, 0, nil, true, 0, 0},
- // Start from offset 2048, fetch data and compare
- {2048, 0, 2048, nil, true, 2048, bufSize},
- // Start from offset larger than possible
- {int64(bufSize) + 1024, 0, 0, seekErr, false, 0, 0},
- // Move to offset 0 without comparing
- {0, 0, 0, nil, false, 0, 0},
- // Move one step forward and compare
- {1, 1, 1, nil, true, 1, bufSize},
- // Move larger than possible
- {int64(bufSize), 1, 0, seekErr, false, 0, 0},
- // Provide negative offset with CUR_SEEK
- {int64(-1), 1, 0, seekErr, false, 0, 0},
- // Test with whence SEEK_END and with positive offset
- {1024, 2, int64(bufSize) - 1024, io.EOF, true, 0, 0},
- // Test with whence SEEK_END and with negative offset
- {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize},
- // Test with whence SEEK_END and with large negative offset
- {-int64(bufSize) * 2, 2, 0, seekErr, true, 0, 0},
- }
-
- for i, testCase := range testCases {
- // Perform seek operation
- n, err := r.Seek(testCase.offset, testCase.whence)
- // We expect an error
- if testCase.err == seekErr && err == nil {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", unexpected err value: expected: "+testCase.err.Error()+", found: "+err.Error(), err)
- return
- }
- // We expect a specific error
- if testCase.err != seekErr && testCase.err != err {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", unexpected err value: expected: "+testCase.err.Error()+", found: "+err.Error(), err)
- return
- }
- // If we expect an error go to the next loop
- if testCase.err != nil {
- continue
- }
- // Check the returned seek pos
- if n != testCase.pos {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", number of bytes seeked does not match, expected "+string(testCase.pos)+", got "+string(n), err)
- return
- }
- // Compare only if shouldCmp is activated
- if testCase.shouldCmp {
- cmpData(r, testCase.start, testCase.end)
- }
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests get object ReaderAt interface methods.
-func testGetObjectReadAtFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- offset := int64(2048)
-
- // read directly
- buf1 := make([]byte, 512)
- buf2 := make([]byte, 512)
- buf3 := make([]byte, 512)
- buf4 := make([]byte, 512)
-
- // Test readAt before stat is called such that objectInfo doesn't change.
- m, err := r.ReadAt(buf1, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf1) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf1))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf1, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- m, err = r.ReadAt(buf2, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf2))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf2, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
-
- offset += 512
- m, err = r.ReadAt(buf3, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf3) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf3))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf3, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf4, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf4) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf4))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf4, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
-
- buf5 := make([]byte, n)
- // Read the whole object.
- m, err = r.ReadAt(buf5, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- if m != len(buf5) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf5))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf, buf5) {
- logError(testName, function, args, startTime, "", "Incorrect data read in GetObject, than what was previously uploaded", err)
- return
- }
-
- buf6 := make([]byte, n+1)
- // Read the whole object and beyond.
- _, err = r.ReadAt(buf6, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Reproduces issue https://github.com/minio/minio-go/issues/1137
-func testGetObjectReadAtWhenEOFWasReached() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // read directly
- buf1 := make([]byte, n)
- buf2 := make([]byte, 512)
-
- m, err := r.Read(buf1)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "Read failed", err)
- return
- }
- }
- if m != len(buf1) {
- logError(testName, function, args, startTime, "", "Read read shorter bytes before reaching EOF, expected "+string(len(buf1))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf1, buf) {
- logError(testName, function, args, startTime, "", "Incorrect count of Read data", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- m, err = r.ReadAt(buf2, 512)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf2))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf2, buf[512:1024]) {
- logError(testName, function, args, startTime, "", "Incorrect count of ReadAt data", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test Presigned Post Policy
-func testPresignedPostPolicy() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PresignedPostPolicy(policy)"
- args := map[string]interface{}{
- "policy": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- // Azure requires the key to not start with a number
- metadataKey := randString(60, rand.NewSource(time.Now().UnixNano()), "user")
- metadataValue := randString(60, rand.NewSource(time.Now().UnixNano()), "")
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+" got "+string(n), err)
- return
- }
-
- policy := minio.NewPostPolicy()
-
- if err := policy.SetBucket(""); err == nil {
- logError(testName, function, args, startTime, "", "SetBucket did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetKey(""); err == nil {
- logError(testName, function, args, startTime, "", "SetKey did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetKeyStartsWith(""); err == nil {
- logError(testName, function, args, startTime, "", "SetKeyStartsWith did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetExpires(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC)); err == nil {
- logError(testName, function, args, startTime, "", "SetExpires did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetContentType(""); err == nil {
- logError(testName, function, args, startTime, "", "SetContentType did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetContentLengthRange(1024*1024, 1024); err == nil {
- logError(testName, function, args, startTime, "", "SetContentLengthRange did not fail for invalid conditions", err)
- return
- }
- if err := policy.SetUserMetadata("", ""); err == nil {
- logError(testName, function, args, startTime, "", "SetUserMetadata did not fail for invalid conditions", err)
- return
- }
-
- policy.SetBucket(bucketName)
- policy.SetKey(objectName)
- policy.SetExpires(time.Now().UTC().AddDate(0, 0, 10)) // expires in 10 days
- policy.SetContentType("binary/octet-stream")
- policy.SetContentLengthRange(10, 1024*1024)
- policy.SetUserMetadata(metadataKey, metadataValue)
- args["policy"] = policy.String()
-
- presignedPostPolicyURL, formData, err := c.PresignedPostPolicy(policy)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedPostPolicy failed", err)
- return
- }
-
- var formBuf bytes.Buffer
- writer := multipart.NewWriter(&formBuf)
- for k, v := range formData {
- writer.WriteField(k, v)
- }
-
- // Get a 33KB file to upload and test if set post policy works
- var filePath = getMintDataDirFilePath("datafile-33-kB")
- if filePath == "" {
- // Make a temp file with 33 KB data.
- file, err := ioutil.TempFile(os.TempDir(), "PresignedPostPolicyTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile creation failed", err)
- return
- }
- if _, err = io.Copy(file, getDataReader("datafile-33-kB")); err != nil {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- if err = file.Close(); err != nil {
- logError(testName, function, args, startTime, "", "File Close failed", err)
- return
- }
- filePath = file.Name()
- }
-
- // add file to post request
- f, err := os.Open(filePath)
- defer f.Close()
- if err != nil {
- logError(testName, function, args, startTime, "", "File open failed", err)
- return
- }
- w, err := writer.CreateFormFile("file", filePath)
- if err != nil {
- logError(testName, function, args, startTime, "", "CreateFormFile failed", err)
- return
- }
-
- _, err = io.Copy(w, f)
- if err != nil {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- writer.Close()
-
- // make post request with correct form data
- res, err := http.Post(presignedPostPolicyURL.String(), writer.FormDataContentType(), bytes.NewReader(formBuf.Bytes()))
- if err != nil {
- logError(testName, function, args, startTime, "", "Http request failed", err)
- return
- }
- defer res.Body.Close()
- if res.StatusCode != http.StatusNoContent {
- logError(testName, function, args, startTime, "", "Http request failed", errors.New(res.Status))
- return
- }
-
- // expected path should be absolute path of the object
- var scheme string
- if mustParseBool(os.Getenv(enableHTTPS)) {
- scheme = "https://"
- } else {
- scheme = "http://"
- }
-
- expectedLocation := scheme + os.Getenv(serverEndpoint) + "/" + bucketName + "/" + objectName
- expectedLocationBucketDNS := scheme + bucketName + "." + os.Getenv(serverEndpoint) + "/" + objectName
-
- if val, ok := res.Header["Location"]; ok {
- if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS {
- logError(testName, function, args, startTime, "", "Location in header response is incorrect", err)
- return
- }
- } else {
- logError(testName, function, args, startTime, "", "Location not found in header response", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests copy object
-func testCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(dst, src)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Make a new bucket in 'us-east-1' (destination bucket).
- err = c.MakeBucket(bucketName+"-copy", "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- // Check the various fields of source object against destination object.
- objInfo, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- // Copy Source
- src := minio.NewSourceInfo(bucketName, objectName, nil)
- args["src"] = src
-
- // Set copy conditions.
-
- // All invalid conditions first.
- err = src.SetModifiedSinceCond(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC))
- if err == nil {
- logError(testName, function, args, startTime, "", "SetModifiedSinceCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetUnmodifiedSinceCond(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC))
- if err == nil {
- logError(testName, function, args, startTime, "", "SetUnmodifiedSinceCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetMatchETagCond("")
- if err == nil {
- logError(testName, function, args, startTime, "", "SetMatchETagCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetMatchETagExceptCond("")
- if err == nil {
- logError(testName, function, args, startTime, "", "SetMatchETagExceptCond did not fail for invalid conditions", err)
- return
- }
-
- err = src.SetModifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC))
- if err != nil {
- logError(testName, function, args, startTime, "", "SetModifiedSinceCond failed", err)
- return
- }
- err = src.SetMatchETagCond(objInfo.ETag)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetMatchETagCond failed", err)
- return
- }
-
- dst, err := minio.NewDestinationInfo(bucketName+"-copy", objectName+"-copy", nil, nil)
- args["dst"] = dst
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- // Perform the Copy
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- // Source object
- r, err = c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- // Destination object
- readerCopy, err := c.GetObject(bucketName+"-copy", objectName+"-copy", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- // Check the various fields of source object against destination object.
- objInfo, err = r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- objInfoCopy, err := readerCopy.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- if objInfo.Size != objInfoCopy.Size {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(objInfoCopy.Size)+", got "+string(objInfo.Size), err)
- return
- }
-
- // Close all the get readers before proceeding with CopyObject operations.
- r.Close()
- readerCopy.Close()
-
- // CopyObject again but with wrong conditions
- src = minio.NewSourceInfo(bucketName, objectName, nil)
- err = src.SetUnmodifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC))
- if err != nil {
- logError(testName, function, args, startTime, "", "SetUnmodifiedSinceCond failed", err)
- return
- }
- err = src.SetMatchETagExceptCond(objInfo.ETag)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetMatchETagExceptCond failed", err)
- return
- }
-
- // Perform the Copy which should fail
- err = c.CopyObject(dst, src)
- if err == nil {
- logError(testName, function, args, startTime, "", "CopyObject did not fail for invalid conditions", err)
- return
- }
-
- // Perform the Copy which should update only metadata.
- src = minio.NewSourceInfo(bucketName, objectName, nil)
- dst, err = minio.NewDestinationInfo(bucketName, objectName, nil, map[string]string{
- "Copy": "should be same",
- })
- args["dst"] = dst
- args["src"] = src
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject shouldn't fail", err)
- return
- }
-
- oi, err := c.StatObject(bucketName, objectName, minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
-
- stOpts := minio.StatObjectOptions{}
- stOpts.SetMatchETag(oi.ETag)
- objInfo, err = c.StatObject(bucketName, objectName, stOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject ETag should match and not fail", err)
- return
- }
-
- if objInfo.Metadata.Get("x-amz-meta-copy") != "should be same" {
- logError(testName, function, args, startTime, "", "CopyObject modified metadata should match", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- if err = cleanupBucket(bucketName+"-copy", c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests SSE-C get object ReaderSeeker interface methods.
-func testSSECEncryptedGetObjectReadSeekFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- defer func() {
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- }()
-
- // Generate 129MiB of data.
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{
- ContentType: "binary/octet-stream",
- ServerSideEncryption: encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+objectName)),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{
- ServerSideEncryption: encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+objectName)),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer r.Close()
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat object failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- // This following function helps us to compare data from the reader after seek
- // with the data from the original buffer
- cmpData := func(r io.Reader, start, end int) {
- if end-start == 0 {
- return
- }
- buffer := bytes.NewBuffer([]byte{})
- if _, err := io.CopyN(buffer, r, int64(bufSize)); err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "CopyN failed", err)
- return
- }
- }
- if !bytes.Equal(buf[start:end], buffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Incorrect read bytes v/s original buffer", err)
- return
- }
- }
-
- testCases := []struct {
- offset int64
- whence int
- pos int64
- err error
- shouldCmp bool
- start int
- end int
- }{
- // Start from offset 0, fetch data and compare
- {0, 0, 0, nil, true, 0, 0},
- // Start from offset 2048, fetch data and compare
- {2048, 0, 2048, nil, true, 2048, bufSize},
- // Start from offset larger than possible
- {int64(bufSize) + 1024, 0, 0, io.EOF, false, 0, 0},
- // Move to offset 0 without comparing
- {0, 0, 0, nil, false, 0, 0},
- // Move one step forward and compare
- {1, 1, 1, nil, true, 1, bufSize},
- // Move larger than possible
- {int64(bufSize), 1, 0, io.EOF, false, 0, 0},
- // Provide negative offset with CUR_SEEK
- {int64(-1), 1, 0, fmt.Errorf("Negative position not allowed for 1"), false, 0, 0},
- // Test with whence SEEK_END and with positive offset
- {1024, 2, 0, io.EOF, false, 0, 0},
- // Test with whence SEEK_END and with negative offset
- {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize},
- // Test with whence SEEK_END and with large negative offset
- {-int64(bufSize) * 2, 2, 0, fmt.Errorf("Seeking at negative offset not allowed for 2"), false, 0, 0},
- // Test with invalid whence
- {0, 3, 0, fmt.Errorf("Invalid whence 3"), false, 0, 0},
- }
-
- for i, testCase := range testCases {
- // Perform seek operation
- n, err := r.Seek(testCase.offset, testCase.whence)
- if err != nil && testCase.err == nil {
- // We expected success.
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- if err == nil && testCase.err != nil {
- // We expected failure, but got success.
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- if err != nil && testCase.err != nil {
- if err.Error() != testCase.err.Error() {
- // We expect a specific error
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- }
- // Check the returned seek pos
- if n != testCase.pos {
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, number of bytes seeked does not match, expected %d, got %d", i+1, testCase.pos, n), err)
- return
- }
- // Compare only if shouldCmp is activated
- if testCase.shouldCmp {
- cmpData(r, testCase.start, testCase.end)
- }
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests SSE-S3 get object ReaderSeeker interface methods.
-func testSSES3EncryptedGetObjectReadSeekFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- defer func() {
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- }()
-
- // Generate 129MiB of data.
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{
- ContentType: "binary/octet-stream",
- ServerSideEncryption: encrypt.NewSSE(),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer r.Close()
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat object failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- // This following function helps us to compare data from the reader after seek
- // with the data from the original buffer
- cmpData := func(r io.Reader, start, end int) {
- if end-start == 0 {
- return
- }
- buffer := bytes.NewBuffer([]byte{})
- if _, err := io.CopyN(buffer, r, int64(bufSize)); err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "CopyN failed", err)
- return
- }
- }
- if !bytes.Equal(buf[start:end], buffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Incorrect read bytes v/s original buffer", err)
- return
- }
- }
-
- testCases := []struct {
- offset int64
- whence int
- pos int64
- err error
- shouldCmp bool
- start int
- end int
- }{
- // Start from offset 0, fetch data and compare
- {0, 0, 0, nil, true, 0, 0},
- // Start from offset 2048, fetch data and compare
- {2048, 0, 2048, nil, true, 2048, bufSize},
- // Start from offset larger than possible
- {int64(bufSize) + 1024, 0, 0, io.EOF, false, 0, 0},
- // Move to offset 0 without comparing
- {0, 0, 0, nil, false, 0, 0},
- // Move one step forward and compare
- {1, 1, 1, nil, true, 1, bufSize},
- // Move larger than possible
- {int64(bufSize), 1, 0, io.EOF, false, 0, 0},
- // Provide negative offset with CUR_SEEK
- {int64(-1), 1, 0, fmt.Errorf("Negative position not allowed for 1"), false, 0, 0},
- // Test with whence SEEK_END and with positive offset
- {1024, 2, 0, io.EOF, false, 0, 0},
- // Test with whence SEEK_END and with negative offset
- {-1024, 2, int64(bufSize) - 1024, nil, true, bufSize - 1024, bufSize},
- // Test with whence SEEK_END and with large negative offset
- {-int64(bufSize) * 2, 2, 0, fmt.Errorf("Seeking at negative offset not allowed for 2"), false, 0, 0},
- // Test with invalid whence
- {0, 3, 0, fmt.Errorf("Invalid whence 3"), false, 0, 0},
- }
-
- for i, testCase := range testCases {
- // Perform seek operation
- n, err := r.Seek(testCase.offset, testCase.whence)
- if err != nil && testCase.err == nil {
- // We expected success.
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- if err == nil && testCase.err != nil {
- // We expected failure, but got success.
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- if err != nil && testCase.err != nil {
- if err.Error() != testCase.err.Error() {
- // We expect a specific error
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, unexpected err value: expected: %s, found: %s", i+1, testCase.err, err), err)
- return
- }
- }
- // Check the returned seek pos
- if n != testCase.pos {
- logError(testName, function, args, startTime, "",
- fmt.Sprintf("Test %d, number of bytes seeked does not match, expected %d, got %d", i+1, testCase.pos, n), err)
- return
- }
- // Compare only if shouldCmp is activated
- if testCase.shouldCmp {
- cmpData(r, testCase.start, testCase.end)
- }
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests SSE-C get object ReaderAt interface methods.
-func testSSECEncryptedGetObjectReadAtFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 129MiB of data.
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{
- ContentType: "binary/octet-stream",
- ServerSideEncryption: encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+objectName)),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{
- ServerSideEncryption: encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+objectName)),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- defer r.Close()
-
- offset := int64(2048)
-
- // read directly
- buf1 := make([]byte, 512)
- buf2 := make([]byte, 512)
- buf3 := make([]byte, 512)
- buf4 := make([]byte, 512)
-
- // Test readAt before stat is called such that objectInfo doesn't change.
- m, err := r.ReadAt(buf1, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf1) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf1))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf1, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- m, err = r.ReadAt(buf2, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf2))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf2, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf3, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf3) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf3))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf3, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf4, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf4) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf4))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf4, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
-
- buf5 := make([]byte, n)
- // Read the whole object.
- m, err = r.ReadAt(buf5, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- if m != len(buf5) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf5))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf, buf5) {
- logError(testName, function, args, startTime, "", "Incorrect data read in GetObject, than what was previously uploaded", err)
- return
- }
-
- buf6 := make([]byte, n+1)
- // Read the whole object and beyond.
- _, err = r.ReadAt(buf6, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests SSE-S3 get object ReaderAt interface methods.
-func testSSES3EncryptedGetObjectReadAtFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 129MiB of data.
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{
- ContentType: "binary/octet-stream",
- ServerSideEncryption: encrypt.NewSSE(),
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+", got "+string(n), err)
- return
- }
-
- // read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- defer r.Close()
-
- offset := int64(2048)
-
- // read directly
- buf1 := make([]byte, 512)
- buf2 := make([]byte, 512)
- buf3 := make([]byte, 512)
- buf4 := make([]byte, 512)
-
- // Test readAt before stat is called such that objectInfo doesn't change.
- m, err := r.ReadAt(buf1, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf1) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf1))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf1, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+", got "+string(st.Size), err)
- return
- }
-
- m, err = r.ReadAt(buf2, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf2))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf2, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf3, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf3) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf3))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf3, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf4, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf4) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf4))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf4, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
-
- buf5 := make([]byte, n)
- // Read the whole object.
- m, err = r.ReadAt(buf5, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- if m != len(buf5) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf5))+", got "+string(m), err)
- return
- }
- if !bytes.Equal(buf, buf5) {
- logError(testName, function, args, startTime, "", "Incorrect data read in GetObject, than what was previously uploaded", err)
- return
- }
-
- buf6 := make([]byte, n+1)
- // Read the whole object and beyond.
- _, err = r.ReadAt(buf6, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// testSSECEncryptionPutGet tests encryption with customer provided encryption keys
-func testSSECEncryptionPutGet() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutEncryptedObject(bucketName, objectName, reader, sse)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "sse": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- testCases := []struct {
- buf []byte
- }{
- {buf: bytes.Repeat([]byte("F"), 1)},
- {buf: bytes.Repeat([]byte("F"), 15)},
- {buf: bytes.Repeat([]byte("F"), 16)},
- {buf: bytes.Repeat([]byte("F"), 17)},
- {buf: bytes.Repeat([]byte("F"), 31)},
- {buf: bytes.Repeat([]byte("F"), 32)},
- {buf: bytes.Repeat([]byte("F"), 33)},
- {buf: bytes.Repeat([]byte("F"), 1024)},
- {buf: bytes.Repeat([]byte("F"), 1024*2)},
- {buf: bytes.Repeat([]byte("F"), 1024*1024)},
- }
-
- const password = "correct horse battery staple" // https://xkcd.com/936/
-
- for i, testCase := range testCases {
- // Generate a random object name
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Secured object
- sse := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
- args["sse"] = sse
-
- // Put encrypted data
- _, err = c.PutObject(bucketName, objectName, bytes.NewReader(testCase.buf), int64(len(testCase.buf)), minio.PutObjectOptions{ServerSideEncryption: sse})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutEncryptedObject failed", err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{ServerSideEncryption: sse})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetEncryptedObject failed", err)
- return
- }
- defer r.Close()
-
- // Compare the sent object with the received one
- recvBuffer := bytes.NewBuffer([]byte{})
- if _, err = io.Copy(recvBuffer, r); err != nil {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", error: "+err.Error(), err)
- return
- }
- if recvBuffer.Len() != len(testCase.buf) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Number of bytes of received object does not match, expected "+string(len(testCase.buf))+", got "+string(recvBuffer.Len()), err)
- return
- }
- if !bytes.Equal(testCase.buf, recvBuffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Encrypted sent is not equal to decrypted, expected "+string(testCase.buf)+", got "+string(recvBuffer.Bytes()), err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// TestEncryptionFPut tests encryption with customer specified encryption keys
-func testSSECEncryptionFPut() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutEncryptedObject(bucketName, objectName, filePath, contentType, sse)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "filePath": "",
- "contentType": "",
- "sse": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Object custom metadata
- customContentType := "custom/contenttype"
- args["metadata"] = customContentType
-
- testCases := []struct {
- buf []byte
- }{
- {buf: bytes.Repeat([]byte("F"), 0)},
- {buf: bytes.Repeat([]byte("F"), 1)},
- {buf: bytes.Repeat([]byte("F"), 15)},
- {buf: bytes.Repeat([]byte("F"), 16)},
- {buf: bytes.Repeat([]byte("F"), 17)},
- {buf: bytes.Repeat([]byte("F"), 31)},
- {buf: bytes.Repeat([]byte("F"), 32)},
- {buf: bytes.Repeat([]byte("F"), 33)},
- {buf: bytes.Repeat([]byte("F"), 1024)},
- {buf: bytes.Repeat([]byte("F"), 1024*2)},
- {buf: bytes.Repeat([]byte("F"), 1024*1024)},
- }
-
- const password = "correct horse battery staple" // https://xkcd.com/936/
- for i, testCase := range testCases {
- // Generate a random object name
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Secured object
- sse := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
- args["sse"] = sse
-
- // Generate a random file name.
- fileName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- file, err := os.Create(fileName)
- if err != nil {
- logError(testName, function, args, startTime, "", "file create failed", err)
- return
- }
- _, err = file.Write(testCase.buf)
- if err != nil {
- logError(testName, function, args, startTime, "", "file write failed", err)
- return
- }
- file.Close()
- // Put encrypted data
- if _, err = c.FPutObject(bucketName, objectName, fileName, minio.PutObjectOptions{ServerSideEncryption: sse}); err != nil {
- logError(testName, function, args, startTime, "", "FPutEncryptedObject failed", err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{ServerSideEncryption: sse})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetEncryptedObject failed", err)
- return
- }
- defer r.Close()
-
- // Compare the sent object with the received one
- recvBuffer := bytes.NewBuffer([]byte{})
- if _, err = io.Copy(recvBuffer, r); err != nil {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", error: "+err.Error(), err)
- return
- }
- if recvBuffer.Len() != len(testCase.buf) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Number of bytes of received object does not match, expected "+string(len(testCase.buf))+", got "+string(recvBuffer.Len()), err)
- return
- }
- if !bytes.Equal(testCase.buf, recvBuffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Encrypted sent is not equal to decrypted, expected "+string(testCase.buf)+", got "+string(recvBuffer.Bytes()), err)
- return
- }
-
- if err = os.Remove(fileName); err != nil {
- logError(testName, function, args, startTime, "", "File remove failed", err)
- return
- }
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// testSSES3EncryptionPutGet tests SSE-S3 encryption
-func testSSES3EncryptionPutGet() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutEncryptedObject(bucketName, objectName, reader, sse)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "sse": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- testCases := []struct {
- buf []byte
- }{
- {buf: bytes.Repeat([]byte("F"), 1)},
- {buf: bytes.Repeat([]byte("F"), 15)},
- {buf: bytes.Repeat([]byte("F"), 16)},
- {buf: bytes.Repeat([]byte("F"), 17)},
- {buf: bytes.Repeat([]byte("F"), 31)},
- {buf: bytes.Repeat([]byte("F"), 32)},
- {buf: bytes.Repeat([]byte("F"), 33)},
- {buf: bytes.Repeat([]byte("F"), 1024)},
- {buf: bytes.Repeat([]byte("F"), 1024*2)},
- {buf: bytes.Repeat([]byte("F"), 1024*1024)},
- }
-
- for i, testCase := range testCases {
- // Generate a random object name
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Secured object
- sse := encrypt.NewSSE()
- args["sse"] = sse
-
- // Put encrypted data
- _, err = c.PutObject(bucketName, objectName, bytes.NewReader(testCase.buf), int64(len(testCase.buf)), minio.PutObjectOptions{ServerSideEncryption: sse})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutEncryptedObject failed", err)
- return
- }
-
- // Read the data back without any encryption headers
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetEncryptedObject failed", err)
- return
- }
- defer r.Close()
-
- // Compare the sent object with the received one
- recvBuffer := bytes.NewBuffer([]byte{})
- if _, err = io.Copy(recvBuffer, r); err != nil {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", error: "+err.Error(), err)
- return
- }
- if recvBuffer.Len() != len(testCase.buf) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Number of bytes of received object does not match, expected "+string(len(testCase.buf))+", got "+string(recvBuffer.Len()), err)
- return
- }
- if !bytes.Equal(testCase.buf, recvBuffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Encrypted sent is not equal to decrypted, expected "+string(testCase.buf)+", got "+string(recvBuffer.Bytes()), err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// TestSSES3EncryptionFPut tests server side encryption
-func testSSES3EncryptionFPut() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutEncryptedObject(bucketName, objectName, filePath, contentType, sse)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "filePath": "",
- "contentType": "",
- "sse": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Object custom metadata
- customContentType := "custom/contenttype"
- args["metadata"] = customContentType
-
- testCases := []struct {
- buf []byte
- }{
- {buf: bytes.Repeat([]byte("F"), 0)},
- {buf: bytes.Repeat([]byte("F"), 1)},
- {buf: bytes.Repeat([]byte("F"), 15)},
- {buf: bytes.Repeat([]byte("F"), 16)},
- {buf: bytes.Repeat([]byte("F"), 17)},
- {buf: bytes.Repeat([]byte("F"), 31)},
- {buf: bytes.Repeat([]byte("F"), 32)},
- {buf: bytes.Repeat([]byte("F"), 33)},
- {buf: bytes.Repeat([]byte("F"), 1024)},
- {buf: bytes.Repeat([]byte("F"), 1024*2)},
- {buf: bytes.Repeat([]byte("F"), 1024*1024)},
- }
-
- for i, testCase := range testCases {
- // Generate a random object name
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Secured object
- sse := encrypt.NewSSE()
- args["sse"] = sse
-
- // Generate a random file name.
- fileName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- file, err := os.Create(fileName)
- if err != nil {
- logError(testName, function, args, startTime, "", "file create failed", err)
- return
- }
- _, err = file.Write(testCase.buf)
- if err != nil {
- logError(testName, function, args, startTime, "", "file write failed", err)
- return
- }
- file.Close()
- // Put encrypted data
- if _, err = c.FPutObject(bucketName, objectName, fileName, minio.PutObjectOptions{ServerSideEncryption: sse}); err != nil {
- logError(testName, function, args, startTime, "", "FPutEncryptedObject failed", err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetEncryptedObject failed", err)
- return
- }
- defer r.Close()
-
- // Compare the sent object with the received one
- recvBuffer := bytes.NewBuffer([]byte{})
- if _, err = io.Copy(recvBuffer, r); err != nil {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", error: "+err.Error(), err)
- return
- }
- if recvBuffer.Len() != len(testCase.buf) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Number of bytes of received object does not match, expected "+string(len(testCase.buf))+", got "+string(recvBuffer.Len()), err)
- return
- }
- if !bytes.Equal(testCase.buf, recvBuffer.Bytes()) {
- logError(testName, function, args, startTime, "", "Test "+string(i+1)+", Encrypted sent is not equal to decrypted, expected "+string(testCase.buf)+", got "+string(recvBuffer.Bytes()), err)
- return
- }
-
- if err = os.Remove(fileName); err != nil {
- logError(testName, function, args, startTime, "", "File remove failed", err)
- return
- }
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testBucketNotification() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "SetBucketNotification(bucketName)"
- args := map[string]interface{}{
- "bucketName": "",
- }
-
- if os.Getenv("NOTIFY_BUCKET") == "" ||
- os.Getenv("NOTIFY_SERVICE") == "" ||
- os.Getenv("NOTIFY_REGION") == "" ||
- os.Getenv("NOTIFY_ACCOUNTID") == "" ||
- os.Getenv("NOTIFY_RESOURCE") == "" {
- ignoredLog(testName, function, args, startTime, "Skipped notification test as it is not configured").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable to debug
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- bucketName := os.Getenv("NOTIFY_BUCKET")
- args["bucketName"] = bucketName
-
- topicArn := minio.NewArn("aws", os.Getenv("NOTIFY_SERVICE"), os.Getenv("NOTIFY_REGION"), os.Getenv("NOTIFY_ACCOUNTID"), os.Getenv("NOTIFY_RESOURCE"))
- queueArn := minio.NewArn("aws", "dummy-service", "dummy-region", "dummy-accountid", "dummy-resource")
-
- topicConfig := minio.NewNotificationConfig(topicArn)
-
- topicConfig.AddEvents(minio.ObjectCreatedAll, minio.ObjectRemovedAll)
- topicConfig.AddFilterSuffix("jpg")
-
- queueConfig := minio.NewNotificationConfig(queueArn)
- queueConfig.AddEvents(minio.ObjectCreatedAll)
- queueConfig.AddFilterPrefix("photos/")
-
- bNotification := minio.BucketNotification{}
- bNotification.AddTopic(topicConfig)
-
- // Add the same topicConfig again, should have no effect
- // because it is duplicated
- bNotification.AddTopic(topicConfig)
- if len(bNotification.TopicConfigs) != 1 {
- logError(testName, function, args, startTime, "", "Duplicate entry added", err)
- return
- }
-
- // Add and remove a queue config
- bNotification.AddQueue(queueConfig)
- bNotification.RemoveQueueByArn(queueArn)
-
- err = c.SetBucketNotification(bucketName, bNotification)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetBucketNotification failed", err)
- return
- }
-
- bNotification, err = c.GetBucketNotification(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetBucketNotification failed", err)
- return
- }
-
- if len(bNotification.TopicConfigs) != 1 {
- logError(testName, function, args, startTime, "", "Topic config is empty", err)
- return
- }
-
- if bNotification.TopicConfigs[0].Filter.S3Key.FilterRules[0].Value != "jpg" {
- logError(testName, function, args, startTime, "", "Couldn't get the suffix", err)
- return
- }
-
- err = c.RemoveAllBucketNotification(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveAllBucketNotification failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests comprehensive list of all methods.
-func testFunctional() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "testFunctional()"
- functionAll := ""
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, nil, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable to debug
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- // Make a new bucket.
- function = "MakeBucket(bucketName, region)"
- functionAll = "MakeBucket(bucketName, region)"
- args["bucketName"] = bucketName
- err = c.MakeBucket(bucketName, "us-east-1")
-
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate a random file name.
- fileName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- file, err := os.Create(fileName)
- if err != nil {
- logError(testName, function, args, startTime, "", "File creation failed", err)
- return
- }
- for i := 0; i < 3; i++ {
- buf := make([]byte, rand.Intn(1<<19))
- _, err = file.Write(buf)
- if err != nil {
- logError(testName, function, args, startTime, "", "File write failed", err)
- return
- }
- }
- file.Close()
-
- // Verify if bucket exits and you have access.
- var exists bool
- function = "BucketExists(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- exists, err = c.BucketExists(bucketName)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "BucketExists failed", err)
- return
- }
- if !exists {
- logError(testName, function, args, startTime, "", "Could not find the bucket", err)
- return
- }
-
- // Asserting the default bucket policy.
- function = "GetBucketPolicy(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- nilPolicy, err := c.GetBucketPolicy(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetBucketPolicy failed", err)
- return
- }
- if nilPolicy != "" {
- logError(testName, function, args, startTime, "", "policy should be set to nil", err)
- return
- }
-
- // Set the bucket policy to 'public readonly'.
- function = "SetBucketPolicy(bucketName, readOnlyPolicy)"
- functionAll += ", " + function
-
- readOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucket"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
- args = map[string]interface{}{
- "bucketName": bucketName,
- "bucketPolicy": readOnlyPolicy,
- }
-
- err = c.SetBucketPolicy(bucketName, readOnlyPolicy)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetBucketPolicy failed", err)
- return
- }
- // should return policy `readonly`.
- function = "GetBucketPolicy(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- _, err = c.GetBucketPolicy(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetBucketPolicy failed", err)
- return
- }
-
- // Make the bucket 'public writeonly'.
- function = "SetBucketPolicy(bucketName, writeOnlyPolicy)"
- functionAll += ", " + function
-
- writeOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucketMultipartUploads"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
- args = map[string]interface{}{
- "bucketName": bucketName,
- "bucketPolicy": writeOnlyPolicy,
- }
- err = c.SetBucketPolicy(bucketName, writeOnlyPolicy)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "SetBucketPolicy failed", err)
- return
- }
- // should return policy `writeonly`.
- function = "GetBucketPolicy(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
-
- _, err = c.GetBucketPolicy(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetBucketPolicy failed", err)
- return
- }
-
- // Make the bucket 'public read/write'.
- function = "SetBucketPolicy(bucketName, readWritePolicy)"
- functionAll += ", " + function
-
- readWritePolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucket","s3:ListBucketMultipartUploads"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
-
- args = map[string]interface{}{
- "bucketName": bucketName,
- "bucketPolicy": readWritePolicy,
- }
- err = c.SetBucketPolicy(bucketName, readWritePolicy)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "SetBucketPolicy failed", err)
- return
- }
- // should return policy `readwrite`.
- function = "GetBucketPolicy(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- _, err = c.GetBucketPolicy(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetBucketPolicy failed", err)
- return
- }
-
- // List all buckets.
- function = "ListBuckets()"
- functionAll += ", " + function
- args = nil
- buckets, err := c.ListBuckets()
-
- if len(buckets) == 0 {
- logError(testName, function, args, startTime, "", "Found bucket list to be empty", err)
- return
- }
- if err != nil {
- logError(testName, function, args, startTime, "", "ListBuckets failed", err)
- return
- }
-
- // Verify if previously created bucket is listed in list buckets.
- bucketFound := false
- for _, bucket := range buckets {
- if bucket.Name == bucketName {
- bucketFound = true
- }
- }
-
- // If bucket not found error out.
- if !bucketFound {
- logError(testName, function, args, startTime, "", "Bucket: "+bucketName+" not found", err)
- return
- }
-
- objectName := bucketName + "unique"
-
- // Generate data
- buf := bytes.Repeat([]byte("f"), 1<<19)
-
- function = "PutObject(bucketName, objectName, reader, contentType)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "contentType": "",
- }
-
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(len(buf)) {
- logError(testName, function, args, startTime, "", "Length doesn't match, expected "+string(int64(len(buf)))+" got "+string(n), err)
- return
- }
-
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName + "-nolength",
- "contentType": "binary/octet-stream",
- }
-
- n, err = c.PutObject(bucketName, objectName+"-nolength", bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(len(buf)) {
- logError(testName, function, args, startTime, "", "Length doesn't match, expected "+string(int64(len(buf)))+" got "+string(n), err)
- return
- }
-
- // Instantiate a done channel to close all listing.
- doneCh := make(chan struct{})
- defer close(doneCh)
-
- objFound := false
- isRecursive := true // Recursive is true.
-
- function = "ListObjects(bucketName, objectName, isRecursive, doneCh)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "isRecursive": isRecursive,
- }
-
- for obj := range c.ListObjects(bucketName, objectName, isRecursive, doneCh) {
- if obj.Key == objectName {
- objFound = true
- break
- }
- }
- if !objFound {
- logError(testName, function, args, startTime, "", "Object "+objectName+" not found", err)
- return
- }
-
- objFound = false
- isRecursive = true // Recursive is true.
- function = "ListObjectsV2(bucketName, objectName, isRecursive, doneCh)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "isRecursive": isRecursive,
- }
-
- for obj := range c.ListObjectsV2(bucketName, objectName, isRecursive, doneCh) {
- if obj.Key == objectName {
- objFound = true
- break
- }
- }
- if !objFound {
- logError(testName, function, args, startTime, "", "Object "+objectName+" not found", err)
- return
- }
-
- incompObjNotFound := true
-
- function = "ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "isRecursive": isRecursive,
- }
-
- for objIncompl := range c.ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh) {
- if objIncompl.Key != "" {
- incompObjNotFound = false
- break
- }
- }
- if !incompObjNotFound {
- logError(testName, function, args, startTime, "", "Unexpected dangling incomplete upload found", err)
- return
- }
-
- function = "GetObject(bucketName, objectName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- }
- newReader, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
-
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- newReadBytes, err := ioutil.ReadAll(newReader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- if !bytes.Equal(newReadBytes, buf) {
- logError(testName, function, args, startTime, "", "GetObject bytes mismatch", err)
- return
- }
- newReader.Close()
-
- function = "FGetObject(bucketName, objectName, fileName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "fileName": fileName + "-f",
- }
- err = c.FGetObject(bucketName, objectName, fileName+"-f", minio.GetObjectOptions{})
-
- if err != nil {
- logError(testName, function, args, startTime, "", "FGetObject failed", err)
- return
- }
-
- function = "PresignedHeadObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": "",
- "expires": 3600 * time.Second,
- }
- if _, err = c.PresignedHeadObject(bucketName, "", 3600*time.Second, nil); err == nil {
- logError(testName, function, args, startTime, "", "PresignedHeadObject success", err)
- return
- }
-
- // Generate presigned HEAD object url.
- function = "PresignedHeadObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "expires": 3600 * time.Second,
- }
- presignedHeadURL, err := c.PresignedHeadObject(bucketName, objectName, 3600*time.Second, nil)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedHeadObject failed", err)
- return
- }
- // Verify if presigned url works.
- resp, err := http.Head(presignedHeadURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedHeadObject response incorrect", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedHeadObject response incorrect, status "+string(resp.StatusCode), err)
- return
- }
- if resp.Header.Get("ETag") == "" {
- logError(testName, function, args, startTime, "", "PresignedHeadObject response incorrect", err)
- return
- }
- resp.Body.Close()
-
- function = "PresignedGetObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": "",
- "expires": 3600 * time.Second,
- }
- _, err = c.PresignedGetObject(bucketName, "", 3600*time.Second, nil)
- if err == nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject success", err)
- return
- }
-
- // Generate presigned GET object url.
- function = "PresignedGetObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "expires": 3600 * time.Second,
- }
- presignedGetURL, err := c.PresignedGetObject(bucketName, objectName, 3600*time.Second, nil)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject failed", err)
- return
- }
-
- // Verify if presigned url works.
- resp, err = http.Get(presignedGetURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect, status "+string(resp.StatusCode), err)
- return
- }
- newPresignedBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect", err)
- return
- }
- resp.Body.Close()
- if !bytes.Equal(newPresignedBytes, buf) {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect", err)
- return
- }
-
- // Set request parameters.
- reqParams := make(url.Values)
- reqParams.Set("response-content-disposition", "attachment; filename=\"test.txt\"")
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "expires": 3600 * time.Second,
- "reqParams": reqParams,
- }
- presignedGetURL, err = c.PresignedGetObject(bucketName, objectName, 3600*time.Second, reqParams)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject failed", err)
- return
- }
- // Verify if presigned url works.
- resp, err = http.Get(presignedGetURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect, status "+string(resp.StatusCode), err)
- return
- }
- newPresignedBytes, err = ioutil.ReadAll(resp.Body)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject response incorrect", err)
- return
- }
- if !bytes.Equal(newPresignedBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch for presigned GET URL", err)
- return
- }
- if resp.Header.Get("Content-Disposition") != "attachment; filename=\"test.txt\"" {
- logError(testName, function, args, startTime, "", "wrong Content-Disposition received "+string(resp.Header.Get("Content-Disposition")), err)
- return
- }
-
- function = "PresignedPutObject(bucketName, objectName, expires)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": "",
- "expires": 3600 * time.Second,
- }
- _, err = c.PresignedPutObject(bucketName, "", 3600*time.Second)
- if err == nil {
- logError(testName, function, args, startTime, "", "PresignedPutObject success", err)
- return
- }
-
- function = "PresignedPutObject(bucketName, objectName, expires)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName + "-presigned",
- "expires": 3600 * time.Second,
- }
- presignedPutURL, err := c.PresignedPutObject(bucketName, objectName+"-presigned", 3600*time.Second)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedPutObject failed", err)
- return
- }
-
- buf = bytes.Repeat([]byte("g"), 1<<19)
-
- req, err := http.NewRequest("PUT", presignedPutURL.String(), bytes.NewReader(buf))
- if err != nil {
- logError(testName, function, args, startTime, "", "Couldn't make HTTP request with PresignedPutObject URL", err)
- return
- }
- httpClient := &http.Client{
- // Setting a sensible time out of 30secs to wait for response
- // headers. Request is pro-actively cancelled after 30secs
- // with no response.
- Timeout: 30 * time.Second,
- Transport: http.DefaultTransport,
- }
- resp, err = httpClient.Do(req)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedPutObject failed", err)
- return
- }
-
- newReader, err = c.GetObject(bucketName, objectName+"-presigned", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject after PresignedPutObject failed", err)
- return
- }
-
- newReadBytes, err = ioutil.ReadAll(newReader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll after GetObject failed", err)
- return
- }
-
- if !bytes.Equal(newReadBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch", err)
- return
- }
-
- function = "RemoveObject(bucketName, objectName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- }
- err = c.RemoveObject(bucketName, objectName)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveObject failed", err)
- return
- }
- args["objectName"] = objectName + "-f"
- err = c.RemoveObject(bucketName, objectName+"-f")
-
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveObject failed", err)
- return
- }
-
- args["objectName"] = objectName + "-nolength"
- err = c.RemoveObject(bucketName, objectName+"-nolength")
-
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveObject failed", err)
- return
- }
-
- args["objectName"] = objectName + "-presigned"
- err = c.RemoveObject(bucketName, objectName+"-presigned")
-
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveObject failed", err)
- return
- }
-
- function = "RemoveBucket(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- err = c.RemoveBucket(bucketName)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "RemoveBucket failed", err)
- return
- }
- err = c.RemoveBucket(bucketName)
- if err == nil {
- logError(testName, function, args, startTime, "", "RemoveBucket did not fail for invalid bucket name", err)
- return
- }
- if err.Error() != "The specified bucket does not exist" {
- logError(testName, function, args, startTime, "", "RemoveBucket failed", err)
- return
- }
-
- if err = os.Remove(fileName); err != nil {
- logError(testName, function, args, startTime, "", "File Remove failed", err)
- return
- }
- if err = os.Remove(fileName + "-f"); err != nil {
- logError(testName, function, args, startTime, "", "File Remove failed", err)
- return
- }
- successLogger(testName, functionAll, args, startTime).Info()
-}
-
-// Test for validating GetObject Reader* methods functioning when the
-// object is modified in the object store.
-func testGetObjectModified() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
-
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Make a new bucket.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
- defer c.RemoveBucket(bucketName)
-
- // Upload an object.
- objectName := "myobject"
- args["objectName"] = objectName
- content := "helloworld"
- _, err = c.PutObject(bucketName, objectName, strings.NewReader(content), int64(len(content)), minio.PutObjectOptions{ContentType: "application/text"})
- if err != nil {
- logError(testName, function, args, startTime, "", "Failed to upload "+objectName+", to bucket "+bucketName, err)
- return
- }
-
- defer c.RemoveObject(bucketName, objectName)
-
- reader, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "Failed to GetObject "+objectName+", from bucket "+bucketName, err)
- return
- }
- defer reader.Close()
-
- // Read a few bytes of the object.
- b := make([]byte, 5)
- n, err := reader.ReadAt(b, 0)
- if err != nil {
- logError(testName, function, args, startTime, "", "Failed to read object "+objectName+", from bucket "+bucketName+" at an offset", err)
- return
- }
-
- // Upload different contents to the same object while object is being read.
- newContent := "goodbyeworld"
- _, err = c.PutObject(bucketName, objectName, strings.NewReader(newContent), int64(len(newContent)), minio.PutObjectOptions{ContentType: "application/text"})
- if err != nil {
- logError(testName, function, args, startTime, "", "Failed to upload "+objectName+", to bucket "+bucketName, err)
- return
- }
-
- // Confirm that a Stat() call in between doesn't change the Object's cached etag.
- _, err = reader.Stat()
- expectedError := "At least one of the pre-conditions you specified did not hold"
- if err.Error() != expectedError {
- logError(testName, function, args, startTime, "", "Expected Stat to fail with error "+expectedError+", but received "+err.Error(), err)
- return
- }
-
- // Read again only to find object contents have been modified since last read.
- _, err = reader.ReadAt(b, int64(n))
- if err.Error() != expectedError {
- logError(testName, function, args, startTime, "", "Expected ReadAt to fail with error "+expectedError+", but received "+err.Error(), err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test validates putObject to upload a file seeked at a given offset.
-func testPutObjectUploadSeekedObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, fileToUpload, contentType)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "fileToUpload": "",
- "contentType": "binary/octet-stream",
- }
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Make a new bucket.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
- defer c.RemoveBucket(bucketName)
-
- var tempfile *os.File
-
- if fileName := getMintDataDirFilePath("datafile-100-kB"); fileName != "" {
- tempfile, err = os.Open(fileName)
- if err != nil {
- logError(testName, function, args, startTime, "", "File open failed", err)
- return
- }
- args["fileToUpload"] = fileName
- } else {
- tempfile, err = ioutil.TempFile("", "minio-go-upload-test-")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile create failed", err)
- return
- }
- args["fileToUpload"] = tempfile.Name()
-
- // Generate 100kB data
- if _, err = io.Copy(tempfile, getDataReader("datafile-100-kB")); err != nil {
- logError(testName, function, args, startTime, "", "File copy failed", err)
- return
- }
-
- defer os.Remove(tempfile.Name())
-
- // Seek back to the beginning of the file.
- tempfile.Seek(0, 0)
- }
- var length = 100 * humanize.KiByte
- objectName := fmt.Sprintf("test-file-%v", rand.Uint32())
- args["objectName"] = objectName
-
- offset := length / 2
- if _, err = tempfile.Seek(int64(offset), 0); err != nil {
- logError(testName, function, args, startTime, "", "TempFile seek failed", err)
- return
- }
-
- n, err := c.PutObject(bucketName, objectName, tempfile, int64(length-offset), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- if n != int64(length-offset) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Invalid length returned, expected %d got %d", int64(length-offset), n), err)
- return
- }
- tempfile.Close()
-
- obj, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer obj.Close()
-
- n, err = obj.Seek(int64(offset), 0)
- if err != nil {
- logError(testName, function, args, startTime, "", "Seek failed", err)
- return
- }
- if n != int64(offset) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Invalid offset returned, expected %d got %d", int64(offset), n), err)
- return
- }
-
- n, err = c.PutObject(bucketName, objectName+"getobject", obj, int64(length-offset), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- if n != int64(length-offset) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Invalid offset returned, expected %d got %d", int64(length-offset), n), err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests bucket re-create errors.
-func testMakeBucketErrorV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "MakeBucket(bucketName, region)"
- args := map[string]interface{}{
- "bucketName": "",
- "region": "eu-west-1",
- }
-
- if os.Getenv(serverEndpoint) != "s3.amazonaws.com" {
- ignoredLog(testName, function, args, startTime, "Skipped region functional tests for non s3 runs").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- region := "eu-west-1"
- args["bucketName"] = bucketName
- args["region"] = region
-
- // Make a new bucket in 'eu-west-1'.
- if err = c.MakeBucket(bucketName, region); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
- if err = c.MakeBucket(bucketName, region); err == nil {
- logError(testName, function, args, startTime, "", "MakeBucket did not fail for existing bucket name", err)
- return
- }
- // Verify valid error response from server.
- if minio.ToErrorResponse(err).Code != "BucketAlreadyExists" &&
- minio.ToErrorResponse(err).Code != "BucketAlreadyOwnedByYou" {
- logError(testName, function, args, startTime, "", "Invalid error returned by server", err)
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test get object reader to not throw error on being closed twice.
-func testGetObjectClosedTwiceV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "MakeBucket(bucketName, region)"
- args := map[string]interface{}{
- "bucketName": "",
- "region": "eu-west-1",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(bufSize)+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(bufSize)+" got "+string(st.Size), err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- if err := r.Close(); err == nil {
- logError(testName, function, args, startTime, "", "Object is already closed, should return error", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests FPutObject hidden contentType setting
-func testFPutObjectV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FPutObject(bucketName, objectName, fileName, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Make a temp file with 11*1024*1024 bytes of data.
- file, err := ioutil.TempFile(os.TempDir(), "FPutObjectTest")
- if err != nil {
- logError(testName, function, args, startTime, "", "TempFile creation failed", err)
- return
- }
-
- r := bytes.NewReader(bytes.Repeat([]byte("b"), 11*1024*1024))
- n, err := io.CopyN(file, r, 11*1024*1024)
- if err != nil {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- if n != int64(11*1024*1024) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(11*1024*1024))+" got "+string(n), err)
- return
- }
-
- // Close the file pro-actively for windows.
- err = file.Close()
- if err != nil {
- logError(testName, function, args, startTime, "", "File close failed", err)
- return
- }
-
- // Set base object name
- objectName := bucketName + "FPutObject"
- args["objectName"] = objectName
- args["fileName"] = file.Name()
-
- // Perform standard FPutObject with contentType provided (Expecting application/octet-stream)
- n, err = c.FPutObject(bucketName, objectName+"-standard", file.Name(), minio.PutObjectOptions{ContentType: "application/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(11*1024*1024) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(11*1024*1024))+" got "+string(n), err)
- return
- }
-
- // Perform FPutObject with no contentType provided (Expecting application/octet-stream)
- args["objectName"] = objectName + "-Octet"
- args["contentType"] = ""
-
- n, err = c.FPutObject(bucketName, objectName+"-Octet", file.Name(), minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(11*1024*1024) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(11*1024*1024))+" got "+string(n), err)
- return
- }
-
- // Add extension to temp file name
- fileName := file.Name()
- err = os.Rename(file.Name(), fileName+".gtar")
- if err != nil {
- logError(testName, function, args, startTime, "", "Rename failed", err)
- return
- }
-
- // Perform FPutObject with no contentType provided (Expecting application/x-gtar)
- args["objectName"] = objectName + "-Octet"
- args["contentType"] = ""
- args["fileName"] = fileName + ".gtar"
-
- n, err = c.FPutObject(bucketName, objectName+"-GTar", fileName+".gtar", minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FPutObject failed", err)
- return
- }
- if n != int64(11*1024*1024) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(11*1024*1024))+" got "+string(n), err)
- return
- }
-
- // Check headers
- rStandard, err := c.StatObject(bucketName, objectName+"-standard", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rStandard.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "Content-Type headers mismatched, expected: application/octet-stream , got "+rStandard.ContentType, err)
- return
- }
-
- rOctet, err := c.StatObject(bucketName, objectName+"-Octet", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rOctet.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "Content-Type headers mismatched, expected: application/octet-stream , got "+rOctet.ContentType, err)
- return
- }
-
- rGTar, err := c.StatObject(bucketName, objectName+"-GTar", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
- if rGTar.ContentType != "application/x-gtar" && rGTar.ContentType != "application/octet-stream" {
- logError(testName, function, args, startTime, "", "Content-Type headers mismatched, expected: application/x-gtar , got "+rGTar.ContentType, err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- err = os.Remove(fileName + ".gtar")
- if err != nil {
- logError(testName, function, args, startTime, "", "File remove failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests various bucket supported formats.
-func testMakeBucketRegionsV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "MakeBucket(bucketName, region)"
- args := map[string]interface{}{
- "bucketName": "",
- "region": "eu-west-1",
- }
-
- if os.Getenv(serverEndpoint) != "s3.amazonaws.com" {
- ignoredLog(testName, function, args, startTime, "Skipped region functional tests for non s3 runs").Info()
- return
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket in 'eu-central-1'.
- if err = c.MakeBucket(bucketName, "eu-west-1"); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- // Make a new bucket with '.' in its name, in 'us-west-2'. This
- // request is internally staged into a path style instead of
- // virtual host style.
- if err = c.MakeBucket(bucketName+".withperiod", "us-west-2"); err != nil {
- args["bucketName"] = bucketName + ".withperiod"
- args["region"] = "us-west-2"
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName+".withperiod", c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests get object ReaderSeeker interface methods.
-func testGetObjectReadSeekFunctionalV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data.
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer r.Close()
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(int64(bufSize))+" got "+string(st.Size), err)
- return
- }
-
- offset := int64(2048)
- n, err = r.Seek(offset, 0)
- if err != nil {
- logError(testName, function, args, startTime, "", "Seek failed", err)
- return
- }
- if n != offset {
- logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset)+" got "+string(n), err)
- return
- }
- n, err = r.Seek(0, 1)
- if err != nil {
- logError(testName, function, args, startTime, "", "Seek failed", err)
- return
- }
- if n != offset {
- logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset)+" got "+string(n), err)
- return
- }
- _, err = r.Seek(offset, 2)
- if err == nil {
- logError(testName, function, args, startTime, "", "Seek on positive offset for whence '2' should error out", err)
- return
- }
- n, err = r.Seek(-offset, 2)
- if err != nil {
- logError(testName, function, args, startTime, "", "Seek failed", err)
- return
- }
- if n != st.Size-offset {
- logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(st.Size-offset)+" got "+string(n), err)
- return
- }
-
- var buffer1 bytes.Buffer
- if _, err = io.CopyN(&buffer1, r, st.Size); err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- }
- if !bytes.Equal(buf[len(buf)-int(offset):], buffer1.Bytes()) {
- logError(testName, function, args, startTime, "", "Incorrect read bytes v/s original buffer", err)
- return
- }
-
- // Seek again and read again.
- n, err = r.Seek(offset-1, 0)
- if err != nil {
- logError(testName, function, args, startTime, "", "Seek failed", err)
- return
- }
- if n != (offset - 1) {
- logError(testName, function, args, startTime, "", "Number of seeked bytes does not match, expected "+string(offset-1)+" got "+string(n), err)
- return
- }
-
- var buffer2 bytes.Buffer
- if _, err = io.CopyN(&buffer2, r, st.Size); err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "Copy failed", err)
- return
- }
- }
- // Verify now lesser bytes.
- if !bytes.Equal(buf[2047:], buffer2.Bytes()) {
- logError(testName, function, args, startTime, "", "Incorrect read bytes v/s original buffer", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests get object ReaderAt interface methods.
-func testGetObjectReadAtFunctionalV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObject(bucketName, objectName)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- buf, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
-
- // Save the data
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(bufSize)+" got "+string(n), err)
- return
- }
-
- // Read the data back
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer r.Close()
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
-
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(bufSize)+" got "+string(st.Size), err)
- return
- }
-
- offset := int64(2048)
-
- // Read directly
- buf2 := make([]byte, 512)
- buf3 := make([]byte, 512)
- buf4 := make([]byte, 512)
-
- m, err := r.ReadAt(buf2, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf2) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf2))+" got "+string(m), err)
- return
- }
- if !bytes.Equal(buf2, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf3, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf3) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf3))+" got "+string(m), err)
- return
- }
- if !bytes.Equal(buf3, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
- offset += 512
- m, err = r.ReadAt(buf4, offset)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- if m != len(buf4) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf4))+" got "+string(m), err)
- return
- }
- if !bytes.Equal(buf4, buf[offset:offset+512]) {
- logError(testName, function, args, startTime, "", "Incorrect read between two ReadAt from same offset", err)
- return
- }
-
- buf5 := make([]byte, n)
- // Read the whole object.
- m, err = r.ReadAt(buf5, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- if m != len(buf5) {
- logError(testName, function, args, startTime, "", "ReadAt read shorter bytes before reaching EOF, expected "+string(len(buf5))+" got "+string(m), err)
- return
- }
- if !bytes.Equal(buf, buf5) {
- logError(testName, function, args, startTime, "", "Incorrect data read in GetObject, than what was previously uploaded", err)
- return
- }
-
- buf6 := make([]byte, n+1)
- // Read the whole object and beyond.
- _, err = r.ReadAt(buf6, 0)
- if err != nil {
- if err != io.EOF {
- logError(testName, function, args, startTime, "", "ReadAt failed", err)
- return
- }
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Tests copy object
-func testCopyObjectV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Make a new bucket in 'us-east-1' (destination bucket).
- err = c.MakeBucket(bucketName+"-copy", "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate 33K of data.
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- n, err := c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(int64(bufSize))+" got "+string(n), err)
- return
- }
-
- r, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- // Check the various fields of source object against destination object.
- objInfo, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- r.Close()
-
- // Copy Source
- src := minio.NewSourceInfo(bucketName, objectName, nil)
- args["source"] = src
-
- // Set copy conditions.
-
- // All invalid conditions first.
- err = src.SetModifiedSinceCond(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC))
- if err == nil {
- logError(testName, function, args, startTime, "", "SetModifiedSinceCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetUnmodifiedSinceCond(time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC))
- if err == nil {
- logError(testName, function, args, startTime, "", "SetUnmodifiedSinceCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetMatchETagCond("")
- if err == nil {
- logError(testName, function, args, startTime, "", "SetMatchETagCond did not fail for invalid conditions", err)
- return
- }
- err = src.SetMatchETagExceptCond("")
- if err == nil {
- logError(testName, function, args, startTime, "", "SetMatchETagExceptCond did not fail for invalid conditions", err)
- return
- }
-
- err = src.SetModifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC))
- if err != nil {
- logError(testName, function, args, startTime, "", "SetModifiedSinceCond failed", err)
- return
- }
- err = src.SetMatchETagCond(objInfo.ETag)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetMatchETagCond failed", err)
- return
- }
-
- dst, err := minio.NewDestinationInfo(bucketName+"-copy", objectName+"-copy", nil, nil)
- args["destination"] = dst
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- // Perform the Copy
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- // Source object
- r, err = c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- // Destination object
- readerCopy, err := c.GetObject(bucketName+"-copy", objectName+"-copy", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- // Check the various fields of source object against destination object.
- objInfo, err = r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- objInfoCopy, err := readerCopy.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- if objInfo.Size != objInfoCopy.Size {
- logError(testName, function, args, startTime, "", "Number of bytes does not match, expected "+string(objInfoCopy.Size)+" got "+string(objInfo.Size), err)
- return
- }
-
- // Close all the readers.
- r.Close()
- readerCopy.Close()
-
- // CopyObject again but with wrong conditions
- src = minio.NewSourceInfo(bucketName, objectName, nil)
- err = src.SetUnmodifiedSinceCond(time.Date(2014, time.April, 0, 0, 0, 0, 0, time.UTC))
- if err != nil {
- logError(testName, function, args, startTime, "", "SetUnmodifiedSinceCond failed", err)
- return
- }
- err = src.SetMatchETagExceptCond(objInfo.ETag)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetMatchETagExceptCond failed", err)
- return
- }
-
- // Perform the Copy which should fail
- err = c.CopyObject(dst, src)
- if err == nil {
- logError(testName, function, args, startTime, "", "CopyObject did not fail for invalid conditions", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- if err = cleanupBucket(bucketName+"-copy", c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testComposeObjectErrorCasesWrapper(c *minio.Client) {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{}
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- // Make a new bucket in 'us-east-1' (source bucket).
- err := c.MakeBucket(bucketName, "us-east-1")
-
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Test that more than 10K source objects cannot be
- // concatenated.
- srcArr := [10001]minio.SourceInfo{}
- srcSlice := srcArr[:]
- dst, err := minio.NewDestinationInfo(bucketName, "object", nil, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- args["destination"] = dst
- // Just explain about srcArr in args["sourceList"]
- // to stop having 10,001 null headers logged
- args["sourceList"] = "source array of 10,001 elements"
- if err := c.ComposeObject(dst, srcSlice); err == nil {
- logError(testName, function, args, startTime, "", "Expected error in ComposeObject", err)
- return
- } else if err.Error() != "There must be as least one and up to 10000 source objects." {
- logError(testName, function, args, startTime, "", "Got unexpected error", err)
- return
- }
-
- // Create a source with invalid offset spec and check that
- // error is returned:
- // 1. Create the source object.
- const badSrcSize = 5 * 1024 * 1024
- buf := bytes.Repeat([]byte("1"), badSrcSize)
- _, err = c.PutObject(bucketName, "badObject", bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- // 2. Set invalid range spec on the object (going beyond
- // object size)
- badSrc := minio.NewSourceInfo(bucketName, "badObject", nil)
- err = badSrc.SetRange(1, badSrcSize)
- if err != nil {
- logError(testName, function, args, startTime, "", "Setting NewSourceInfo failed", err)
- return
- }
- // 3. ComposeObject call should fail.
- if err := c.ComposeObject(dst, []minio.SourceInfo{badSrc}); err == nil {
- logError(testName, function, args, startTime, "", "ComposeObject expected to fail", err)
- return
- } else if !strings.Contains(err.Error(), "has invalid segment-to-copy") {
- logError(testName, function, args, startTime, "", "Got invalid error", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test expected error cases
-func testComposeObjectErrorCasesV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- testComposeObjectErrorCasesWrapper(c)
-}
-
-func testComposeMultipleSources(c *minio.Client) {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{
- "destination": "",
- "sourceList": "",
- }
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- // Make a new bucket in 'us-east-1' (source bucket).
- err := c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Upload a small source object
- const srcSize = 1024 * 1024 * 5
- buf := bytes.Repeat([]byte("1"), srcSize)
- _, err = c.PutObject(bucketName, "srcObject", bytes.NewReader(buf), int64(srcSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // We will append 10 copies of the object.
- srcs := []minio.SourceInfo{}
- for i := 0; i < 10; i++ {
- srcs = append(srcs, minio.NewSourceInfo(bucketName, "srcObject", nil))
- }
- // make the last part very small
- err = srcs[9].SetRange(0, 0)
- if err != nil {
- logError(testName, function, args, startTime, "", "SetRange failed", err)
- return
- }
- args["sourceList"] = srcs
-
- dst, err := minio.NewDestinationInfo(bucketName, "dstObject", nil, nil)
- args["destination"] = dst
-
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- err = c.ComposeObject(dst, srcs)
- if err != nil {
- logError(testName, function, args, startTime, "", "ComposeObject failed", err)
- return
- }
-
- objProps, err := c.StatObject(bucketName, "dstObject", minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject failed", err)
- return
- }
-
- if objProps.Size != 9*srcSize+1 {
- logError(testName, function, args, startTime, "", "Size mismatched! Expected "+string(10000*srcSize)+" got "+string(objProps.Size), err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test concatenating multiple objects objects
-func testCompose10KSourcesV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- testComposeMultipleSources(c)
-}
-
-func testEncryptedEmptyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, objectSize, opts)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- sse := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"object"))
-
- // 1. create an sse-c encrypted object to copy by uploading
- const srcSize = 0
- var buf []byte // Empty buffer
- args["objectName"] = "object"
- _, err = c.PutObject(bucketName, "object", bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ServerSideEncryption: sse})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- return
- }
-
- // 2. Test CopyObject for an empty object
- dstInfo, err := minio.NewDestinationInfo(bucketName, "new-object", sse, nil)
- if err != nil {
- args["objectName"] = "new-object"
- function = "NewDestinationInfo(bucketName, objectName, sse, userMetadata)"
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- srcInfo := minio.NewSourceInfo(bucketName, "object", sse)
- if err = c.CopyObject(dstInfo, srcInfo); err != nil {
- function = "CopyObject(dstInfo, srcInfo)"
- logError(testName, function, map[string]interface{}{}, startTime, "", "CopyObject failed", err)
- return
- }
-
- // 3. Test Key rotation
- newSSE := encrypt.DefaultPBKDF([]byte("Don't Panic"), []byte(bucketName+"new-object"))
- dstInfo, err = minio.NewDestinationInfo(bucketName, "new-object", newSSE, nil)
- if err != nil {
- args["objectName"] = "new-object"
- function = "NewDestinationInfo(bucketName, objectName, encryptSSEC, userMetadata)"
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- srcInfo = minio.NewSourceInfo(bucketName, "new-object", sse)
- if err = c.CopyObject(dstInfo, srcInfo); err != nil {
- function = "CopyObject(dstInfo, srcInfo)"
- logError(testName, function, map[string]interface{}{}, startTime, "", "CopyObject with key rotation failed", err)
- return
- }
-
- // 4. Download the object.
- reader, err := c.GetObject(bucketName, "new-object", minio.GetObjectOptions{ServerSideEncryption: newSSE})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer reader.Close()
-
- decBytes, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, map[string]interface{}{}, startTime, "", "ReadAll failed", err)
- return
- }
- if !bytes.Equal(decBytes, buf) {
- logError(testName, function, map[string]interface{}{}, startTime, "", "Downloaded object doesn't match the empty encrypted object", err)
- return
- }
- // Delete all objects and buckets
- delete(args, "objectName")
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testEncryptedCopyObjectWrapper(c *minio.Client, bucketName string, sseSrc, sseDst encrypt.ServerSide) {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
- var srcEncryption, dstEncryption encrypt.ServerSide
-
- // Make a new bucket in 'us-east-1' (source bucket).
- err := c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // 1. create an sse-c encrypted object to copy by uploading
- const srcSize = 1024 * 1024
- buf := bytes.Repeat([]byte("abcde"), srcSize) // gives a buffer of 5MiB
- _, err = c.PutObject(bucketName, "srcObject", bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{
- ServerSideEncryption: sseSrc,
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- return
- }
-
- if sseSrc != nil && sseSrc.Type() != encrypt.S3 {
- srcEncryption = sseSrc
- }
-
- // 2. copy object and change encryption key
- src := minio.NewSourceInfo(bucketName, "srcObject", srcEncryption)
- args["source"] = src
- dst, err := minio.NewDestinationInfo(bucketName, "dstObject", sseDst, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- args["destination"] = dst
-
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- if sseDst != nil && sseDst.Type() != encrypt.S3 {
- dstEncryption = sseDst
- }
- // 3. get copied object and check if content is equal
- coreClient := minio.Core{c}
- reader, _, err := coreClient.GetObject(bucketName, "dstObject", minio.GetObjectOptions{ServerSideEncryption: dstEncryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- decBytes, err := ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- if !bytes.Equal(decBytes, buf) {
- logError(testName, function, args, startTime, "", "Downloaded object mismatched for encrypted object", err)
- return
- }
- reader.Close()
-
- // Test key rotation for source object in-place.
- var newSSE encrypt.ServerSide
- if sseSrc != nil && sseSrc.Type() == encrypt.SSEC {
- newSSE = encrypt.DefaultPBKDF([]byte("Don't Panic"), []byte(bucketName+"srcObject")) // replace key
- }
- if sseSrc != nil && sseSrc.Type() == encrypt.S3 {
- newSSE = encrypt.NewSSE()
- }
- if newSSE != nil {
- dst, err = minio.NewDestinationInfo(bucketName, "srcObject", newSSE, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- args["destination"] = dst
-
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- // Get copied object and check if content is equal
- reader, _, err = coreClient.GetObject(bucketName, "srcObject", minio.GetObjectOptions{ServerSideEncryption: newSSE})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- decBytes, err = ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- if !bytes.Equal(decBytes, buf) {
- logError(testName, function, args, startTime, "", "Downloaded object mismatched for encrypted object", err)
- return
- }
- reader.Close()
- // Test in-place decryption.
- dst, err = minio.NewDestinationInfo(bucketName, "srcObject", nil, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- args["destination"] = dst
-
- src = minio.NewSourceInfo(bucketName, "srcObject", newSSE)
- args["source"] = src
- err = c.CopyObject(dst, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject Key rotation failed", err)
- return
- }
- }
-
- // Get copied decrypted object and check if content is equal
- reader, _, err = coreClient.GetObject(bucketName, "srcObject", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- defer reader.Close()
-
- decBytes, err = ioutil.ReadAll(reader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- if !bytes.Equal(decBytes, buf) {
- logError(testName, function, args, startTime, "", "Downloaded object mismatched for encrypted object", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test encrypted copy object
-func testUnencryptedToSSECCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- var sseSrc encrypt.ServerSide
- sseDst := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"dstObject"))
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testUnencryptedToSSES3CopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- var sseSrc encrypt.ServerSide
- sseDst := encrypt.NewSSE()
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testUnencryptedToUnencryptedCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- var sseSrc, sseDst encrypt.ServerSide
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSECToSSECCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"srcObject"))
- sseDst := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"dstObject"))
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSECToSSES3CopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"srcObject"))
- sseDst := encrypt.NewSSE()
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSECToUnencryptedCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"srcObject"))
- var sseDst encrypt.ServerSide
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSES3ToSSECCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.NewSSE()
- sseDst := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"dstObject"))
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSES3ToSSES3CopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.NewSSE()
- sseDst := encrypt.NewSSE()
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedSSES3ToUnencryptedCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.NewSSE()
- var sseDst encrypt.ServerSide
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-// Test encrypted copy object
-func testEncryptedCopyObjectV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
-
- sseSrc := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"srcObject"))
- sseDst := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+"dstObject"))
- // c.TraceOn(os.Stderr)
- testEncryptedCopyObjectWrapper(c, bucketName, sseSrc, sseDst)
-}
-
-func testDecryptedCopyObject() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v2 client object creation failed", err)
- return
- }
-
- bucketName, objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-"), "object"
- if err = c.MakeBucket(bucketName, "us-east-1"); err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- encryption := encrypt.DefaultPBKDF([]byte("correct horse battery staple"), []byte(bucketName+objectName))
- _, err = c.PutObject(bucketName, objectName, bytes.NewReader(bytes.Repeat([]byte("a"), 1024*1024)), 1024*1024, minio.PutObjectOptions{
- ServerSideEncryption: encryption,
- })
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- return
- }
-
- src := minio.NewSourceInfo(bucketName, objectName, encrypt.SSECopy(encryption))
- args["source"] = src
- dst, err := minio.NewDestinationInfo(bucketName, "decrypted-"+objectName, nil, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- args["destination"] = dst
-
- if err = c.CopyObject(dst, src); err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
- if _, err = c.GetObject(bucketName, "decrypted-"+objectName, minio.GetObjectOptions{}); err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testSSECMultipartEncryptedToSSECCopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 6MB of data
- buf := bytes.Repeat([]byte("abcdef"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
- srcencryption := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
-
- // Upload a 6MB object using multipart mechanism
- uploadID, err := c.NewMultipartUpload(bucketName, objectName, minio.PutObjectOptions{ServerSideEncryption: srcencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- var completeParts []minio.CompletePart
-
- part, err := c.PutObjectPart(bucketName, objectName, uploadID, 1, bytes.NewReader(buf[:5*1024*1024]), 5*1024*1024, "", "", srcencryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectPart call failed", err)
- }
- completeParts = append(completeParts, minio.CompletePart{PartNumber: part.PartNumber, ETag: part.ETag})
-
- part, err = c.PutObjectPart(bucketName, objectName, uploadID, 2, bytes.NewReader(buf[5*1024*1024:]), 1024*1024, "", "", srcencryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectPart call failed", err)
- }
- completeParts = append(completeParts, minio.CompletePart{PartNumber: part.PartNumber, ETag: part.ETag})
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(bucketName, objectName, uploadID, completeParts)
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err := c.StatObject(bucketName, objectName, minio.StatObjectOptions{minio.GetObjectOptions{ServerSideEncryption: srcencryption}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.DefaultPBKDF([]byte(password), []byte(destBucketName+destObjectName))
-
- uploadID, err = c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- encrypt.SSECopy(srcencryption).Marshal(header)
- dstencryption.Marshal(header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{ServerSideEncryption: dstencryption}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (6*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{ServerSideEncryption: dstencryption}
- getOpts.SetRange(0, 6*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 6*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 6MB", err)
- }
-
- getOpts.SetRange(6*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 6*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:6*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 6MB", err)
- }
- if getBuf[6*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation
-func testSSECEncryptedToSSECCopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
- srcencryption := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcencryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.DefaultPBKDF([]byte(password), []byte(destBucketName+destObjectName))
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- encrypt.SSECopy(srcencryption).Marshal(header)
- dstencryption.Marshal(header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{ServerSideEncryption: dstencryption}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{ServerSideEncryption: dstencryption}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for SSEC encrypted to unencrypted copy
-func testSSECEncryptedToUnencryptedCopyPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
- srcencryption := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcencryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- var dstencryption encrypt.ServerSide
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- encrypt.SSECopy(srcencryption).Marshal(header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for SSEC encrypted to SSE-S3 encrypted copy
-func testSSECEncryptedToSSES3CopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
- srcencryption := encrypt.DefaultPBKDF([]byte(password), []byte(bucketName+objectName))
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcencryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.NewSSE()
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- encrypt.SSECopy(srcencryption).Marshal(header)
- dstencryption.Marshal(header)
-
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for unencrypted to SSEC encryption copy part
-func testUnencryptedToSSECCopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.DefaultPBKDF([]byte(password), []byte(destBucketName+destObjectName))
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- dstencryption.Marshal(header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{ServerSideEncryption: dstencryption}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{ServerSideEncryption: dstencryption}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for unencrypted to unencrypted copy
-func testUnencryptedToUnencryptedCopyPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for unencrypted to SSE-S3 encrypted copy
-func testUnencryptedToSSES3CopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.NewSSE()
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- dstencryption.Marshal(header)
-
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for SSE-S3 to SSEC encryption copy part
-func testSSES3EncryptedToSSECCopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- password := "correct horse battery staple"
- srcEncryption := encrypt.NewSSE()
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcEncryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.DefaultPBKDF([]byte(password), []byte(destBucketName+destObjectName))
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- dstencryption.Marshal(header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{ServerSideEncryption: dstencryption}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{ServerSideEncryption: dstencryption}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for unencrypted to unencrypted copy
-func testSSES3EncryptedToUnencryptedCopyPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- srcEncryption := encrypt.NewSSE()
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcEncryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-
-// Test Core CopyObjectPart implementation for unencrypted to SSE-S3 encrypted copy
-func testSSES3EncryptedToSSES3CopyObjectPart() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObjectPart(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- client, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Instantiate new core client object.
- c := minio.Core{client}
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- }
- defer cleanupBucket(bucketName, client)
- // Make a buffer with 5MB of data
- buf := bytes.Repeat([]byte("abcde"), 1024*1024)
-
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- srcEncryption := encrypt.NewSSE()
-
- objInfo, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), "", "", map[string]string{
- "Content-Type": "binary/octet-stream",
- }, srcEncryption)
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- }
-
- if objInfo.Size != int64(len(buf)) {
- logError(testName, function, args, startTime, "", fmt.Sprintf("Error: number of bytes does not match, want %v, got %v\n", len(buf), objInfo.Size), err)
- }
-
- destBucketName := bucketName
- destObjectName := objectName + "-dest"
- dstencryption := encrypt.NewSSE()
-
- uploadID, err := c.NewMultipartUpload(destBucketName, destObjectName, minio.PutObjectOptions{ServerSideEncryption: dstencryption})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewMultipartUpload call failed", err)
- }
-
- // Content of the destination object will be two copies of
- // `objectName` concatenated, followed by first byte of
- // `objectName`.
- metadata := make(map[string]string)
- header := make(http.Header)
- dstencryption.Marshal(header)
-
- for k, v := range header {
- metadata[k] = v[0]
- }
-
- metadata["x-amz-copy-source-if-match"] = objInfo.ETag
-
- // First of three parts
- fstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 1, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Second of three parts
- sndPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 2, 0, -1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Last of three parts
- lstPart, err := c.CopyObjectPart(bucketName, objectName, destBucketName, destObjectName, uploadID, 3, 0, 1, metadata)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObjectPart call failed", err)
- }
-
- // Complete the multipart upload
- _, err = c.CompleteMultipartUpload(destBucketName, destObjectName, uploadID, []minio.CompletePart{fstPart, sndPart, lstPart})
- if err != nil {
- logError(testName, function, args, startTime, "", "CompleteMultipartUpload call failed", err)
- }
-
- // Stat the object and check its length matches
- objInfo, err = c.StatObject(destBucketName, destObjectName, minio.StatObjectOptions{minio.GetObjectOptions{}})
- if err != nil {
- logError(testName, function, args, startTime, "", "StatObject call failed", err)
- }
-
- if objInfo.Size != (5*1024*1024)*2+1 {
- logError(testName, function, args, startTime, "", "Destination object has incorrect size!", err)
- }
-
- // Now we read the data back
- getOpts := minio.GetObjectOptions{}
- getOpts.SetRange(0, 5*1024*1024-1)
- r, _, err := c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf := make([]byte, 5*1024*1024)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf, buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in first 5MB", err)
- }
-
- getOpts.SetRange(5*1024*1024, 0)
- r, _, err = c.GetObject(destBucketName, destObjectName, getOpts)
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject call failed", err)
- }
- getBuf = make([]byte, 5*1024*1024+1)
- _, err = io.ReadFull(r, getBuf)
- if err != nil {
- logError(testName, function, args, startTime, "", "Read buffer failed", err)
- }
- if !bytes.Equal(getBuf[:5*1024*1024], buf) {
- logError(testName, function, args, startTime, "", "Got unexpected data in second 5MB", err)
- }
- if getBuf[5*1024*1024] != buf[0] {
- logError(testName, function, args, startTime, "", "Got unexpected data in last byte of copied object!", err)
- }
-
- successLogger(testName, function, args, startTime).Info()
-
- // Do not need to remove destBucketName its same as bucketName.
-}
-func testUserMetadataCopying() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- // c.TraceOn(os.Stderr)
- testUserMetadataCopyingWrapper(c)
-}
-
-func testUserMetadataCopyingWrapper(c *minio.Client) {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- // Make a new bucket in 'us-east-1' (source bucket).
- err := c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- fetchMeta := func(object string) (h http.Header) {
- objInfo, err := c.StatObject(bucketName, object, minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- h = make(http.Header)
- for k, vs := range objInfo.Metadata {
- if strings.HasPrefix(strings.ToLower(k), "x-amz-meta-") {
- for _, v := range vs {
- h.Add(k, v)
- }
- }
- }
- return h
- }
-
- // 1. create a client encrypted object to copy by uploading
- const srcSize = 1024 * 1024
- buf := bytes.Repeat([]byte("abcde"), srcSize) // gives a buffer of 5MiB
- metadata := make(http.Header)
- metadata.Set("x-amz-meta-myheader", "myvalue")
- m := make(map[string]string)
- m["x-amz-meta-myheader"] = "myvalue"
- _, err = c.PutObject(bucketName, "srcObject",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{UserMetadata: m})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithMetadata failed", err)
- return
- }
- if !reflect.DeepEqual(metadata, fetchMeta("srcObject")) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- // 2. create source
- src := minio.NewSourceInfo(bucketName, "srcObject", nil)
- // 2.1 create destination with metadata set
- dst1, err := minio.NewDestinationInfo(bucketName, "dstObject-1", nil, map[string]string{"notmyheader": "notmyvalue"})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- // 3. Check that copying to an object with metadata set resets
- // the headers on the copy.
- args["source"] = src
- args["destination"] = dst1
- err = c.CopyObject(dst1, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- expectedHeaders := make(http.Header)
- expectedHeaders.Set("x-amz-meta-notmyheader", "notmyvalue")
- if !reflect.DeepEqual(expectedHeaders, fetchMeta("dstObject-1")) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- // 4. create destination with no metadata set and same source
- dst2, err := minio.NewDestinationInfo(bucketName, "dstObject-2", nil, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
- src = minio.NewSourceInfo(bucketName, "srcObject", nil)
-
- // 5. Check that copying to an object with no metadata set,
- // copies metadata.
- args["source"] = src
- args["destination"] = dst2
- err = c.CopyObject(dst2, src)
- if err != nil {
- logError(testName, function, args, startTime, "", "CopyObject failed", err)
- return
- }
-
- expectedHeaders = metadata
- if !reflect.DeepEqual(expectedHeaders, fetchMeta("dstObject-2")) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- // 6. Compose a pair of sources.
- srcs := []minio.SourceInfo{
- minio.NewSourceInfo(bucketName, "srcObject", nil),
- minio.NewSourceInfo(bucketName, "srcObject", nil),
- }
- dst3, err := minio.NewDestinationInfo(bucketName, "dstObject-3", nil, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- function = "ComposeObject(destination, sources)"
- args["source"] = srcs
- args["destination"] = dst3
- err = c.ComposeObject(dst3, srcs)
- if err != nil {
- logError(testName, function, args, startTime, "", "ComposeObject failed", err)
- return
- }
-
- // Check that no headers are copied in this case
- if !reflect.DeepEqual(make(http.Header), fetchMeta("dstObject-3")) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- // 7. Compose a pair of sources with dest user metadata set.
- srcs = []minio.SourceInfo{
- minio.NewSourceInfo(bucketName, "srcObject", nil),
- minio.NewSourceInfo(bucketName, "srcObject", nil),
- }
- dst4, err := minio.NewDestinationInfo(bucketName, "dstObject-4", nil, map[string]string{"notmyheader": "notmyvalue"})
- if err != nil {
- logError(testName, function, args, startTime, "", "NewDestinationInfo failed", err)
- return
- }
-
- function = "ComposeObject(destination, sources)"
- args["source"] = srcs
- args["destination"] = dst4
- err = c.ComposeObject(dst4, srcs)
- if err != nil {
- logError(testName, function, args, startTime, "", "ComposeObject failed", err)
- return
- }
-
- // Check that no headers are copied in this case
- expectedHeaders = make(http.Header)
- expectedHeaders.Set("x-amz-meta-notmyheader", "notmyvalue")
- if !reflect.DeepEqual(expectedHeaders, fetchMeta("dstObject-4")) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testUserMetadataCopyingV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "CopyObject(destination, source)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // c.TraceOn(os.Stderr)
- testUserMetadataCopyingWrapper(c)
-}
-
-func testStorageClassMetadataPutObject() {
- // initialize logging params
- startTime := time.Now()
- function := "testStorageClassMetadataPutObject()"
- args := map[string]interface{}{}
- testName := getFuncName()
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- fetchMeta := func(object string) (h http.Header) {
- objInfo, err := c.StatObject(bucketName, object, minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- h = make(http.Header)
- for k, vs := range objInfo.Metadata {
- if strings.HasPrefix(strings.ToLower(k), "x-amz-storage-class") {
- for _, v := range vs {
- h.Add(k, v)
- }
- }
- }
- return h
- }
-
- metadata := make(http.Header)
- metadata.Set("x-amz-storage-class", "REDUCED_REDUNDANCY")
-
- emptyMetadata := make(http.Header)
-
- const srcSize = 1024 * 1024
- buf := bytes.Repeat([]byte("abcde"), srcSize) // gives a buffer of 1MiB
-
- _, err = c.PutObject(bucketName, "srcObjectRRSClass",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{StorageClass: "REDUCED_REDUNDANCY"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // Get the returned metadata
- returnedMeta := fetchMeta("srcObjectRRSClass")
-
- // The response metada should either be equal to metadata (with REDUCED_REDUNDANCY) or emptyMetadata (in case of gateways)
- if !reflect.DeepEqual(metadata, returnedMeta) && !reflect.DeepEqual(emptyMetadata, returnedMeta) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- metadata = make(http.Header)
- metadata.Set("x-amz-storage-class", "STANDARD")
-
- _, err = c.PutObject(bucketName, "srcObjectSSClass",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{StorageClass: "STANDARD"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- if reflect.DeepEqual(metadata, fetchMeta("srcObjectSSClass")) {
- logError(testName, function, args, startTime, "", "Metadata verification failed, STANDARD storage class should not be a part of response metadata", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testStorageClassInvalidMetadataPutObject() {
- // initialize logging params
- startTime := time.Now()
- function := "testStorageClassInvalidMetadataPutObject()"
- args := map[string]interface{}{}
- testName := getFuncName()
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- const srcSize = 1024 * 1024
- buf := bytes.Repeat([]byte("abcde"), srcSize) // gives a buffer of 1MiB
-
- _, err = c.PutObject(bucketName, "srcObjectRRSClass",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{StorageClass: "INVALID_STORAGE_CLASS"})
- if err == nil {
- logError(testName, function, args, startTime, "", "PutObject with invalid storage class passed, was expected to fail", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-func testStorageClassMetadataCopyObject() {
- // initialize logging params
- startTime := time.Now()
- function := "testStorageClassMetadataCopyObject()"
- args := map[string]interface{}{}
- testName := getFuncName()
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO v4 client object creation failed", err)
- return
- }
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test")
- // Make a new bucket in 'us-east-1' (source bucket).
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- fetchMeta := func(object string) (h http.Header) {
- objInfo, err := c.StatObject(bucketName, object, minio.StatObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "Stat failed", err)
- return
- }
- h = make(http.Header)
- for k, vs := range objInfo.Metadata {
- if strings.HasPrefix(strings.ToLower(k), "x-amz-storage-class") {
- for _, v := range vs {
- h.Add(k, v)
- }
- }
- }
- return h
- }
-
- metadata := make(http.Header)
- metadata.Set("x-amz-storage-class", "REDUCED_REDUNDANCY")
-
- emptyMetadata := make(http.Header)
-
- const srcSize = 1024 * 1024
- buf := bytes.Repeat([]byte("abcde"), srcSize)
-
- // Put an object with RRS Storage class
- _, err = c.PutObject(bucketName, "srcObjectRRSClass",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{StorageClass: "REDUCED_REDUNDANCY"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // Make server side copy of object uploaded in previous step
- src := minio.NewSourceInfo(bucketName, "srcObjectRRSClass", nil)
- dst, err := minio.NewDestinationInfo(bucketName, "srcObjectRRSClassCopy", nil, nil)
- c.CopyObject(dst, src)
-
- // Get the returned metadata
- returnedMeta := fetchMeta("srcObjectRRSClassCopy")
-
- // The response metada should either be equal to metadata (with REDUCED_REDUNDANCY) or emptyMetadata (in case of gateways)
- if !reflect.DeepEqual(metadata, returnedMeta) && !reflect.DeepEqual(emptyMetadata, returnedMeta) {
- logError(testName, function, args, startTime, "", "Metadata match failed", err)
- return
- }
-
- metadata = make(http.Header)
- metadata.Set("x-amz-storage-class", "STANDARD")
-
- // Put an object with Standard Storage class
- _, err = c.PutObject(bucketName, "srcObjectSSClass",
- bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{StorageClass: "STANDARD"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // Make server side copy of object uploaded in previous step
- src = minio.NewSourceInfo(bucketName, "srcObjectSSClass", nil)
- dst, err = minio.NewDestinationInfo(bucketName, "srcObjectSSClassCopy", nil, nil)
- c.CopyObject(dst, src)
-
- // Fetch the meta data of copied object
- if reflect.DeepEqual(metadata, fetchMeta("srcObjectSSClassCopy")) {
- logError(testName, function, args, startTime, "", "Metadata verification failed, STANDARD storage class should not be a part of response metadata", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test put object with size -1 byte object.
-func testPutObjectNoLengthV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, size, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "size": -1,
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- objectName := bucketName + "unique"
- args["objectName"] = objectName
-
- bufSize := dataFileMap["datafile-129-MB"]
- var reader = getDataReader("datafile-129-MB")
- defer reader.Close()
- args["size"] = bufSize
-
- // Upload an object.
- n, err := c.PutObject(bucketName, objectName, reader, -1, minio.PutObjectOptions{})
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithSize failed", err)
- return
- }
- if n != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Expected upload object size "+string(bufSize)+" got "+string(n), err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test put objects of unknown size.
-func testPutObjectsUnknownV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader,size,opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "size": "",
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Issues are revealed by trying to upload multiple files of unknown size
- // sequentially (on 4GB machines)
- for i := 1; i <= 4; i++ {
- // Simulate that we could be receiving byte slices of data that we want
- // to upload as a file
- rpipe, wpipe := io.Pipe()
- defer rpipe.Close()
- go func() {
- b := []byte("test")
- wpipe.Write(b)
- wpipe.Close()
- }()
-
- // Upload the object.
- objectName := fmt.Sprintf("%sunique%d", bucketName, i)
- args["objectName"] = objectName
-
- n, err := c.PutObject(bucketName, objectName, rpipe, -1, minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectStreaming failed", err)
- return
- }
- args["size"] = n
- if n != int64(4) {
- logError(testName, function, args, startTime, "", "Expected upload object size "+string(4)+" got "+string(n), err)
- return
- }
-
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test put object with 0 byte object.
-func testPutObject0ByteV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObject(bucketName, objectName, reader, size, opts)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- "size": 0,
- "opts": "",
- }
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- objectName := bucketName + "unique"
- args["objectName"] = objectName
- args["opts"] = minio.PutObjectOptions{}
-
- // Upload an object.
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader([]byte("")), 0, minio.PutObjectOptions{})
-
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithSize failed", err)
- return
- }
- if n != 0 {
- logError(testName, function, args, startTime, "", "Expected upload object size 0 but got "+string(n), err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test expected error cases
-func testComposeObjectErrorCases() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- testComposeObjectErrorCasesWrapper(c)
-}
-
-// Test concatenating 10K objects
-func testCompose10KSources() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ComposeObject(destination, sourceList)"
- args := map[string]interface{}{}
-
- // Instantiate new minio client object
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
- return
- }
-
- testComposeMultipleSources(c)
-}
-
-// Tests comprehensive list of all methods.
-func testFunctionalV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "testFunctionalV2()"
- functionAll := ""
- args := map[string]interface{}{}
-
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable to debug
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- location := "us-east-1"
- // Make a new bucket.
- function = "MakeBucket(bucketName, location)"
- functionAll = "MakeBucket(bucketName, location)"
- args = map[string]interface{}{
- "bucketName": bucketName,
- "location": location,
- }
- err = c.MakeBucket(bucketName, location)
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- // Generate a random file name.
- fileName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- file, err := os.Create(fileName)
- if err != nil {
- logError(testName, function, args, startTime, "", "file create failed", err)
- return
- }
- for i := 0; i < 3; i++ {
- buf := make([]byte, rand.Intn(1<<19))
- _, err = file.Write(buf)
- if err != nil {
- logError(testName, function, args, startTime, "", "file write failed", err)
- return
- }
- }
- file.Close()
-
- // Verify if bucket exits and you have access.
- var exists bool
- function = "BucketExists(bucketName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- }
- exists, err = c.BucketExists(bucketName)
- if err != nil {
- logError(testName, function, args, startTime, "", "BucketExists failed", err)
- return
- }
- if !exists {
- logError(testName, function, args, startTime, "", "Could not find existing bucket "+bucketName, err)
- return
- }
-
- // Make the bucket 'public read/write'.
- function = "SetBucketPolicy(bucketName, bucketPolicy)"
- functionAll += ", " + function
-
- readWritePolicy := `{"Version": "2012-10-17","Statement": [{"Action": ["s3:ListBucketMultipartUploads", "s3:ListBucket"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::` + bucketName + `"],"Sid": ""}]}`
-
- args = map[string]interface{}{
- "bucketName": bucketName,
- "bucketPolicy": readWritePolicy,
- }
- err = c.SetBucketPolicy(bucketName, readWritePolicy)
-
- if err != nil {
- logError(testName, function, args, startTime, "", "SetBucketPolicy failed", err)
- return
- }
-
- // List all buckets.
- function = "ListBuckets()"
- functionAll += ", " + function
- args = nil
- buckets, err := c.ListBuckets()
- if len(buckets) == 0 {
- logError(testName, function, args, startTime, "", "List buckets cannot be empty", err)
- return
- }
- if err != nil {
- logError(testName, function, args, startTime, "", "ListBuckets failed", err)
- return
- }
-
- // Verify if previously created bucket is listed in list buckets.
- bucketFound := false
- for _, bucket := range buckets {
- if bucket.Name == bucketName {
- bucketFound = true
- }
- }
-
- // If bucket not found error out.
- if !bucketFound {
- logError(testName, function, args, startTime, "", "Bucket "+bucketName+"not found", err)
- return
- }
-
- objectName := bucketName + "unique"
-
- // Generate data
- buf := bytes.Repeat([]byte("n"), rand.Intn(1<<19))
-
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "contentType": "",
- }
- n, err := c.PutObject(bucketName, objectName, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
- if n != int64(len(buf)) {
- logError(testName, function, args, startTime, "", "Expected uploaded object length "+string(len(buf))+" got "+string(n), err)
- return
- }
-
- objectNameNoLength := objectName + "-nolength"
- args["objectName"] = objectNameNoLength
- n, err = c.PutObject(bucketName, objectNameNoLength, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- if n != int64(len(buf)) {
- logError(testName, function, args, startTime, "", "Expected uploaded object length "+string(len(buf))+" got "+string(n), err)
- return
- }
-
- // Instantiate a done channel to close all listing.
- doneCh := make(chan struct{})
- defer close(doneCh)
-
- objFound := false
- isRecursive := true // Recursive is true.
- function = "ListObjects(bucketName, objectName, isRecursive, doneCh)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "isRecursive": isRecursive,
- }
- for obj := range c.ListObjects(bucketName, objectName, isRecursive, doneCh) {
- if obj.Key == objectName {
- objFound = true
- break
- }
- }
- if !objFound {
- logError(testName, function, args, startTime, "", "Could not find existing object "+objectName, err)
- return
- }
-
- incompObjNotFound := true
- function = "ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "isRecursive": isRecursive,
- }
- for objIncompl := range c.ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh) {
- if objIncompl.Key != "" {
- incompObjNotFound = false
- break
- }
- }
- if !incompObjNotFound {
- logError(testName, function, args, startTime, "", "Unexpected dangling incomplete upload found", err)
- return
- }
-
- function = "GetObject(bucketName, objectName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- }
- newReader, err := c.GetObject(bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- newReadBytes, err := ioutil.ReadAll(newReader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- newReader.Close()
-
- if !bytes.Equal(newReadBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch", err)
- return
- }
-
- function = "FGetObject(bucketName, objectName, fileName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "fileName": fileName + "-f",
- }
- err = c.FGetObject(bucketName, objectName, fileName+"-f", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FgetObject failed", err)
- return
- }
-
- // Generate presigned HEAD object url.
- function = "PresignedHeadObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "expires": 3600 * time.Second,
- }
- presignedHeadURL, err := c.PresignedHeadObject(bucketName, objectName, 3600*time.Second, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedHeadObject failed", err)
- return
- }
- // Verify if presigned url works.
- resp, err := http.Head(presignedHeadURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedHeadObject URL head request failed", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedHeadObject URL returns status "+string(resp.StatusCode), err)
- return
- }
- if resp.Header.Get("ETag") == "" {
- logError(testName, function, args, startTime, "", "Got empty ETag", err)
- return
- }
- resp.Body.Close()
-
- // Generate presigned GET object url.
- function = "PresignedGetObject(bucketName, objectName, expires, reqParams)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName,
- "expires": 3600 * time.Second,
- }
- presignedGetURL, err := c.PresignedGetObject(bucketName, objectName, 3600*time.Second, nil)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject failed", err)
- return
- }
- // Verify if presigned url works.
- resp, err = http.Get(presignedGetURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject URL GET request failed", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedGetObject URL returns status "+string(resp.StatusCode), err)
- return
- }
- newPresignedBytes, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- resp.Body.Close()
- if !bytes.Equal(newPresignedBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch", err)
- return
- }
-
- // Set request parameters.
- reqParams := make(url.Values)
- reqParams.Set("response-content-disposition", "attachment; filename=\"test.txt\"")
- // Generate presigned GET object url.
- args["reqParams"] = reqParams
- presignedGetURL, err = c.PresignedGetObject(bucketName, objectName, 3600*time.Second, reqParams)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject failed", err)
- return
- }
- // Verify if presigned url works.
- resp, err = http.Get(presignedGetURL.String())
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedGetObject URL GET request failed", err)
- return
- }
- if resp.StatusCode != http.StatusOK {
- logError(testName, function, args, startTime, "", "PresignedGetObject URL returns status "+string(resp.StatusCode), err)
- return
- }
- newPresignedBytes, err = ioutil.ReadAll(resp.Body)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- if !bytes.Equal(newPresignedBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch", err)
- return
- }
- // Verify content disposition.
- if resp.Header.Get("Content-Disposition") != "attachment; filename=\"test.txt\"" {
- logError(testName, function, args, startTime, "", "wrong Content-Disposition received ", err)
- return
- }
-
- function = "PresignedPutObject(bucketName, objectName, expires)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName + "-presigned",
- "expires": 3600 * time.Second,
- }
- presignedPutURL, err := c.PresignedPutObject(bucketName, objectName+"-presigned", 3600*time.Second)
- if err != nil {
- logError(testName, function, args, startTime, "", "PresignedPutObject failed", err)
- return
- }
-
- // Generate data more than 32K
- buf = bytes.Repeat([]byte("1"), rand.Intn(1<<10)+32*1024)
-
- req, err := http.NewRequest("PUT", presignedPutURL.String(), bytes.NewReader(buf))
- if err != nil {
- logError(testName, function, args, startTime, "", "HTTP request to PresignedPutObject URL failed", err)
- return
- }
- httpClient := &http.Client{
- // Setting a sensible time out of 30secs to wait for response
- // headers. Request is pro-actively cancelled after 30secs
- // with no response.
- Timeout: 30 * time.Second,
- Transport: http.DefaultTransport,
- }
- resp, err = httpClient.Do(req)
- if err != nil {
- logError(testName, function, args, startTime, "", "HTTP request to PresignedPutObject URL failed", err)
- return
- }
-
- function = "GetObject(bucketName, objectName)"
- functionAll += ", " + function
- args = map[string]interface{}{
- "bucketName": bucketName,
- "objectName": objectName + "-presigned",
- }
- newReader, err = c.GetObject(bucketName, objectName+"-presigned", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObject failed", err)
- return
- }
-
- newReadBytes, err = ioutil.ReadAll(newReader)
- if err != nil {
- logError(testName, function, args, startTime, "", "ReadAll failed", err)
- return
- }
- newReader.Close()
-
- if !bytes.Equal(newReadBytes, buf) {
- logError(testName, function, args, startTime, "", "Bytes mismatch", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- if err = os.Remove(fileName); err != nil {
- logError(testName, function, args, startTime, "", "File remove failed", err)
- return
- }
- if err = os.Remove(fileName + "-f"); err != nil {
- logError(testName, function, args, startTime, "", "File removes failed", err)
- return
- }
- successLogger(testName, functionAll, args, startTime).Info()
-}
-
-// Test get object with GetObjectWithContext
-func testGetObjectWithContext() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObjectWithContext(ctx, bucketName, objectName)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- _, err = c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- r, err := c.GetObjectWithContext(ctx, bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext failed unexpectedly", err)
- return
- }
-
- if _, err = r.Stat(); err == nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext should fail on short timeout", err)
- return
- }
- r.Close()
-
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- args["ctx"] = ctx
- defer cancel()
-
- // Read the data back
- r, err = c.GetObjectWithContext(ctx, bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext failed", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "object Stat call failed", err)
- return
- }
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match: want "+string(bufSize)+", got"+string(st.Size), err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", "object Close() call failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test get object with FGetObjectWithContext
-func testFGetObjectWithContext() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FGetObjectWithContext(ctx, bucketName, objectName, fileName)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-1-MB"]
- var reader = getDataReader("datafile-1-MB")
- defer reader.Close()
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- _, err = c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- fileName := "tempfile-context"
- args["fileName"] = fileName
- // Read the data back
- err = c.FGetObjectWithContext(ctx, bucketName, objectName, fileName+"-f", minio.GetObjectOptions{})
- if err == nil {
- logError(testName, function, args, startTime, "", "FGetObjectWithContext should fail on short timeout", err)
- return
- }
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- defer cancel()
-
- // Read the data back
- err = c.FGetObjectWithContext(ctx, bucketName, objectName, fileName+"-fcontext", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FGetObjectWithContext with long timeout failed", err)
- return
- }
- if err = os.Remove(fileName + "-fcontext"); err != nil {
- logError(testName, function, args, startTime, "", "Remove file failed", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test get object ACLs with GetObjectACL
-func testGetObjectACL() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObjectACL(bucketName, objectName)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectName": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // skipping region functional tests for non s3 runs
- if os.Getenv(serverEndpoint) != "s3.amazonaws.com" {
- ignoredLog(testName, function, args, startTime, "Skipped region functional tests for non s3 runs").Info()
- return
- }
-
- // Instantiate new minio client object.
- c, err := minio.NewV4(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-1-MB"]
- var reader = getDataReader("datafile-1-MB")
- defer reader.Close()
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Add meta data to add a canned acl
- metaData := map[string]string{
- "X-Amz-Acl": "public-read-write",
- }
-
- _, err = c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream", UserMetadata: metaData})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // Read the data back
- objectInfo, getObjectACLErr := c.GetObjectACL(bucketName, objectName)
- if getObjectACLErr == nil {
- logError(testName, function, args, startTime, "", "GetObjectACL fail", getObjectACLErr)
- return
- }
-
- s, ok := objectInfo.Metadata["X-Amz-Acl"]
- if !ok {
- logError(testName, function, args, startTime, "", "GetObjectACL fail unable to find \"X-Amz-Acl\"", nil)
- return
- }
-
- if len(s) != 1 {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Acl\" canned acl expected \"1\" got "+fmt.Sprintf(`"%d"`, len(s)), nil)
- return
- }
-
- if s[0] != "public-read-write" {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Acl\" expected \"public-read-write\" but got"+fmt.Sprintf("%q", s[0]), nil)
- return
- }
-
- bufSize = dataFileMap["datafile-1-MB"]
- var reader2 = getDataReader("datafile-1-MB")
- defer reader2.Close()
- // Save the data
- objectName = randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- // Add meta data to add a canned acl
- metaData = map[string]string{
- "X-Amz-Grant-Read": "id=fooread@minio.go",
- "X-Amz-Grant-Write": "id=foowrite@minio.go",
- }
-
- _, err = c.PutObject(bucketName, objectName, reader2, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream", UserMetadata: metaData})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject failed", err)
- return
- }
-
- // Read the data back
- objectInfo, getObjectACLErr = c.GetObjectACL(bucketName, objectName)
- if getObjectACLErr == nil {
- logError(testName, function, args, startTime, "", "GetObjectACL fail", getObjectACLErr)
- return
- }
-
- if len(objectInfo.Metadata) != 3 {
- logError(testName, function, args, startTime, "", "GetObjectACL fail expected \"3\" ACLs but got "+fmt.Sprintf(`"%d"`, len(objectInfo.Metadata)), nil)
- return
- }
-
- s, ok = objectInfo.Metadata["X-Amz-Grant-Read"]
- if !ok {
- logError(testName, function, args, startTime, "", "GetObjectACL fail unable to find \"X-Amz-Grant-Read\"", nil)
- return
- }
-
- if len(s) != 1 {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Grant-Read\" acl expected \"1\" got "+fmt.Sprintf(`"%d"`, len(s)), nil)
- return
- }
-
- if s[0] != "fooread@minio.go" {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Grant-Read\" acl expected \"fooread@minio.go\" got "+fmt.Sprintf("%q", s), nil)
- return
- }
-
- s, ok = objectInfo.Metadata["X-Amz-Grant-Write"]
- if !ok {
- logError(testName, function, args, startTime, "", "GetObjectACL fail unable to find \"X-Amz-Grant-Write\"", nil)
- return
- }
-
- if len(s) != 1 {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Grant-Write\" acl expected \"1\" got "+fmt.Sprintf(`"%d"`, len(s)), nil)
- return
- }
-
- if s[0] != "foowrite@minio.go" {
- logError(testName, function, args, startTime, "", "GetObjectACL fail \"X-Amz-Grant-Write\" acl expected \"foowrite@minio.go\" got "+fmt.Sprintf("%q", s), nil)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-}
-
-// Test validates putObject with context to see if request cancellation is honored for V2.
-func testPutObjectWithContextV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "PutObjectWithContext(ctx, bucketName, objectName, reader, size, opts)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- "size": "",
- "opts": "",
- }
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Make a new bucket.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
- defer c.RemoveBucket(bucketName)
- bufSize := dataFileMap["datatfile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- objectName := fmt.Sprintf("test-file-%v", rand.Uint32())
- args["objectName"] = objectName
-
- ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
- args["ctx"] = ctx
- args["size"] = bufSize
- defer cancel()
-
- _, err = c.PutObjectWithContext(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithContext with short timeout failed", err)
- return
- }
-
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- args["ctx"] = ctx
-
- defer cancel()
- reader = getDataReader("datafile-33-kB")
- defer reader.Close()
- _, err = c.PutObjectWithContext(ctx, bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObjectWithContext with long timeout failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test get object with GetObjectWithContext
-func testGetObjectWithContextV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "GetObjectWithContext(ctx, bucketName, objectName)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- _, err = c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- return
- }
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- r, err := c.GetObjectWithContext(ctx, bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext failed unexpectedly", err)
- return
- }
- if _, err = r.Stat(); err == nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext should fail on short timeout", err)
- return
- }
- r.Close()
-
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- defer cancel()
-
- // Read the data back
- r, err = c.GetObjectWithContext(ctx, bucketName, objectName, minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "GetObjectWithContext shouldn't fail on longer timeout", err)
- return
- }
-
- st, err := r.Stat()
- if err != nil {
- logError(testName, function, args, startTime, "", "object Stat call failed", err)
- return
- }
- if st.Size != int64(bufSize) {
- logError(testName, function, args, startTime, "", "Number of bytes in stat does not match, expected "+string(bufSize)+" got "+string(st.Size), err)
- return
- }
- if err := r.Close(); err != nil {
- logError(testName, function, args, startTime, "", " object Close() call failed", err)
- return
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test get object with FGetObjectWithContext
-func testFGetObjectWithContextV2() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "FGetObjectWithContext(ctx, bucketName, objectName,fileName)"
- args := map[string]interface{}{
- "ctx": "",
- "bucketName": "",
- "objectName": "",
- "fileName": "",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.NewV2(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v2 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket call failed", err)
- return
- }
-
- bufSize := dataFileMap["datatfile-1-MB"]
- var reader = getDataReader("datafile-1-MB")
- defer reader.Close()
- // Save the data
- objectName := randString(60, rand.NewSource(time.Now().UnixNano()), "")
- args["objectName"] = objectName
-
- _, err = c.PutObject(bucketName, objectName, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject call failed", err)
- return
- }
-
- ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
- args["ctx"] = ctx
- defer cancel()
-
- fileName := "tempfile-context"
- args["fileName"] = fileName
-
- // Read the data back
- err = c.FGetObjectWithContext(ctx, bucketName, objectName, fileName+"-f", minio.GetObjectOptions{})
- if err == nil {
- logError(testName, function, args, startTime, "", "FGetObjectWithContext should fail on short timeout", err)
- return
- }
- ctx, cancel = context.WithTimeout(context.Background(), 1*time.Hour)
- defer cancel()
-
- // Read the data back
- err = c.FGetObjectWithContext(ctx, bucketName, objectName, fileName+"-fcontext", minio.GetObjectOptions{})
- if err != nil {
- logError(testName, function, args, startTime, "", "FGetObjectWithContext call shouldn't fail on long timeout", err)
- return
- }
-
- if err = os.Remove(fileName + "-fcontext"); err != nil {
- logError(testName, function, args, startTime, "", "Remove file failed", err)
- return
- }
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Test list object v1 and V2 storage class fields
-func testListObjects() {
- // initialize logging params
- startTime := time.Now()
- testName := getFuncName()
- function := "ListObjects(bucketName, objectPrefix, recursive, doneCh)"
- args := map[string]interface{}{
- "bucketName": "",
- "objectPrefix": "",
- "recursive": "true",
- }
- // Seed random based on current time.
- rand.Seed(time.Now().Unix())
-
- // Instantiate new minio client object.
- c, err := minio.New(
- os.Getenv(serverEndpoint),
- os.Getenv(accessKey),
- os.Getenv(secretKey),
- mustParseBool(os.Getenv(enableHTTPS)),
- )
- if err != nil {
- logError(testName, function, args, startTime, "", "MinIO client v4 object creation failed", err)
- return
- }
-
- // Enable tracing, write to stderr.
- // c.TraceOn(os.Stderr)
-
- // Set user agent.
- c.SetAppInfo("MinIO-go-FunctionalTest", "0.1.0")
-
- // Generate a new random bucket name.
- bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
- args["bucketName"] = bucketName
-
- // Make a new bucket.
- err = c.MakeBucket(bucketName, "us-east-1")
- if err != nil {
- logError(testName, function, args, startTime, "", "MakeBucket failed", err)
- return
- }
-
- bufSize := dataFileMap["datafile-33-kB"]
- var reader = getDataReader("datafile-33-kB")
- defer reader.Close()
-
- // Save the data
- objectName1 := randString(60, rand.NewSource(time.Now().UnixNano()), "")
-
- _, err = c.PutObject(bucketName, objectName1, reader, int64(bufSize), minio.PutObjectOptions{ContentType: "binary/octet-stream", StorageClass: "STANDARD"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject1 call failed", err)
- return
- }
-
- bufSize1 := dataFileMap["datafile-33-kB"]
- var reader1 = getDataReader("datafile-33-kB")
- defer reader1.Close()
- objectName2 := randString(60, rand.NewSource(time.Now().UnixNano()), "")
-
- _, err = c.PutObject(bucketName, objectName2, reader1, int64(bufSize1), minio.PutObjectOptions{ContentType: "binary/octet-stream", StorageClass: "REDUCED_REDUNDANCY"})
- if err != nil {
- logError(testName, function, args, startTime, "", "PutObject2 call failed", err)
- return
- }
-
- // Create a done channel to control 'ListObjects' go routine.
- doneCh := make(chan struct{})
- // Exit cleanly upon return.
- defer close(doneCh)
-
- // check for storage-class from ListObjects result
- for objInfo := range c.ListObjects(bucketName, "", true, doneCh) {
- if objInfo.Err != nil {
- logError(testName, function, args, startTime, "", "ListObjects failed unexpectedly", err)
- return
- }
- if objInfo.Key == objectName1 && objInfo.StorageClass != "STANDARD" {
- // Ignored as Gateways (Azure/GCS etc) wont return storage class
- ignoredLog(testName, function, args, startTime, "ListObjects doesn't return expected storage class").Info()
- }
- if objInfo.Key == objectName2 && objInfo.StorageClass != "REDUCED_REDUNDANCY" {
- // Ignored as Gateways (Azure/GCS etc) wont return storage class
- ignoredLog(testName, function, args, startTime, "ListObjects doesn't return expected storage class").Info()
- }
- }
-
- // check for storage-class from ListObjectsV2 result
- for objInfo := range c.ListObjectsV2(bucketName, "", true, doneCh) {
- if objInfo.Err != nil {
- logError(testName, function, args, startTime, "", "ListObjectsV2 failed unexpectedly", err)
- return
- }
- if objInfo.Key == objectName1 && objInfo.StorageClass != "STANDARD" {
- // Ignored as Gateways (Azure/GCS etc) wont return storage class
- ignoredLog(testName, function, args, startTime, "ListObjectsV2 doesn't return expected storage class").Info()
- }
- if objInfo.Key == objectName2 && objInfo.StorageClass != "REDUCED_REDUNDANCY" {
- // Ignored as Gateways (Azure/GCS etc) wont return storage class
- ignoredLog(testName, function, args, startTime, "ListObjectsV2 doesn't return expected storage class").Info()
- }
- }
-
- // Delete all objects and buckets
- if err = cleanupBucket(bucketName, c); err != nil {
- logError(testName, function, args, startTime, "", "Cleanup failed", err)
- return
- }
-
- successLogger(testName, function, args, startTime).Info()
-
-}
-
-// Convert string to bool and always return false if any error
-func mustParseBool(str string) bool {
- b, err := strconv.ParseBool(str)
- if err != nil {
- return false
- }
- return b
-}
-
-func main() {
- // Output to stdout instead of the default stderr
- log.SetOutput(os.Stdout)
- // create custom formatter
- mintFormatter := mintJSONFormatter{}
- // set custom formatter
- log.SetFormatter(&mintFormatter)
- // log Info or above -- success cases are Info level, failures are Fatal level
- log.SetLevel(log.InfoLevel)
-
- tls := mustParseBool(os.Getenv(enableHTTPS))
- kmsEnabled := mustParseBool(os.Getenv(enableKMS))
- // execute tests
- if isFullMode() {
- testMakeBucketErrorV2()
- testGetObjectClosedTwiceV2()
- testFPutObjectV2()
- testMakeBucketRegionsV2()
- testGetObjectReadSeekFunctionalV2()
- testGetObjectReadAtFunctionalV2()
- testCopyObjectV2()
- testFunctionalV2()
- testComposeObjectErrorCasesV2()
- testCompose10KSourcesV2()
- testUserMetadataCopyingV2()
- testPutObject0ByteV2()
- testPutObjectNoLengthV2()
- testPutObjectsUnknownV2()
- testGetObjectWithContextV2()
- testFPutObjectWithContextV2()
- testFGetObjectWithContextV2()
- testPutObjectWithContextV2()
- testMakeBucketError()
- testMakeBucketRegions()
- testPutObjectWithMetadata()
- testPutObjectReadAt()
- testPutObjectStreaming()
- testGetObjectSeekEnd()
- testGetObjectClosedTwice()
- testRemoveMultipleObjects()
- testFPutObjectMultipart()
- testFPutObject()
- testGetObjectReadSeekFunctional()
- testGetObjectReadAtFunctional()
- testGetObjectReadAtWhenEOFWasReached()
- testPresignedPostPolicy()
- testCopyObject()
- testComposeObjectErrorCases()
- testCompose10KSources()
- testUserMetadataCopying()
- testBucketNotification()
- testFunctional()
- testGetObjectModified()
- testPutObjectUploadSeekedObject()
- testGetObjectWithContext()
- testFPutObjectWithContext()
- testFGetObjectWithContext()
-
- testGetObjectACL()
-
- testPutObjectWithContext()
- testStorageClassMetadataPutObject()
- testStorageClassInvalidMetadataPutObject()
- testStorageClassMetadataCopyObject()
- testPutObjectWithContentLanguage()
- testListObjects()
-
- // SSE-C tests will only work over TLS connection.
- if tls {
- testSSECEncryptionPutGet()
- testSSECEncryptionFPut()
- testSSECEncryptedGetObjectReadAtFunctional()
- testSSECEncryptedGetObjectReadSeekFunctional()
- testEncryptedCopyObjectV2()
- testEncryptedSSECToSSECCopyObject()
- testEncryptedSSECToUnencryptedCopyObject()
- testUnencryptedToSSECCopyObject()
- testUnencryptedToUnencryptedCopyObject()
- testEncryptedEmptyObject()
- testDecryptedCopyObject()
- testSSECEncryptedToSSECCopyObjectPart()
- testSSECMultipartEncryptedToSSECCopyObjectPart()
- testSSECEncryptedToUnencryptedCopyPart()
- testUnencryptedToSSECCopyObjectPart()
- testUnencryptedToUnencryptedCopyPart()
- if kmsEnabled {
- testSSES3EncryptionPutGet()
- testSSES3EncryptionFPut()
- testSSES3EncryptedGetObjectReadAtFunctional()
- testSSES3EncryptedGetObjectReadSeekFunctional()
- testEncryptedSSECToSSES3CopyObject()
- testEncryptedSSES3ToSSECCopyObject()
- testEncryptedSSES3ToSSES3CopyObject()
- testEncryptedSSES3ToUnencryptedCopyObject()
- testUnencryptedToSSES3CopyObject()
- testSSECEncryptedToSSES3CopyObjectPart()
- testUnencryptedToSSES3CopyObjectPart()
- testSSES3EncryptedToSSECCopyObjectPart()
- testSSES3EncryptedToUnencryptedCopyPart()
- testSSES3EncryptedToSSES3CopyObjectPart()
- }
- }
- } else {
- testFunctional()
- testFunctionalV2()
- }
-}
diff --git a/vendor/github.com/minio/minio-go/v6/go.mod b/vendor/github.com/minio/minio-go/v6/go.mod
index 9d342468df..2dc189d1aa 100644
--- a/vendor/github.com/minio/minio-go/v6/go.mod
+++ b/vendor/github.com/minio/minio-go/v6/go.mod
@@ -3,10 +3,8 @@ module github.com/minio/minio-go/v6
go 1.12
require (
- github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
- github.com/gernest/wow v0.1.0 // indirect
- github.com/minio/cli v1.20.0 // indirect
+ github.com/minio/sha256-simd v0.1.1
github.com/mitchellh/go-homedir v1.1.0
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
diff --git a/vendor/github.com/minio/minio-go/v6/go.sum b/vendor/github.com/minio/minio-go/v6/go.sum
index 62a4f31fac..b3cacbda4d 100644
--- a/vendor/github.com/minio/minio-go/v6/go.sum
+++ b/vendor/github.com/minio/minio-go/v6/go.sum
@@ -1,18 +1,13 @@
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845 h1:hIjQrEARcc9LcH8igte3JBpWBZ7+SpinU70dOjU/afo=
-github.com/a8m/mark v0.1.1-0.20170507133748-44f2db618845/go.mod h1:c8Mh99Cw82nrsAnPgxQSZHkswVOJF7/MqZb1ZdvriLM=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/gernest/wow v0.1.0 h1:g9xdwCwP0+xgVYlA2sopI0gZHqXe7HjI/7/LykG4fks=
-github.com/gernest/wow v0.1.0/go.mod h1:dEPabJRi5BneI1Nev1VWo0ZlcTWibHWp43qxKms4elY=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/minio/cli v1.20.0 h1:OVNIt8Rg5+mpYb8siWT2gBV5hvUyFbRvBikC+Ytvf5A=
-github.com/minio/cli v1.20.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY=
+github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=
+github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -24,7 +19,6 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -32,7 +26,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/sys v0.0.0-20190116161447-11f53e031339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -41,8 +34,5 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/vendor/github.com/minio/minio-go/v6/pkg/credentials/sts_ldap_identity.go b/vendor/github.com/minio/minio-go/v6/pkg/credentials/sts_ldap_identity.go
new file mode 100644
index 0000000000..b72ac061c3
--- /dev/null
+++ b/vendor/github.com/minio/minio-go/v6/pkg/credentials/sts_ldap_identity.go
@@ -0,0 +1,119 @@
+/*
+ * MinIO Go Library for Amazon S3 Compatible Cloud Storage
+ * Copyright 2019 MinIO, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package credentials
+
+import (
+ "encoding/xml"
+ "errors"
+ "net/http"
+ "net/url"
+ "time"
+)
+
+// AssumeRoleWithLDAPResponse contains the result of successful
+// AssumeRoleWithLDAPIdentity request
+type AssumeRoleWithLDAPResponse struct {
+ XMLName xml.Name `xml:"https://sts.amazonaws.com/doc/2011-06-15/ AssumeRoleWithLDAPIdentityResponse" json:"-"`
+ Result LDAPIdentityResult `xml:"AssumeRoleWithLDAPIdentityResult"`
+ ResponseMetadata struct {
+ RequestID string `xml:"RequestId,omitempty"`
+ } `xml:"ResponseMetadata,omitempty"`
+}
+
+// LDAPIdentityResult - contains credentials for a successful
+// AssumeRoleWithLDAPIdentity request.
+type LDAPIdentityResult struct {
+ Credentials struct {
+ AccessKey string `xml:"AccessKeyId" json:"accessKey,omitempty"`
+ SecretKey string `xml:"SecretAccessKey" json:"secretKey,omitempty"`
+ Expiration time.Time `xml:"Expiration" json:"expiration,omitempty"`
+ SessionToken string `xml:"SessionToken" json:"sessionToken,omitempty"`
+ } `xml:",omitempty"`
+
+ SubjectFromToken string `xml:",omitempty"`
+}
+
+// LDAPIdentity retrieves credentials from MinIO
+type LDAPIdentity struct {
+ Expiry
+
+ stsEndpoint string
+
+ ldapUsername, ldapPassword string
+}
+
+// NewLDAPIdentity returns new credentials object that uses LDAP
+// Identity.
+func NewLDAPIdentity(stsEndpoint, ldapUsername, ldapPassword string) (*Credentials, error) {
+ return New(&LDAPIdentity{
+ stsEndpoint: stsEndpoint,
+ ldapUsername: ldapUsername,
+ ldapPassword: ldapPassword,
+ }), nil
+}
+
+// Retrieve gets the credential by calling the MinIO STS API for
+// LDAP on the configured stsEndpoint.
+func (k *LDAPIdentity) Retrieve() (value Value, err error) {
+ u, kerr := url.Parse(k.stsEndpoint)
+ if kerr != nil {
+ err = kerr
+ return
+ }
+
+ clnt := &http.Client{Transport: http.DefaultTransport}
+ v := url.Values{}
+ v.Set("Action", "AssumeRoleWithLDAPIdentity")
+ v.Set("Version", "2011-06-15")
+ v.Set("LDAPUsername", k.ldapUsername)
+ v.Set("LDAPPassword", k.ldapPassword)
+
+ u.RawQuery = v.Encode()
+
+ req, kerr := http.NewRequest("POST", u.String(), nil)
+ if kerr != nil {
+ err = kerr
+ return
+ }
+
+ resp, kerr := clnt.Do(req)
+ if kerr != nil {
+ err = kerr
+ return
+ }
+
+ defer resp.Body.Close()
+ if resp.StatusCode != http.StatusOK {
+ err = errors.New(resp.Status)
+ return
+ }
+
+ r := AssumeRoleWithLDAPResponse{}
+ if err = xml.NewDecoder(resp.Body).Decode(&r); err != nil {
+ return
+ }
+
+ cr := r.Result.Credentials
+ k.SetExpiration(cr.Expiration, DefaultExpiryWindow)
+ return Value{
+ AccessKeyID: cr.AccessKey,
+ SecretAccessKey: cr.SecretKey,
+ SessionToken: cr.SessionToken,
+ SignerType: SignatureV4,
+ }, nil
+}
diff --git a/vendor/github.com/minio/minio-go/v6/pkg/s3signer/utils.go b/vendor/github.com/minio/minio-go/v6/pkg/s3signer/utils.go
index d07ff6dec7..934e33a489 100644
--- a/vendor/github.com/minio/minio-go/v6/pkg/s3signer/utils.go
+++ b/vendor/github.com/minio/minio-go/v6/pkg/s3signer/utils.go
@@ -19,9 +19,10 @@ package s3signer
import (
"crypto/hmac"
- "crypto/sha256"
"net/http"
"strings"
+
+ "github.com/minio/sha256-simd"
)
// unsignedPayload - value to be set to X-Amz-Content-Sha256 header when
diff --git a/vendor/github.com/minio/minio-go/v6/utils.go b/vendor/github.com/minio/minio-go/v6/utils.go
index fc30c1ab7c..2a743a8346 100644
--- a/vendor/github.com/minio/minio-go/v6/utils.go
+++ b/vendor/github.com/minio/minio-go/v6/utils.go
@@ -19,7 +19,6 @@ package minio
import (
"crypto/md5"
- "crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/xml"
@@ -32,6 +31,8 @@ import (
"strings"
"time"
+ "github.com/minio/sha256-simd"
+
"github.com/minio/minio-go/v6/pkg/s3utils"
)
diff --git a/vendor/github.com/minio/sha256-simd/.gitignore b/vendor/github.com/minio/sha256-simd/.gitignore
new file mode 100644
index 0000000000..c56069fe26
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/.gitignore
@@ -0,0 +1 @@
+*.test
\ No newline at end of file
diff --git a/vendor/github.com/minio/sha256-simd/.travis.yml b/vendor/github.com/minio/sha256-simd/.travis.yml
new file mode 100644
index 0000000000..4f85db5397
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/.travis.yml
@@ -0,0 +1,25 @@
+sudo: required
+dist: trusty
+language: go
+
+os:
+- linux
+
+go:
+- tip
+- 1.12.x
+
+env:
+- ARCH=x86_64
+- ARCH=i686
+
+matrix:
+ fast_finish: true
+ allow_failures:
+ - go: tip
+
+script:
+- diff -au <(gofmt -d .) <(printf "")
+- go test -race -v ./...
+- go vet -asmdecl .
+- ./test-architectures.sh
diff --git a/vendor/github.com/minio/sha256-simd/LICENSE b/vendor/github.com/minio/sha256-simd/LICENSE
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/minio/sha256-simd/README.md b/vendor/github.com/minio/sha256-simd/README.md
new file mode 100644
index 0000000000..5282d83ad7
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/README.md
@@ -0,0 +1,133 @@
+# sha256-simd
+
+Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions and AVX2 for Intel and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core) in comparison to AVX2. SHA Extensions give a performance boost of close to 4x over AVX2.
+
+## Introduction
+
+This package is designed as a replacement for `crypto/sha256`. For Intel CPUs it has two flavors for AVX512 and AVX2 (AVX/SSE are also supported). For ARM CPUs with the Cryptography Extensions, advantage is taken of the SHA2 instructions resulting in a massive performance improvement.
+
+This package uses Golang assembly. The AVX512 version is based on the Intel's "multi-buffer crypto library for IPSec" whereas the other Intel implementations are described in "Fast SHA-256 Implementations on Intel Architecture Processors" by J. Guilford et al.
+
+## New: Support for Intel SHA Extensions
+
+Support for the Intel SHA Extensions has been added by Kristofer Peterson (@svenski123), originally developed for spacemeshos [here](https://github.com/spacemeshos/POET/issues/23). On CPUs that support it (known thus far Intel Celeron J3455 and AMD Ryzen) it gives a significant boost in performance (with thanks to @AudriusButkevicius for reporting the results; full results [here](https://github.com/minio/sha256-simd/pull/37#issuecomment-451607827)).
+
+```
+$ benchcmp avx2.txt sha-ext.txt
+benchmark AVX2 MB/s SHA Ext MB/s speedup
+BenchmarkHash5M 514.40 1975.17 3.84x
+```
+
+Thanks to Kristofer Peterson, we also added additional performance changes such as optimized padding, endian conversions which sped up all implementations i.e. Intel SHA alone while doubled performance for small sizes, the other changes increased everything roughly 50%.
+
+## Support for AVX512
+
+We have added support for AVX512 which results in an up to 8x performance improvement over AVX2 (3.0 GHz Xeon Platinum 8124M CPU):
+
+```
+$ benchcmp avx2.txt avx512.txt
+benchmark AVX2 MB/s AVX512 MB/s speedup
+BenchmarkHash5M 448.62 3498.20 7.80x
+```
+
+The original code was developed by Intel as part of the [multi-buffer crypto library](https://github.com/intel/intel-ipsec-mb) for IPSec or more specifically this [AVX512](https://github.com/intel/intel-ipsec-mb/blob/master/avx512/sha256_x16_avx512.asm) implementation. The key idea behind it is to process a total of 16 checksums in parallel by “transposing” 16 (independent) messages of 64 bytes between a total of 16 ZMM registers (each 64 bytes wide).
+
+Transposing the input messages means that in order to take full advantage of the speedup you need to have a (server) workload where multiple threads are doing SHA256 calculations in parallel. Unfortunately for this algorithm it is not possible for two message blocks processed in parallel to be dependent on one another — because then the (interim) result of the first part of the message has to be an input into the processing of the second part of the message.
+
+Whereas the original Intel C implementation requires some sort of explicit scheduling of messages to be processed in parallel, for Golang it makes sense to take advantage of channels in order to group messages together and use channels as well for sending back the results (thereby effectively decoupling the calculations). We have implemented a fairly simple scheduling mechanism that seems to work well in practice.
+
+Due to this different way of scheduling, we decided to use an explicit method to instantiate the AVX512 version. Essentially one or more AVX512 processing servers ([`Avx512Server`](https://github.com/minio/sha256-simd/blob/master/sha256blockAvx512_amd64.go#L294)) have to be created whereby each server can hash over 3 GB/s on a single core. An `hash.Hash` object ([`Avx512Digest`](https://github.com/minio/sha256-simd/blob/master/sha256blockAvx512_amd64.go#L45)) is then instantiated using one of these servers and used in the regular fashion:
+
+```go
+import "github.com/minio/sha256-simd"
+
+func main() {
+ server := sha256.NewAvx512Server()
+ h512 := sha256.NewAvx512(server)
+ h512.Write(fileBlock)
+ digest := h512.Sum([]byte{})
+}
+```
+
+Note that, because of the scheduling overhead, for small messages (< 1 MB) you will be better off using the regular SHA256 hashing (but those are typically not performance critical anyway). Some other tips to get the best performance:
+* Have many go routines doing SHA256 calculations in parallel.
+* Try to Write() messages in multiples of 64 bytes.
+* Try to keep the overall length of messages to a roughly similar size ie. 5 MB (this way all 16 ‘lanes’ in the AVX512 computations are contributing as much as possible).
+
+More detailed information can be found in this [blog](https://blog.minio.io/accelerate-sha256-up-to-8x-over-3-gb-s-per-core-with-avx512-a0b1d64f78f) post including scaling across cores.
+
+## Drop-In Replacement
+
+The following code snippet shows how you can use `github.com/minio/sha256-simd`. This will automatically select the fastest method for the architecture on which it will be executed.
+
+```go
+import "github.com/minio/sha256-simd"
+
+func main() {
+ ...
+ shaWriter := sha256.New()
+ io.Copy(shaWriter, file)
+ ...
+}
+```
+
+## Performance
+
+Below is the speed in MB/s for a single core (ranked fast to slow) for blocks larger than 1 MB.
+
+| Processor | SIMD | Speed (MB/s) |
+| --------------------------------- | ------- | ------------:|
+| 3.0 GHz Intel Xeon Platinum 8124M | AVX512 | 3498 |
+| 3.7 GHz AMD Ryzen 7 2700X | SHA Ext | 1979 |
+| 1.2 GHz ARM Cortex-A53 | ARM64 | 638 |
+| 3.0 GHz Intel Xeon Platinum 8124M | AVX2 | 449 |
+| 3.1 GHz Intel Core i7 | AVX | 362 |
+| 3.1 GHz Intel Core i7 | SSE | 299 |
+
+## asm2plan9s
+
+In order to be able to work more easily with AVX512/AVX2 instructions, a separate tool was developed to convert SIMD instructions into the corresponding BYTE sequence as accepted by Go assembly. See [asm2plan9s](https://github.com/minio/asm2plan9s) for more information.
+
+## Why and benefits
+
+One of the most performance sensitive parts of the [Minio](https://github.com/minio/minio) object storage server is related to SHA256 hash sums calculations. For instance during multi part uploads each part that is uploaded needs to be verified for data integrity by the server.
+
+Other applications that can benefit from enhanced SHA256 performance are deduplication in storage systems, intrusion detection, version control systems, integrity checking, etc.
+
+## ARM SHA Extensions
+
+The 64-bit ARMv8 core has introduced new instructions for SHA1 and SHA2 acceleration as part of the [Cryptography Extensions](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0501f/CHDFJBCJ.html). Below you can see a small excerpt highlighting one of the rounds as is done for the SHA256 calculation process (for full code see [sha256block_arm64.s](https://github.com/minio/sha256-simd/blob/master/sha256block_arm64.s)).
+
+ ```
+ sha256h q2, q3, v9.4s
+ sha256h2 q3, q4, v9.4s
+ sha256su0 v5.4s, v6.4s
+ rev32 v8.16b, v8.16b
+ add v9.4s, v7.4s, v18.4s
+ mov v4.16b, v2.16b
+ sha256h q2, q3, v10.4s
+ sha256h2 q3, q4, v10.4s
+ sha256su0 v6.4s, v7.4s
+ sha256su1 v5.4s, v7.4s, v8.4s
+ ```
+
+### Detailed benchmarks
+
+Benchmarks generated on a 1.2 Ghz Quad-Core ARM Cortex A53 equipped [Pine64](https://www.pine64.com/).
+
+```
+minio@minio-arm:$ benchcmp golang.txt arm64.txt
+benchmark golang arm64 speedup
+BenchmarkHash8Bytes-4 0.68 MB/s 5.70 MB/s 8.38x
+BenchmarkHash1K-4 5.65 MB/s 326.30 MB/s 57.75x
+BenchmarkHash8K-4 6.00 MB/s 570.63 MB/s 95.11x
+BenchmarkHash1M-4 6.05 MB/s 638.23 MB/s 105.49x
+```
+
+## License
+
+Released under the Apache License v2.0. You can find the complete text in the file LICENSE.
+
+## Contributing
+
+Contributions are welcome, please send PRs for any enhancements.
diff --git a/vendor/github.com/minio/sha256-simd/appveyor.yml b/vendor/github.com/minio/sha256-simd/appveyor.yml
new file mode 100644
index 0000000000..a66bfa9f22
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/appveyor.yml
@@ -0,0 +1,32 @@
+# version format
+version: "{build}"
+
+# Operating system (build VM template)
+os: Windows Server 2012 R2
+
+# Platform.
+platform: x64
+
+clone_folder: c:\gopath\src\github.com\minio\sha256-simd
+
+# environment variables
+environment:
+ GOPATH: c:\gopath
+ GO15VENDOREXPERIMENT: 1
+
+# scripts that run after cloning repository
+install:
+ - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
+ - go version
+ - go env
+
+# to run your custom scripts instead of automatic MSBuild
+build_script:
+ - go test .
+ - go test -race .
+
+# to disable automatic tests
+test: off
+
+# to disable deployment
+deploy: off
diff --git a/vendor/github.com/minio/sha256-simd/cpuid.go b/vendor/github.com/minio/sha256-simd/cpuid.go
new file mode 100644
index 0000000000..878ad4638c
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid.go
@@ -0,0 +1,119 @@
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package sha256
+
+// True when SIMD instructions are available.
+var avx512 bool
+var avx2 bool
+var avx bool
+var sse bool
+var sse2 bool
+var sse3 bool
+var ssse3 bool
+var sse41 bool
+var sse42 bool
+var popcnt bool
+var sha bool
+var armSha = haveArmSha()
+
+func init() {
+ var _xsave bool
+ var _osxsave bool
+ var _avx bool
+ var _avx2 bool
+ var _avx512f bool
+ var _avx512dq bool
+ // var _avx512pf bool
+ // var _avx512er bool
+ // var _avx512cd bool
+ var _avx512bw bool
+ var _avx512vl bool
+ var _sseState bool
+ var _avxState bool
+ var _opmaskState bool
+ var _zmmHI256State bool
+ var _hi16ZmmState bool
+
+ mfi, _, _, _ := cpuid(0)
+
+ if mfi >= 1 {
+ _, _, c, d := cpuid(1)
+
+ sse = (d & (1 << 25)) != 0
+ sse2 = (d & (1 << 26)) != 0
+ sse3 = (c & (1 << 0)) != 0
+ ssse3 = (c & (1 << 9)) != 0
+ sse41 = (c & (1 << 19)) != 0
+ sse42 = (c & (1 << 20)) != 0
+ popcnt = (c & (1 << 23)) != 0
+ _xsave = (c & (1 << 26)) != 0
+ _osxsave = (c & (1 << 27)) != 0
+ _avx = (c & (1 << 28)) != 0
+ }
+
+ if mfi >= 7 {
+ _, b, _, _ := cpuid(7)
+
+ _avx2 = (b & (1 << 5)) != 0
+ _avx512f = (b & (1 << 16)) != 0
+ _avx512dq = (b & (1 << 17)) != 0
+ // _avx512pf = (b & (1 << 26)) != 0
+ // _avx512er = (b & (1 << 27)) != 0
+ // _avx512cd = (b & (1 << 28)) != 0
+ _avx512bw = (b & (1 << 30)) != 0
+ _avx512vl = (b & (1 << 31)) != 0
+ sha = (b & (1 << 29)) != 0
+ }
+
+ // Stop here if XSAVE unsupported or not enabled
+ if !_xsave || !_osxsave {
+ return
+ }
+
+ if _xsave && _osxsave {
+ a, _ := xgetbv(0)
+
+ _sseState = (a & (1 << 1)) != 0
+ _avxState = (a & (1 << 2)) != 0
+ _opmaskState = (a & (1 << 5)) != 0
+ _zmmHI256State = (a & (1 << 6)) != 0
+ _hi16ZmmState = (a & (1 << 7)) != 0
+ } else {
+ _sseState = true
+ }
+
+ // Very unlikely that OS would enable XSAVE and then disable SSE
+ if !_sseState {
+ sse = false
+ sse2 = false
+ sse3 = false
+ ssse3 = false
+ sse41 = false
+ sse42 = false
+ }
+
+ if _avxState {
+ avx = _avx
+ avx2 = _avx2
+ }
+
+ if _opmaskState && _zmmHI256State && _hi16ZmmState {
+ avx512 = (_avx512f &&
+ _avx512dq &&
+ _avx512bw &&
+ _avx512vl)
+ }
+}
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_386.go b/vendor/github.com/minio/sha256-simd/cpuid_386.go
new file mode 100644
index 0000000000..c9890be478
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_386.go
@@ -0,0 +1,24 @@
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package sha256
+
+func cpuid(op uint32) (eax, ebx, ecx, edx uint32)
+func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
+func xgetbv(index uint32) (eax, edx uint32)
+
+func haveArmSha() bool {
+ return false
+}
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_386.s b/vendor/github.com/minio/sha256-simd/cpuid_386.s
new file mode 100644
index 0000000000..1511cd6f60
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_386.s
@@ -0,0 +1,53 @@
+// The MIT License (MIT)
+//
+// Copyright (c) 2015 Klaus Post
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+// +build 386,!gccgo
+
+// func cpuid(op uint32) (eax, ebx, ecx, edx uint32)
+TEXT ·cpuid(SB), 7, $0
+ XORL CX, CX
+ MOVL op+0(FP), AX
+ CPUID
+ MOVL AX, eax+4(FP)
+ MOVL BX, ebx+8(FP)
+ MOVL CX, ecx+12(FP)
+ MOVL DX, edx+16(FP)
+ RET
+
+// func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
+TEXT ·cpuidex(SB), 7, $0
+ MOVL op+0(FP), AX
+ MOVL op2+4(FP), CX
+ CPUID
+ MOVL AX, eax+8(FP)
+ MOVL BX, ebx+12(FP)
+ MOVL CX, ecx+16(FP)
+ MOVL DX, edx+20(FP)
+ RET
+
+// func xgetbv(index uint32) (eax, edx uint32)
+TEXT ·xgetbv(SB), 7, $0
+ MOVL index+0(FP), CX
+ BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV
+ MOVL AX, eax+4(FP)
+ MOVL DX, edx+8(FP)
+ RET
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_amd64.go b/vendor/github.com/minio/sha256-simd/cpuid_amd64.go
new file mode 100644
index 0000000000..c9890be478
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_amd64.go
@@ -0,0 +1,24 @@
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package sha256
+
+func cpuid(op uint32) (eax, ebx, ecx, edx uint32)
+func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
+func xgetbv(index uint32) (eax, edx uint32)
+
+func haveArmSha() bool {
+ return false
+}
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_amd64.s b/vendor/github.com/minio/sha256-simd/cpuid_amd64.s
new file mode 100644
index 0000000000..b0f414748a
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_amd64.s
@@ -0,0 +1,53 @@
+// The MIT License (MIT)
+//
+// Copyright (c) 2015 Klaus Post
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+// +build amd64,!gccgo
+
+// func cpuid(op uint32) (eax, ebx, ecx, edx uint32)
+TEXT ·cpuid(SB), 7, $0
+ XORQ CX, CX
+ MOVL op+0(FP), AX
+ CPUID
+ MOVL AX, eax+8(FP)
+ MOVL BX, ebx+12(FP)
+ MOVL CX, ecx+16(FP)
+ MOVL DX, edx+20(FP)
+ RET
+
+// func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
+TEXT ·cpuidex(SB), 7, $0
+ MOVL op+0(FP), AX
+ MOVL op2+4(FP), CX
+ CPUID
+ MOVL AX, eax+8(FP)
+ MOVL BX, ebx+12(FP)
+ MOVL CX, ecx+16(FP)
+ MOVL DX, edx+20(FP)
+ RET
+
+// func xgetbv(index uint32) (eax, edx uint32)
+TEXT ·xgetbv(SB), 7, $0
+ MOVL index+0(FP), CX
+ BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV
+ MOVL AX, eax+8(FP)
+ MOVL DX, edx+12(FP)
+ RET
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_arm.go b/vendor/github.com/minio/sha256-simd/cpuid_arm.go
new file mode 100644
index 0000000000..351dff4b6b
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_arm.go
@@ -0,0 +1,32 @@
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package sha256
+
+func cpuid(op uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func xgetbv(index uint32) (eax, edx uint32) {
+ return 0, 0
+}
+
+func haveArmSha() bool {
+ return false
+}
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_linux_arm64.go b/vendor/github.com/minio/sha256-simd/cpuid_linux_arm64.go
new file mode 100644
index 0000000000..e739996d91
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_linux_arm64.go
@@ -0,0 +1,49 @@
+// +build arm64,linux
+
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package sha256
+
+import (
+ "bytes"
+ "io/ioutil"
+)
+
+func cpuid(op uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func xgetbv(index uint32) (eax, edx uint32) {
+ return 0, 0
+}
+
+// File to check for cpu capabilities.
+const procCPUInfo = "/proc/cpuinfo"
+
+// Feature to check for.
+const sha256Feature = "sha2"
+
+func haveArmSha() bool {
+ cpuInfo, err := ioutil.ReadFile(procCPUInfo)
+ if err != nil {
+ return false
+ }
+ return bytes.Contains(cpuInfo, []byte(sha256Feature))
+}
diff --git a/vendor/github.com/minio/sha256-simd/cpuid_other.go b/vendor/github.com/minio/sha256-simd/cpuid_other.go
new file mode 100644
index 0000000000..3e44158282
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/cpuid_other.go
@@ -0,0 +1,34 @@
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// +build !386,!amd64,!arm,!arm64 arm64,!linux
+
+package sha256
+
+func cpuid(op uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) {
+ return 0, 0, 0, 0
+}
+
+func xgetbv(index uint32) (eax, edx uint32) {
+ return 0, 0
+}
+
+func haveArmSha() bool {
+ return false
+}
diff --git a/vendor/github.com/minio/sha256-simd/go.mod b/vendor/github.com/minio/sha256-simd/go.mod
new file mode 100644
index 0000000000..4451e9eb21
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/go.mod
@@ -0,0 +1,3 @@
+module github.com/minio/sha256-simd
+
+go 1.12
diff --git a/vendor/github.com/minio/sha256-simd/sha256.go b/vendor/github.com/minio/sha256-simd/sha256.go
new file mode 100644
index 0000000000..4e1f6d2f76
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256.go
@@ -0,0 +1,409 @@
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+import (
+ "crypto/sha256"
+ "encoding/binary"
+ "hash"
+ "runtime"
+)
+
+// Size - The size of a SHA256 checksum in bytes.
+const Size = 32
+
+// BlockSize - The blocksize of SHA256 in bytes.
+const BlockSize = 64
+
+const (
+ chunk = BlockSize
+ init0 = 0x6A09E667
+ init1 = 0xBB67AE85
+ init2 = 0x3C6EF372
+ init3 = 0xA54FF53A
+ init4 = 0x510E527F
+ init5 = 0x9B05688C
+ init6 = 0x1F83D9AB
+ init7 = 0x5BE0CD19
+)
+
+// digest represents the partial evaluation of a checksum.
+type digest struct {
+ h [8]uint32
+ x [chunk]byte
+ nx int
+ len uint64
+}
+
+// Reset digest back to default
+func (d *digest) Reset() {
+ d.h[0] = init0
+ d.h[1] = init1
+ d.h[2] = init2
+ d.h[3] = init3
+ d.h[4] = init4
+ d.h[5] = init5
+ d.h[6] = init6
+ d.h[7] = init7
+ d.nx = 0
+ d.len = 0
+}
+
+type blockfuncType int
+
+const (
+ blockfuncGeneric blockfuncType = iota
+ blockfuncAvx512 blockfuncType = iota
+ blockfuncAvx2 blockfuncType = iota
+ blockfuncAvx blockfuncType = iota
+ blockfuncSsse blockfuncType = iota
+ blockfuncSha blockfuncType = iota
+ blockfuncArm blockfuncType = iota
+)
+
+var blockfunc blockfuncType
+
+func init() {
+ is386bit := runtime.GOARCH == "386"
+ isARM := runtime.GOARCH == "arm"
+ switch {
+ case is386bit || isARM:
+ blockfunc = blockfuncGeneric
+ case sha && ssse3 && sse41:
+ blockfunc = blockfuncSha
+ case avx2:
+ blockfunc = blockfuncAvx2
+ case avx:
+ blockfunc = blockfuncAvx
+ case ssse3:
+ blockfunc = blockfuncSsse
+ case armSha:
+ blockfunc = blockfuncArm
+ default:
+ blockfunc = blockfuncGeneric
+ }
+}
+
+// New returns a new hash.Hash computing the SHA256 checksum.
+func New() hash.Hash {
+ if blockfunc != blockfuncGeneric {
+ d := new(digest)
+ d.Reset()
+ return d
+ }
+ // Fallback to the standard golang implementation
+ // if no features were found.
+ return sha256.New()
+}
+
+// Sum256 - single caller sha256 helper
+func Sum256(data []byte) (result [Size]byte) {
+ var d digest
+ d.Reset()
+ d.Write(data)
+ result = d.checkSum()
+ return
+}
+
+// Return size of checksum
+func (d *digest) Size() int { return Size }
+
+// Return blocksize of checksum
+func (d *digest) BlockSize() int { return BlockSize }
+
+// Write to digest
+func (d *digest) Write(p []byte) (nn int, err error) {
+ nn = len(p)
+ d.len += uint64(nn)
+ if d.nx > 0 {
+ n := copy(d.x[d.nx:], p)
+ d.nx += n
+ if d.nx == chunk {
+ block(d, d.x[:])
+ d.nx = 0
+ }
+ p = p[n:]
+ }
+ if len(p) >= chunk {
+ n := len(p) &^ (chunk - 1)
+ block(d, p[:n])
+ p = p[n:]
+ }
+ if len(p) > 0 {
+ d.nx = copy(d.x[:], p)
+ }
+ return
+}
+
+// Return sha256 sum in bytes
+func (d *digest) Sum(in []byte) []byte {
+ // Make a copy of d0 so that caller can keep writing and summing.
+ d0 := *d
+ hash := d0.checkSum()
+ return append(in, hash[:]...)
+}
+
+// Intermediate checksum function
+func (d *digest) checkSum() (digest [Size]byte) {
+ n := d.nx
+
+ var k [64]byte
+ copy(k[:], d.x[:n])
+
+ k[n] = 0x80
+
+ if n >= 56 {
+ block(d, k[:])
+
+ // clear block buffer - go compiles this to optimal 1x xorps + 4x movups
+ // unfortunately expressing this more succinctly results in much worse code
+ k[0] = 0
+ k[1] = 0
+ k[2] = 0
+ k[3] = 0
+ k[4] = 0
+ k[5] = 0
+ k[6] = 0
+ k[7] = 0
+ k[8] = 0
+ k[9] = 0
+ k[10] = 0
+ k[11] = 0
+ k[12] = 0
+ k[13] = 0
+ k[14] = 0
+ k[15] = 0
+ k[16] = 0
+ k[17] = 0
+ k[18] = 0
+ k[19] = 0
+ k[20] = 0
+ k[21] = 0
+ k[22] = 0
+ k[23] = 0
+ k[24] = 0
+ k[25] = 0
+ k[26] = 0
+ k[27] = 0
+ k[28] = 0
+ k[29] = 0
+ k[30] = 0
+ k[31] = 0
+ k[32] = 0
+ k[33] = 0
+ k[34] = 0
+ k[35] = 0
+ k[36] = 0
+ k[37] = 0
+ k[38] = 0
+ k[39] = 0
+ k[40] = 0
+ k[41] = 0
+ k[42] = 0
+ k[43] = 0
+ k[44] = 0
+ k[45] = 0
+ k[46] = 0
+ k[47] = 0
+ k[48] = 0
+ k[49] = 0
+ k[50] = 0
+ k[51] = 0
+ k[52] = 0
+ k[53] = 0
+ k[54] = 0
+ k[55] = 0
+ k[56] = 0
+ k[57] = 0
+ k[58] = 0
+ k[59] = 0
+ k[60] = 0
+ k[61] = 0
+ k[62] = 0
+ k[63] = 0
+ }
+ binary.BigEndian.PutUint64(k[56:64], uint64(d.len)<<3)
+ block(d, k[:])
+
+ {
+ const i = 0
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 1
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 2
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 3
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 4
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 5
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 6
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+ {
+ const i = 7
+ binary.BigEndian.PutUint32(digest[i*4:i*4+4], d.h[i])
+ }
+
+ return
+}
+
+func block(dig *digest, p []byte) {
+ if blockfunc == blockfuncSha {
+ blockShaGo(dig, p)
+ } else if blockfunc == blockfuncAvx2 {
+ blockAvx2Go(dig, p)
+ } else if blockfunc == blockfuncAvx {
+ blockAvxGo(dig, p)
+ } else if blockfunc == blockfuncSsse {
+ blockSsseGo(dig, p)
+ } else if blockfunc == blockfuncArm {
+ blockArmGo(dig, p)
+ } else if blockfunc == blockfuncGeneric {
+ blockGeneric(dig, p)
+ }
+}
+
+func blockGeneric(dig *digest, p []byte) {
+ var w [64]uint32
+ h0, h1, h2, h3, h4, h5, h6, h7 := dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]
+ for len(p) >= chunk {
+ // Can interlace the computation of w with the
+ // rounds below if needed for speed.
+ for i := 0; i < 16; i++ {
+ j := i * 4
+ w[i] = uint32(p[j])<<24 | uint32(p[j+1])<<16 | uint32(p[j+2])<<8 | uint32(p[j+3])
+ }
+ for i := 16; i < 64; i++ {
+ v1 := w[i-2]
+ t1 := (v1>>17 | v1<<(32-17)) ^ (v1>>19 | v1<<(32-19)) ^ (v1 >> 10)
+ v2 := w[i-15]
+ t2 := (v2>>7 | v2<<(32-7)) ^ (v2>>18 | v2<<(32-18)) ^ (v2 >> 3)
+ w[i] = t1 + w[i-7] + t2 + w[i-16]
+ }
+
+ a, b, c, d, e, f, g, h := h0, h1, h2, h3, h4, h5, h6, h7
+
+ for i := 0; i < 64; i++ {
+ t1 := h + ((e>>6 | e<<(32-6)) ^ (e>>11 | e<<(32-11)) ^ (e>>25 | e<<(32-25))) + ((e & f) ^ (^e & g)) + _K[i] + w[i]
+
+ t2 := ((a>>2 | a<<(32-2)) ^ (a>>13 | a<<(32-13)) ^ (a>>22 | a<<(32-22))) + ((a & b) ^ (a & c) ^ (b & c))
+
+ h = g
+ g = f
+ f = e
+ e = d + t1
+ d = c
+ c = b
+ b = a
+ a = t1 + t2
+ }
+
+ h0 += a
+ h1 += b
+ h2 += c
+ h3 += d
+ h4 += e
+ h5 += f
+ h6 += g
+ h7 += h
+
+ p = p[chunk:]
+ }
+
+ dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h0, h1, h2, h3, h4, h5, h6, h7
+}
+
+var _K = []uint32{
+ 0x428a2f98,
+ 0x71374491,
+ 0xb5c0fbcf,
+ 0xe9b5dba5,
+ 0x3956c25b,
+ 0x59f111f1,
+ 0x923f82a4,
+ 0xab1c5ed5,
+ 0xd807aa98,
+ 0x12835b01,
+ 0x243185be,
+ 0x550c7dc3,
+ 0x72be5d74,
+ 0x80deb1fe,
+ 0x9bdc06a7,
+ 0xc19bf174,
+ 0xe49b69c1,
+ 0xefbe4786,
+ 0x0fc19dc6,
+ 0x240ca1cc,
+ 0x2de92c6f,
+ 0x4a7484aa,
+ 0x5cb0a9dc,
+ 0x76f988da,
+ 0x983e5152,
+ 0xa831c66d,
+ 0xb00327c8,
+ 0xbf597fc7,
+ 0xc6e00bf3,
+ 0xd5a79147,
+ 0x06ca6351,
+ 0x14292967,
+ 0x27b70a85,
+ 0x2e1b2138,
+ 0x4d2c6dfc,
+ 0x53380d13,
+ 0x650a7354,
+ 0x766a0abb,
+ 0x81c2c92e,
+ 0x92722c85,
+ 0xa2bfe8a1,
+ 0xa81a664b,
+ 0xc24b8b70,
+ 0xc76c51a3,
+ 0xd192e819,
+ 0xd6990624,
+ 0xf40e3585,
+ 0x106aa070,
+ 0x19a4c116,
+ 0x1e376c08,
+ 0x2748774c,
+ 0x34b0bcb5,
+ 0x391c0cb3,
+ 0x4ed8aa4a,
+ 0x5b9cca4f,
+ 0x682e6ff3,
+ 0x748f82ee,
+ 0x78a5636f,
+ 0x84c87814,
+ 0x8cc70208,
+ 0x90befffa,
+ 0xa4506ceb,
+ 0xbef9a3f7,
+ 0xc67178f2,
+}
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.go
new file mode 100644
index 0000000000..52fcaee6d2
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.go
@@ -0,0 +1,22 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+//go:noescape
+func blockAvx2(h []uint32, message []uint8)
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.s
new file mode 100644
index 0000000000..80b0b739be
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx2_amd64.s
@@ -0,0 +1,1449 @@
+//+build !noasm,!appengine
+
+// SHA256 implementation for AVX2
+
+//
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// This code is based on an Intel White-Paper:
+// "Fast SHA-256 Implementations on Intel Architecture Processors"
+//
+// together with the reference implementation from the following authors:
+// James Guilford
+// Kirk Yap
+// Tim Chen
+//
+// For Golang it has been converted to Plan 9 assembly with the help of
+// github.com/minio/asm2plan9s to assemble Intel instructions to their Plan9
+// equivalents
+//
+
+DATA K256<>+0x000(SB)/8, $0x71374491428a2f98
+DATA K256<>+0x008(SB)/8, $0xe9b5dba5b5c0fbcf
+DATA K256<>+0x010(SB)/8, $0x71374491428a2f98
+DATA K256<>+0x018(SB)/8, $0xe9b5dba5b5c0fbcf
+DATA K256<>+0x020(SB)/8, $0x59f111f13956c25b
+DATA K256<>+0x028(SB)/8, $0xab1c5ed5923f82a4
+DATA K256<>+0x030(SB)/8, $0x59f111f13956c25b
+DATA K256<>+0x038(SB)/8, $0xab1c5ed5923f82a4
+DATA K256<>+0x040(SB)/8, $0x12835b01d807aa98
+DATA K256<>+0x048(SB)/8, $0x550c7dc3243185be
+DATA K256<>+0x050(SB)/8, $0x12835b01d807aa98
+DATA K256<>+0x058(SB)/8, $0x550c7dc3243185be
+DATA K256<>+0x060(SB)/8, $0x80deb1fe72be5d74
+DATA K256<>+0x068(SB)/8, $0xc19bf1749bdc06a7
+DATA K256<>+0x070(SB)/8, $0x80deb1fe72be5d74
+DATA K256<>+0x078(SB)/8, $0xc19bf1749bdc06a7
+DATA K256<>+0x080(SB)/8, $0xefbe4786e49b69c1
+DATA K256<>+0x088(SB)/8, $0x240ca1cc0fc19dc6
+DATA K256<>+0x090(SB)/8, $0xefbe4786e49b69c1
+DATA K256<>+0x098(SB)/8, $0x240ca1cc0fc19dc6
+DATA K256<>+0x0a0(SB)/8, $0x4a7484aa2de92c6f
+DATA K256<>+0x0a8(SB)/8, $0x76f988da5cb0a9dc
+DATA K256<>+0x0b0(SB)/8, $0x4a7484aa2de92c6f
+DATA K256<>+0x0b8(SB)/8, $0x76f988da5cb0a9dc
+DATA K256<>+0x0c0(SB)/8, $0xa831c66d983e5152
+DATA K256<>+0x0c8(SB)/8, $0xbf597fc7b00327c8
+DATA K256<>+0x0d0(SB)/8, $0xa831c66d983e5152
+DATA K256<>+0x0d8(SB)/8, $0xbf597fc7b00327c8
+DATA K256<>+0x0e0(SB)/8, $0xd5a79147c6e00bf3
+DATA K256<>+0x0e8(SB)/8, $0x1429296706ca6351
+DATA K256<>+0x0f0(SB)/8, $0xd5a79147c6e00bf3
+DATA K256<>+0x0f8(SB)/8, $0x1429296706ca6351
+DATA K256<>+0x100(SB)/8, $0x2e1b213827b70a85
+DATA K256<>+0x108(SB)/8, $0x53380d134d2c6dfc
+DATA K256<>+0x110(SB)/8, $0x2e1b213827b70a85
+DATA K256<>+0x118(SB)/8, $0x53380d134d2c6dfc
+DATA K256<>+0x120(SB)/8, $0x766a0abb650a7354
+DATA K256<>+0x128(SB)/8, $0x92722c8581c2c92e
+DATA K256<>+0x130(SB)/8, $0x766a0abb650a7354
+DATA K256<>+0x138(SB)/8, $0x92722c8581c2c92e
+DATA K256<>+0x140(SB)/8, $0xa81a664ba2bfe8a1
+DATA K256<>+0x148(SB)/8, $0xc76c51a3c24b8b70
+DATA K256<>+0x150(SB)/8, $0xa81a664ba2bfe8a1
+DATA K256<>+0x158(SB)/8, $0xc76c51a3c24b8b70
+DATA K256<>+0x160(SB)/8, $0xd6990624d192e819
+DATA K256<>+0x168(SB)/8, $0x106aa070f40e3585
+DATA K256<>+0x170(SB)/8, $0xd6990624d192e819
+DATA K256<>+0x178(SB)/8, $0x106aa070f40e3585
+DATA K256<>+0x180(SB)/8, $0x1e376c0819a4c116
+DATA K256<>+0x188(SB)/8, $0x34b0bcb52748774c
+DATA K256<>+0x190(SB)/8, $0x1e376c0819a4c116
+DATA K256<>+0x198(SB)/8, $0x34b0bcb52748774c
+DATA K256<>+0x1a0(SB)/8, $0x4ed8aa4a391c0cb3
+DATA K256<>+0x1a8(SB)/8, $0x682e6ff35b9cca4f
+DATA K256<>+0x1b0(SB)/8, $0x4ed8aa4a391c0cb3
+DATA K256<>+0x1b8(SB)/8, $0x682e6ff35b9cca4f
+DATA K256<>+0x1c0(SB)/8, $0x78a5636f748f82ee
+DATA K256<>+0x1c8(SB)/8, $0x8cc7020884c87814
+DATA K256<>+0x1d0(SB)/8, $0x78a5636f748f82ee
+DATA K256<>+0x1d8(SB)/8, $0x8cc7020884c87814
+DATA K256<>+0x1e0(SB)/8, $0xa4506ceb90befffa
+DATA K256<>+0x1e8(SB)/8, $0xc67178f2bef9a3f7
+DATA K256<>+0x1f0(SB)/8, $0xa4506ceb90befffa
+DATA K256<>+0x1f8(SB)/8, $0xc67178f2bef9a3f7
+
+DATA K256<>+0x200(SB)/8, $0x0405060700010203
+DATA K256<>+0x208(SB)/8, $0x0c0d0e0f08090a0b
+DATA K256<>+0x210(SB)/8, $0x0405060700010203
+DATA K256<>+0x218(SB)/8, $0x0c0d0e0f08090a0b
+DATA K256<>+0x220(SB)/8, $0x0b0a090803020100
+DATA K256<>+0x228(SB)/8, $0xffffffffffffffff
+DATA K256<>+0x230(SB)/8, $0x0b0a090803020100
+DATA K256<>+0x238(SB)/8, $0xffffffffffffffff
+DATA K256<>+0x240(SB)/8, $0xffffffffffffffff
+DATA K256<>+0x248(SB)/8, $0x0b0a090803020100
+DATA K256<>+0x250(SB)/8, $0xffffffffffffffff
+DATA K256<>+0x258(SB)/8, $0x0b0a090803020100
+
+GLOBL K256<>(SB), 8, $608
+
+// We need 0x220 stack space aligned on a 512 boundary, so for the
+// worstcase-aligned SP we need twice this amount, being 1088 (=0x440)
+//
+// SP aligned end-aligned stacksize
+// 100013d0 10001400 10001620 592
+// 100013d8 10001400 10001620 584
+// 100013e0 10001600 10001820 1088
+// 100013e8 10001600 10001820 1080
+
+// func blockAvx2(h []uint32, message []uint8)
+TEXT ·blockAvx2(SB),$1088-48
+
+ MOVQ h+0(FP), DI // DI: &h
+ MOVQ message_base+24(FP), SI // SI: &message
+ MOVQ message_len+32(FP), DX // len(message)
+ ADDQ SI, DX // end pointer of input
+ MOVQ SP, R11 // copy stack pointer
+ ADDQ $0x220, SP // sp += 0x220
+ ANDQ $0xfffffffffffffe00, SP // align stack frame
+ ADDQ $0x1c0, SP
+ MOVQ DI, 0x40(SP) // save ctx
+ MOVQ SI, 0x48(SP) // save input
+ MOVQ DX, 0x50(SP) // save end pointer
+ MOVQ R11, 0x58(SP) // save copy of stack pointer
+
+ WORD $0xf8c5; BYTE $0x77 // vzeroupper
+ ADDQ $0x40, SI // input++
+ MOVL (DI), AX
+ MOVQ SI, R12 // borrow $T1
+ MOVL 4(DI), BX
+ CMPQ SI, DX // $_end
+ MOVL 8(DI), CX
+ LONG $0xe4440f4c // cmove r12,rsp /* next block or random data */
+ MOVL 12(DI), DX
+ MOVL 16(DI), R8
+ MOVL 20(DI), R9
+ MOVL 24(DI), R10
+ MOVL 28(DI), R11
+
+ LEAQ K256<>(SB), BP
+ LONG $0x856f7dc5; LONG $0x00000220 // VMOVDQA YMM8, 0x220[rbp] /* vmovdqa ymm8,YMMWORD PTR [rip+0x220] */
+ LONG $0x8d6f7dc5; LONG $0x00000240 // VMOVDQA YMM9, 0x240[rbp] /* vmovdqa ymm9,YMMWORD PTR [rip+0x240] */
+ LONG $0x956f7dc5; LONG $0x00000200 // VMOVDQA YMM10, 0x200[rbp] /* vmovdqa ymm7,YMMWORD PTR [rip+0x200] */
+
+loop0:
+ LONG $0x6f7dc1c4; BYTE $0xfa // VMOVDQA YMM7, YMM10
+
+ // Load first 16 dwords from two blocks
+ MOVOU -64(SI), X0 // vmovdqu xmm0,XMMWORD PTR [rsi-0x40]
+ MOVOU -48(SI), X1 // vmovdqu xmm1,XMMWORD PTR [rsi-0x30]
+ MOVOU -32(SI), X2 // vmovdqu xmm2,XMMWORD PTR [rsi-0x20]
+ MOVOU -16(SI), X3 // vmovdqu xmm3,XMMWORD PTR [rsi-0x10]
+
+ // Byte swap data and transpose data into high/low
+ LONG $0x387dc3c4; WORD $0x2404; BYTE $0x01 // vinserti128 ymm0,ymm0,[r12],0x1
+ LONG $0x3875c3c4; LONG $0x0110244c // vinserti128 ymm1,ymm1,0x10[r12],0x1
+ LONG $0x007de2c4; BYTE $0xc7 // vpshufb ymm0,ymm0,ymm7
+ LONG $0x386dc3c4; LONG $0x01202454 // vinserti128 ymm2,ymm2,0x20[r12],0x1
+ LONG $0x0075e2c4; BYTE $0xcf // vpshufb ymm1,ymm1,ymm7
+ LONG $0x3865c3c4; LONG $0x0130245c // vinserti128 ymm3,ymm3,0x30[r12],0x1
+
+ LEAQ K256<>(SB), BP
+ LONG $0x006de2c4; BYTE $0xd7 // vpshufb ymm2,ymm2,ymm7
+ LONG $0x65fefdc5; BYTE $0x00 // vpaddd ymm4,ymm0,[rbp]
+ LONG $0x0065e2c4; BYTE $0xdf // vpshufb ymm3,ymm3,ymm7
+ LONG $0x6dfef5c5; BYTE $0x20 // vpaddd ymm5,ymm1,0x20[rbp]
+ LONG $0x75feedc5; BYTE $0x40 // vpaddd ymm6,ymm2,0x40[rbp]
+ LONG $0x7dfee5c5; BYTE $0x60 // vpaddd ymm7,ymm3,0x60[rbp]
+
+ LONG $0x247ffdc5; BYTE $0x24 // vmovdqa [rsp],ymm4
+ XORQ R14, R14
+ LONG $0x6c7ffdc5; WORD $0x2024 // vmovdqa [rsp+0x20],ymm5
+
+ ADDQ $-0x40, SP
+ MOVQ BX, DI
+ LONG $0x347ffdc5; BYTE $0x24 // vmovdqa [rsp],ymm6
+ XORQ CX, DI // magic
+ LONG $0x7c7ffdc5; WORD $0x2024 // vmovdqa [rsp+0x20],ymm7
+ MOVQ R9, R12
+ ADDQ $0x80, BP
+
+loop1:
+ // Schedule 48 input dwords, by doing 3 rounds of 12 each
+ // Note: SIMD instructions are interleaved with the SHA calculations
+ ADDQ $-0x40, SP
+ LONG $0x0f75e3c4; WORD $0x04e0 // vpalignr ymm4,ymm1,ymm0,0x4
+
+ // ROUND(AX, BX, CX, DX, R8, R9, R10, R11, R12, R13, R14, R15, DI, SP, 0x80)
+ LONG $0x249c0344; LONG $0x00000080 // add r11d,[rsp+0x80]
+ WORD $0x2145; BYTE $0xc4 // and r12d,r8d
+ LONG $0xf07b43c4; WORD $0x19e8 // rorx r13d,r8d,0x19
+ LONG $0x0f65e3c4; WORD $0x04fa // vpalignr ymm7,ymm3,ymm2,0x4
+ LONG $0xf07b43c4; WORD $0x0bf8 // rorx r15d,r8d,0xb
+ LONG $0x30048d42 // lea eax,[rax+r14*1]
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ LONG $0xd472cdc5; BYTE $0x07 // vpsrld ymm6,ymm4,0x7
+ LONG $0xf23842c4; BYTE $0xe2 // andn r12d,r8d,r10d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f0 // rorx r14d,r8d,0x6
+ LONG $0xc7fefdc5 // vpaddd ymm0,ymm0,ymm7
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xc7 // mov r15d,eax
+ LONG $0xd472c5c5; BYTE $0x03 // vpsrld ymm7,ymm4,0x3
+ LONG $0xf07b63c4; WORD $0x16e0 // rorx r12d,eax,0x16
+ LONG $0x2b1c8d47 // lea r11d,[r11+r13*1]
+ WORD $0x3141; BYTE $0xdf // xor r15d,ebx
+ LONG $0xf472d5c5; BYTE $0x0e // vpslld ymm5,ymm4,0xe
+ LONG $0xf07b63c4; WORD $0x0df0 // rorx r14d,eax,0xd
+ LONG $0xf07b63c4; WORD $0x02e8 // rorx r13d,eax,0x2
+ LONG $0x1a148d42 // lea edx,[rdx+r11*1]
+ LONG $0xe6efc5c5 // vpxor ymm4,ymm7,ymm6
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xdf31 // xor edi,ebx
+ LONG $0xfb70fdc5; BYTE $0xfa // vpshufd ymm7,ymm3,0xfa
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3b1c8d45 // lea r11d,[r11+rdi*1]
+ WORD $0x8945; BYTE $0xc4 // mov r12d,r8d
+ LONG $0xd672cdc5; BYTE $0x0b // vpsrld ymm6,ymm6,0xb
+
+ // ROUND(R11, AX, BX, CX, DX, R8, R9, R10, R12, R13, R14, DI, R15, SP, 0x84)
+ LONG $0x24940344; LONG $0x00000084 // add r10d,[rsp+0x84]
+ WORD $0x2141; BYTE $0xd4 // and r12d,edx
+ LONG $0xf07b63c4; WORD $0x19ea // rorx r13d,edx,0x19
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07be3c4; WORD $0x0bfa // rorx edi,edx,0xb
+ LONG $0x331c8d47 // lea r11d,[r11+r14*1]
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ LONG $0xf572d5c5; BYTE $0x0b // vpslld ymm5,ymm5,0xb
+ LONG $0xf26842c4; BYTE $0xe1 // andn r12d,edx,r9d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f2 // rorx r14d,edx,0x6
+ LONG $0xe6efddc5 // vpxor ymm4,ymm4,ymm6
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xdf // mov edi,r11d
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ LONG $0xf07b43c4; WORD $0x16e3 // rorx r12d,r11d,0x16
+ LONG $0x2a148d47 // lea r10d,[r10+r13*1]
+ WORD $0xc731 // xor edi,eax
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07b43c4; WORD $0x0df3 // rorx r14d,r11d,0xd
+ LONG $0xf07b43c4; WORD $0x02eb // rorx r13d,r11d,0x2
+ LONG $0x110c8d42 // lea ecx,[rcx+r10*1]
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xc7 // xor r15d,eax
+ LONG $0xc4fefdc5 // vpaddd ymm0,ymm0,ymm4
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3a148d47 // lea r10d,[r10+r15*1]
+ WORD $0x8941; BYTE $0xd4 // mov r12d,edx
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(R10, R11, AX, BX, CX, DX, R8, R9, R12, R13, R14, R15, DI, SP, 0x88)
+ LONG $0x248c0344; LONG $0x00000088 // add r9d,[rsp+0x88]
+ WORD $0x2141; BYTE $0xcc // and r12d,ecx
+ LONG $0xf07b63c4; WORD $0x19e9 // rorx r13d,ecx,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07b63c4; WORD $0x0bf9 // rorx r15d,ecx,0xb
+ LONG $0x32148d47 // lea r10d,[r10+r14*1]
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf27042c4; BYTE $0xe0 // andn r12d,ecx,r8d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f1 // rorx r14d,ecx,0x6
+ LONG $0x004dc2c4; BYTE $0xf0 // vpshufb ymm6,ymm6,ymm8
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xd7 // mov r15d,r10d
+ LONG $0xc6fefdc5 // vpaddd ymm0,ymm0,ymm6
+ LONG $0xf07b43c4; WORD $0x16e2 // rorx r12d,r10d,0x16
+ LONG $0x290c8d47 // lea r9d,[r9+r13*1]
+ WORD $0x3145; BYTE $0xdf // xor r15d,r11d
+ LONG $0xf870fdc5; BYTE $0x50 // vpshufd ymm7,ymm0,0x50
+ LONG $0xf07b43c4; WORD $0x0df2 // rorx r14d,r10d,0xd
+ LONG $0xf07b43c4; WORD $0x02ea // rorx r13d,r10d,0x2
+ LONG $0x0b1c8d42 // lea ebx,[rbx+r9*1]
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xdf // xor edi,r11d
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d45 // lea r9d,[r9+rdi*1]
+ WORD $0x8941; BYTE $0xcc // mov r12d,ecx
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(R9, R10, R11, AX, BX, CX, DX, R8, R12, R13, R14, DI, R15, SP, 0x8c)
+ LONG $0x24840344; LONG $0x0000008c // add r8d,[rsp+0x8c]
+ WORD $0x2141; BYTE $0xdc // and r12d,ebx
+ LONG $0xf07b63c4; WORD $0x19eb // rorx r13d,ebx,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07be3c4; WORD $0x0bfb // rorx edi,ebx,0xb
+ LONG $0x310c8d47 // lea r9d,[r9+r14*1]
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf26062c4; BYTE $0xe2 // andn r12d,ebx,edx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f3 // rorx r14d,ebx,0x6
+ LONG $0x004dc2c4; BYTE $0xf1 // vpshufb ymm6,ymm6,ymm9
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xcf // mov edi,r9d
+ LONG $0xc6fefdc5 // vpaddd ymm0,ymm0,ymm6
+ LONG $0xf07b43c4; WORD $0x16e1 // rorx r12d,r9d,0x16
+ LONG $0x28048d47 // lea r8d,[r8+r13*1]
+ WORD $0x3144; BYTE $0xd7 // xor edi,r10d
+ LONG $0x75fefdc5; BYTE $0x00 // vpaddd ymm6,ymm0,[rbp+0x0]
+ LONG $0xf07b43c4; WORD $0x0df1 // rorx r14d,r9d,0xd
+ LONG $0xf07b43c4; WORD $0x02e9 // rorx r13d,r9d,0x2
+ LONG $0x00048d42 // lea eax,[rax+r8*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xd7 // xor r15d,r10d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d47 // lea r8d,[r8+r15*1]
+ WORD $0x8941; BYTE $0xdc // mov r12d,ebx
+
+ LONG $0x347ffdc5; BYTE $0x24 // vmovdqa [rsp],ymm6
+ LONG $0x0f6de3c4; WORD $0x04e1 // vpalignr ymm4,ymm2,ymm1,0x4
+
+ // ROUND(R8, R9, R10, R11, AX, BX, CX, DX, R12, R13, R14, R15, DI, SP, 0xa0)
+ LONG $0xa0249403; WORD $0x0000; BYTE $0x00 // add edx,[rsp+0xa0]
+ WORD $0x2141; BYTE $0xc4 // and r12d,eax
+ LONG $0xf07b63c4; WORD $0x19e8 // rorx r13d,eax,0x19
+ LONG $0x0f7de3c4; WORD $0x04fb // vpalignr ymm7,ymm0,ymm3,0x4
+ LONG $0xf07b63c4; WORD $0x0bf8 // rorx r15d,eax,0xb
+ LONG $0x30048d47 // lea r8d,[r8+r14*1]
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ LONG $0xd472cdc5; BYTE $0x07 // vpsrld ymm6,ymm4,0x7
+ LONG $0xf27862c4; BYTE $0xe1 // andn r12d,eax,ecx
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f0 // rorx r14d,eax,0x6
+ LONG $0xcffef5c5 // vpaddd ymm1,ymm1,ymm7
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xc7 // mov r15d,r8d
+ LONG $0xd472c5c5; BYTE $0x03 // vpsrld ymm7,ymm4,0x3
+ LONG $0xf07b43c4; WORD $0x16e0 // rorx r12d,r8d,0x16
+ LONG $0x2a148d42 // lea edx,[rdx+r13*1]
+ WORD $0x3145; BYTE $0xcf // xor r15d,r9d
+ LONG $0xf472d5c5; BYTE $0x0e // vpslld ymm5,ymm4,0xe
+ LONG $0xf07b43c4; WORD $0x0df0 // rorx r14d,r8d,0xd
+ LONG $0xf07b43c4; WORD $0x02e8 // rorx r13d,r8d,0x2
+ LONG $0x131c8d45 // lea r11d,[r11+rdx*1]
+ LONG $0xe6efc5c5 // vpxor ymm4,ymm7,ymm6
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xcf // xor edi,r9d
+ LONG $0xf870fdc5; BYTE $0xfa // vpshufd ymm7,ymm0,0xfa
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x148d; BYTE $0x3a // lea edx,[rdx+rdi*1]
+ WORD $0x8941; BYTE $0xc4 // mov r12d,eax
+ LONG $0xd672cdc5; BYTE $0x0b // vpsrld ymm6,ymm6,0xb
+
+ // ROUND(DX, R8, R9, R10, R11, AX, BX, CX, R12, R13, R14, DI, R15, SP, 0xa4)
+ LONG $0xa4248c03; WORD $0x0000; BYTE $0x00 // add ecx,[rsp+0xa4]
+ WORD $0x2145; BYTE $0xdc // and r12d,r11d
+ LONG $0xf07b43c4; WORD $0x19eb // rorx r13d,r11d,0x19
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07bc3c4; WORD $0x0bfb // rorx edi,r11d,0xb
+ LONG $0x32148d42 // lea edx,[rdx+r14*1]
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ LONG $0xf572d5c5; BYTE $0x0b // vpslld ymm5,ymm5,0xb
+ LONG $0xf22062c4; BYTE $0xe3 // andn r12d,r11d,ebx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f3 // rorx r14d,r11d,0x6
+ LONG $0xe6efddc5 // vpxor ymm4,ymm4,ymm6
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xd789 // mov edi,edx
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ LONG $0xf07b63c4; WORD $0x16e2 // rorx r12d,edx,0x16
+ LONG $0x290c8d42 // lea ecx,[rcx+r13*1]
+ WORD $0x3144; BYTE $0xc7 // xor edi,r8d
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07b63c4; WORD $0x0df2 // rorx r14d,edx,0xd
+ LONG $0xf07b63c4; WORD $0x02ea // rorx r13d,edx,0x2
+ LONG $0x0a148d45 // lea r10d,[r10+rcx*1]
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xc7 // xor r15d,r8d
+ LONG $0xccfef5c5 // vpaddd ymm1,ymm1,ymm4
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d42 // lea ecx,[rcx+r15*1]
+ WORD $0x8945; BYTE $0xdc // mov r12d,r11d
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(CX, DX, R8, R9, R10, R11, AX, BX, R12, R13, R14, R15, DI, SP, 0xa8)
+ LONG $0xa8249c03; WORD $0x0000; BYTE $0x00 // add ebx,[rsp+0xa8]
+ WORD $0x2145; BYTE $0xd4 // and r12d,r10d
+ LONG $0xf07b43c4; WORD $0x19ea // rorx r13d,r10d,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07b43c4; WORD $0x0bfa // rorx r15d,r10d,0xb
+ LONG $0x310c8d42 // lea ecx,[rcx+r14*1]
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf22862c4; BYTE $0xe0 // andn r12d,r10d,eax
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f2 // rorx r14d,r10d,0x6
+ LONG $0x004dc2c4; BYTE $0xf0 // vpshufb ymm6,ymm6,ymm8
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xcf // mov r15d,ecx
+ LONG $0xcefef5c5 // vpaddd ymm1,ymm1,ymm6
+ LONG $0xf07b63c4; WORD $0x16e1 // rorx r12d,ecx,0x16
+ LONG $0x2b1c8d42 // lea ebx,[rbx+r13*1]
+ WORD $0x3141; BYTE $0xd7 // xor r15d,edx
+ LONG $0xf970fdc5; BYTE $0x50 // vpshufd ymm7,ymm1,0x50
+ LONG $0xf07b63c4; WORD $0x0df1 // rorx r14d,ecx,0xd
+ LONG $0xf07b63c4; WORD $0x02e9 // rorx r13d,ecx,0x2
+ LONG $0x190c8d45 // lea r9d,[r9+rbx*1]
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xd731 // xor edi,edx
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x1c8d; BYTE $0x3b // lea ebx,[rbx+rdi*1]
+ WORD $0x8945; BYTE $0xd4 // mov r12d,r10d
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(BX, CX, DX, R8, R9, R10, R11, AX, R12, R13, R14, DI, R15, SP, 0xac)
+ LONG $0xac248403; WORD $0x0000; BYTE $0x00 // add eax,[rsp+0xac]
+ WORD $0x2145; BYTE $0xcc // and r12d,r9d
+ LONG $0xf07b43c4; WORD $0x19e9 // rorx r13d,r9d,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07bc3c4; WORD $0x0bf9 // rorx edi,r9d,0xb
+ LONG $0x331c8d42 // lea ebx,[rbx+r14*1]
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf23042c4; BYTE $0xe3 // andn r12d,r9d,r11d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f1 // rorx r14d,r9d,0x6
+ LONG $0x004dc2c4; BYTE $0xf1 // vpshufb ymm6,ymm6,ymm9
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xdf89 // mov edi,ebx
+ LONG $0xcefef5c5 // vpaddd ymm1,ymm1,ymm6
+ LONG $0xf07b63c4; WORD $0x16e3 // rorx r12d,ebx,0x16
+ LONG $0x28048d42 // lea eax,[rax+r13*1]
+ WORD $0xcf31 // xor edi,ecx
+ LONG $0x75fef5c5; BYTE $0x20 // vpaddd ymm6,ymm1,[rbp+0x20]
+ LONG $0xf07b63c4; WORD $0x0df3 // rorx r14d,ebx,0xd
+ LONG $0xf07b63c4; WORD $0x02eb // rorx r13d,ebx,0x2
+ LONG $0x00048d45 // lea r8d,[r8+rax*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xcf // xor r15d,ecx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d42 // lea eax,[rax+r15*1]
+ WORD $0x8945; BYTE $0xcc // mov r12d,r9d
+
+ LONG $0x747ffdc5; WORD $0x2024 // vmovdqa [rsp+0x20],ymm6
+
+ LONG $0x24648d48; BYTE $0xc0 // lea rsp,[rsp-0x40]
+ LONG $0x0f65e3c4; WORD $0x04e2 // vpalignr ymm4,ymm3,ymm2,0x4
+
+ // ROUND(AX, BX, CX, DX, R8, R9, R10, R11, R12, R13, R14, R15, DI, SP, 0x80)
+ LONG $0x249c0344; LONG $0x00000080 // add r11d,[rsp+0x80]
+ WORD $0x2145; BYTE $0xc4 // and r12d,r8d
+ LONG $0xf07b43c4; WORD $0x19e8 // rorx r13d,r8d,0x19
+ LONG $0x0f75e3c4; WORD $0x04f8 // vpalignr ymm7,ymm1,ymm0,0x4
+ LONG $0xf07b43c4; WORD $0x0bf8 // rorx r15d,r8d,0xb
+ LONG $0x30048d42 // lea eax,[rax+r14*1]
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ LONG $0xd472cdc5; BYTE $0x07 // vpsrld ymm6,ymm4,0x7
+ LONG $0xf23842c4; BYTE $0xe2 // andn r12d,r8d,r10d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f0 // rorx r14d,r8d,0x6
+ LONG $0xd7feedc5 // vpaddd ymm2,ymm2,ymm7
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xc7 // mov r15d,eax
+ LONG $0xd472c5c5; BYTE $0x03 // vpsrld ymm7,ymm4,0x3
+ LONG $0xf07b63c4; WORD $0x16e0 // rorx r12d,eax,0x16
+ LONG $0x2b1c8d47 // lea r11d,[r11+r13*1]
+ WORD $0x3141; BYTE $0xdf // xor r15d,ebx
+ LONG $0xf472d5c5; BYTE $0x0e // vpslld ymm5,ymm4,0xe
+ LONG $0xf07b63c4; WORD $0x0df0 // rorx r14d,eax,0xd
+ LONG $0xf07b63c4; WORD $0x02e8 // rorx r13d,eax,0x2
+ LONG $0x1a148d42 // lea edx,[rdx+r11*1]
+ LONG $0xe6efc5c5 // vpxor ymm4,ymm7,ymm6
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xdf31 // xor edi,ebx
+ LONG $0xf970fdc5; BYTE $0xfa // vpshufd ymm7,ymm1,0xfa
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3b1c8d45 // lea r11d,[r11+rdi*1]
+ WORD $0x8945; BYTE $0xc4 // mov r12d,r8d
+ LONG $0xd672cdc5; BYTE $0x0b // vpsrld ymm6,ymm6,0xb
+
+ // ROUND(R11, AX, BX, CX, DX, R8, R9, R10, R12, R13, R14, DI, R15, SP, 0x84)
+ LONG $0x24940344; LONG $0x00000084 // add r10d,[rsp+0x84]
+ WORD $0x2141; BYTE $0xd4 // and r12d,edx
+ LONG $0xf07b63c4; WORD $0x19ea // rorx r13d,edx,0x19
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07be3c4; WORD $0x0bfa // rorx edi,edx,0xb
+ LONG $0x331c8d47 // lea r11d,[r11+r14*1]
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ LONG $0xf572d5c5; BYTE $0x0b // vpslld ymm5,ymm5,0xb
+ LONG $0xf26842c4; BYTE $0xe1 // andn r12d,edx,r9d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f2 // rorx r14d,edx,0x6
+ LONG $0xe6efddc5 // vpxor ymm4,ymm4,ymm6
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xdf // mov edi,r11d
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ LONG $0xf07b43c4; WORD $0x16e3 // rorx r12d,r11d,0x16
+ LONG $0x2a148d47 // lea r10d,[r10+r13*1]
+ WORD $0xc731 // xor edi,eax
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07b43c4; WORD $0x0df3 // rorx r14d,r11d,0xd
+ LONG $0xf07b43c4; WORD $0x02eb // rorx r13d,r11d,0x2
+ LONG $0x110c8d42 // lea ecx,[rcx+r10*1]
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xc7 // xor r15d,eax
+ LONG $0xd4feedc5 // vpaddd ymm2,ymm2,ymm4
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3a148d47 // lea r10d,[r10+r15*1]
+ WORD $0x8941; BYTE $0xd4 // mov r12d,edx
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(R10, R11, AX, BX, CX, DX, R8, R9, R12, R13, R14, R15, DI, SP, 0x88)
+ LONG $0x248c0344; LONG $0x00000088 // add r9d,[rsp+0x88]
+ WORD $0x2141; BYTE $0xcc // and r12d,ecx
+ LONG $0xf07b63c4; WORD $0x19e9 // rorx r13d,ecx,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07b63c4; WORD $0x0bf9 // rorx r15d,ecx,0xb
+ LONG $0x32148d47 // lea r10d,[r10+r14*1]
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf27042c4; BYTE $0xe0 // andn r12d,ecx,r8d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f1 // rorx r14d,ecx,0x6
+ LONG $0x004dc2c4; BYTE $0xf0 // vpshufb ymm6,ymm6,ymm8
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xd7 // mov r15d,r10d
+ LONG $0xd6feedc5 // vpaddd ymm2,ymm2,ymm6
+ LONG $0xf07b43c4; WORD $0x16e2 // rorx r12d,r10d,0x16
+ LONG $0x290c8d47 // lea r9d,[r9+r13*1]
+ WORD $0x3145; BYTE $0xdf // xor r15d,r11d
+ LONG $0xfa70fdc5; BYTE $0x50 // vpshufd ymm7,ymm2,0x50
+ LONG $0xf07b43c4; WORD $0x0df2 // rorx r14d,r10d,0xd
+ LONG $0xf07b43c4; WORD $0x02ea // rorx r13d,r10d,0x2
+ LONG $0x0b1c8d42 // lea ebx,[rbx+r9*1]
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xdf // xor edi,r11d
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d45 // lea r9d,[r9+rdi*1]
+ WORD $0x8941; BYTE $0xcc // mov r12d,ecx
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(R9, R10, R11, AX, BX, CX, DX, R8, R12, R13, R14, DI, R15, SP, 0x8c)
+ LONG $0x24840344; LONG $0x0000008c // add r8d,[rsp+0x8c]
+ WORD $0x2141; BYTE $0xdc // and r12d,ebx
+ LONG $0xf07b63c4; WORD $0x19eb // rorx r13d,ebx,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07be3c4; WORD $0x0bfb // rorx edi,ebx,0xb
+ LONG $0x310c8d47 // lea r9d,[r9+r14*1]
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf26062c4; BYTE $0xe2 // andn r12d,ebx,edx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f3 // rorx r14d,ebx,0x6
+ LONG $0x004dc2c4; BYTE $0xf1 // vpshufb ymm6,ymm6,ymm9
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xcf // mov edi,r9d
+ LONG $0xd6feedc5 // vpaddd ymm2,ymm2,ymm6
+ LONG $0xf07b43c4; WORD $0x16e1 // rorx r12d,r9d,0x16
+ LONG $0x28048d47 // lea r8d,[r8+r13*1]
+ WORD $0x3144; BYTE $0xd7 // xor edi,r10d
+ LONG $0x75feedc5; BYTE $0x40 // vpaddd ymm6,ymm2,[rbp+0x40]
+ LONG $0xf07b43c4; WORD $0x0df1 // rorx r14d,r9d,0xd
+ LONG $0xf07b43c4; WORD $0x02e9 // rorx r13d,r9d,0x2
+ LONG $0x00048d42 // lea eax,[rax+r8*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xd7 // xor r15d,r10d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d47 // lea r8d,[r8+r15*1]
+ WORD $0x8941; BYTE $0xdc // mov r12d,ebx
+
+ LONG $0x347ffdc5; BYTE $0x24 // vmovdqa [rsp],ymm6
+ LONG $0x0f7de3c4; WORD $0x04e3 // vpalignr ymm4,ymm0,ymm3,0x4
+
+ // ROUND(R8, R9, R10, R11, AX, BX, CX, DX, R12, R13, R14, R15, DI, SP, 0xa0)
+ LONG $0xa0249403; WORD $0x0000; BYTE $0x00 // add edx,[rsp+0xa0]
+ WORD $0x2141; BYTE $0xc4 // and r12d,eax
+ LONG $0xf07b63c4; WORD $0x19e8 // rorx r13d,eax,0x19
+ LONG $0x0f6de3c4; WORD $0x04f9 // vpalignr ymm7,ymm2,ymm1,0x4
+ LONG $0xf07b63c4; WORD $0x0bf8 // rorx r15d,eax,0xb
+ LONG $0x30048d47 // lea r8d,[r8+r14*1]
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ LONG $0xd472cdc5; BYTE $0x07 // vpsrld ymm6,ymm4,0x7
+ LONG $0xf27862c4; BYTE $0xe1 // andn r12d,eax,ecx
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f0 // rorx r14d,eax,0x6
+ LONG $0xdffee5c5 // vpaddd ymm3,ymm3,ymm7
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xc7 // mov r15d,r8d
+ LONG $0xd472c5c5; BYTE $0x03 // vpsrld ymm7,ymm4,0x3
+ LONG $0xf07b43c4; WORD $0x16e0 // rorx r12d,r8d,0x16
+ LONG $0x2a148d42 // lea edx,[rdx+r13*1]
+ WORD $0x3145; BYTE $0xcf // xor r15d,r9d
+ LONG $0xf472d5c5; BYTE $0x0e // vpslld ymm5,ymm4,0xe
+ LONG $0xf07b43c4; WORD $0x0df0 // rorx r14d,r8d,0xd
+ LONG $0xf07b43c4; WORD $0x02e8 // rorx r13d,r8d,0x2
+ LONG $0x131c8d45 // lea r11d,[r11+rdx*1]
+ LONG $0xe6efc5c5 // vpxor ymm4,ymm7,ymm6
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xcf // xor edi,r9d
+ LONG $0xfa70fdc5; BYTE $0xfa // vpshufd ymm7,ymm2,0xfa
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x148d; BYTE $0x3a // lea edx,[rdx+rdi*1]
+ WORD $0x8941; BYTE $0xc4 // mov r12d,eax
+ LONG $0xd672cdc5; BYTE $0x0b // vpsrld ymm6,ymm6,0xb
+
+ // ROUND(DX, R8, R9, R10, R11, AX, BX, CX, R12, R13, R14, DI, R15, SP, 0xa4)
+ LONG $0xa4248c03; WORD $0x0000; BYTE $0x00 // add ecx,[rsp+0xa4]
+ WORD $0x2145; BYTE $0xdc // and r12d,r11d
+ LONG $0xf07b43c4; WORD $0x19eb // rorx r13d,r11d,0x19
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07bc3c4; WORD $0x0bfb // rorx edi,r11d,0xb
+ LONG $0x32148d42 // lea edx,[rdx+r14*1]
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ LONG $0xf572d5c5; BYTE $0x0b // vpslld ymm5,ymm5,0xb
+ LONG $0xf22062c4; BYTE $0xe3 // andn r12d,r11d,ebx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f3 // rorx r14d,r11d,0x6
+ LONG $0xe6efddc5 // vpxor ymm4,ymm4,ymm6
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xd789 // mov edi,edx
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ LONG $0xf07b63c4; WORD $0x16e2 // rorx r12d,edx,0x16
+ LONG $0x290c8d42 // lea ecx,[rcx+r13*1]
+ WORD $0x3144; BYTE $0xc7 // xor edi,r8d
+ LONG $0xe5efddc5 // vpxor ymm4,ymm4,ymm5
+ LONG $0xf07b63c4; WORD $0x0df2 // rorx r14d,edx,0xd
+ LONG $0xf07b63c4; WORD $0x02ea // rorx r13d,edx,0x2
+ LONG $0x0a148d45 // lea r10d,[r10+rcx*1]
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xc7 // xor r15d,r8d
+ LONG $0xdcfee5c5 // vpaddd ymm3,ymm3,ymm4
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d42 // lea ecx,[rcx+r15*1]
+ WORD $0x8945; BYTE $0xdc // mov r12d,r11d
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(CX, DX, R8, R9, R10, R11, AX, BX, R12, R13, R14, R15, DI, SP, 0xa8)
+ LONG $0xa8249c03; WORD $0x0000; BYTE $0x00 // add ebx,[rsp+0xa8]
+ WORD $0x2145; BYTE $0xd4 // and r12d,r10d
+ LONG $0xf07b43c4; WORD $0x19ea // rorx r13d,r10d,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07b43c4; WORD $0x0bfa // rorx r15d,r10d,0xb
+ LONG $0x310c8d42 // lea ecx,[rcx+r14*1]
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf22862c4; BYTE $0xe0 // andn r12d,r10d,eax
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f2 // rorx r14d,r10d,0x6
+ LONG $0x004dc2c4; BYTE $0xf0 // vpshufb ymm6,ymm6,ymm8
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xcf // mov r15d,ecx
+ LONG $0xdefee5c5 // vpaddd ymm3,ymm3,ymm6
+ LONG $0xf07b63c4; WORD $0x16e1 // rorx r12d,ecx,0x16
+ LONG $0x2b1c8d42 // lea ebx,[rbx+r13*1]
+ WORD $0x3141; BYTE $0xd7 // xor r15d,edx
+ LONG $0xfb70fdc5; BYTE $0x50 // vpshufd ymm7,ymm3,0x50
+ LONG $0xf07b63c4; WORD $0x0df1 // rorx r14d,ecx,0xd
+ LONG $0xf07b63c4; WORD $0x02e9 // rorx r13d,ecx,0x2
+ LONG $0x190c8d45 // lea r9d,[r9+rbx*1]
+ LONG $0xd772cdc5; BYTE $0x0a // vpsrld ymm6,ymm7,0xa
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xd731 // xor edi,edx
+ LONG $0xd773c5c5; BYTE $0x11 // vpsrlq ymm7,ymm7,0x11
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x1c8d; BYTE $0x3b // lea ebx,[rbx+rdi*1]
+ WORD $0x8945; BYTE $0xd4 // mov r12d,r10d
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+
+ // ROUND(BX, CX, DX, R8, R9, R10, R11, AX, R12, R13, R14, DI, R15, SP, 0xac)
+ LONG $0xac248403; WORD $0x0000; BYTE $0x00 // add eax,[rsp+0xac]
+ WORD $0x2145; BYTE $0xcc // and r12d,r9d
+ LONG $0xf07b43c4; WORD $0x19e9 // rorx r13d,r9d,0x19
+ LONG $0xd773c5c5; BYTE $0x02 // vpsrlq ymm7,ymm7,0x2
+ LONG $0xf07bc3c4; WORD $0x0bf9 // rorx edi,r9d,0xb
+ LONG $0x331c8d42 // lea ebx,[rbx+r14*1]
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ LONG $0xf7efcdc5 // vpxor ymm6,ymm6,ymm7
+ LONG $0xf23042c4; BYTE $0xe3 // andn r12d,r9d,r11d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f1 // rorx r14d,r9d,0x6
+ LONG $0x004dc2c4; BYTE $0xf1 // vpshufb ymm6,ymm6,ymm9
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xdf89 // mov edi,ebx
+ LONG $0xdefee5c5 // vpaddd ymm3,ymm3,ymm6
+ LONG $0xf07b63c4; WORD $0x16e3 // rorx r12d,ebx,0x16
+ LONG $0x28048d42 // lea eax,[rax+r13*1]
+ WORD $0xcf31 // xor edi,ecx
+ LONG $0x75fee5c5; BYTE $0x60 // vpaddd ymm6,ymm3,[rbp+0x60]
+ LONG $0xf07b63c4; WORD $0x0df3 // rorx r14d,ebx,0xd
+ LONG $0xf07b63c4; WORD $0x02eb // rorx r13d,ebx,0x2
+ LONG $0x00048d45 // lea r8d,[r8+rax*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xcf // xor r15d,ecx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d42 // lea eax,[rax+r15*1]
+ WORD $0x8945; BYTE $0xcc // mov r12d,r9d
+
+ LONG $0x747ffdc5; WORD $0x2024 // vmovdqa [rsp+0x20],ymm6
+ ADDQ $0x80, BP
+
+ CMPB 0x3(BP), $0x0
+ JNE loop1
+
+ // ROUND(AX, BX, CX, DX, R8, R9, R10, R11, R12, R13, R14, R15, DI, SP, 0x40)
+ LONG $0x245c0344; BYTE $0x40 // add r11d,[rsp+0x40]
+ WORD $0x2145; BYTE $0xc4 // and r12d,r8d
+ LONG $0xf07b43c4; WORD $0x19e8 // rorx r13d,r8d,0x19
+ LONG $0xf07b43c4; WORD $0x0bf8 // rorx r15d,r8d,0xb
+ LONG $0x30048d42 // lea eax,[rax+r14*1]
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ LONG $0xf23842c4; BYTE $0xe2 // andn r12d,r8d,r10d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f0 // rorx r14d,r8d,0x6
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xc7 // mov r15d,eax
+ LONG $0xf07b63c4; WORD $0x16e0 // rorx r12d,eax,0x16
+ LONG $0x2b1c8d47 // lea r11d,[r11+r13*1]
+ WORD $0x3141; BYTE $0xdf // xor r15d,ebx
+ LONG $0xf07b63c4; WORD $0x0df0 // rorx r14d,eax,0xd
+ LONG $0xf07b63c4; WORD $0x02e8 // rorx r13d,eax,0x2
+ LONG $0x1a148d42 // lea edx,[rdx+r11*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xdf31 // xor edi,ebx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3b1c8d45 // lea r11d,[r11+rdi*1]
+ WORD $0x8945; BYTE $0xc4 // mov r12d,r8d
+
+ // ROUND(R11, AX, BX, CX, DX, R8, R9, R10, R12, R13, R14, DI, R15, SP, 0x44)
+ LONG $0x24540344; BYTE $0x44 // add r10d,[rsp+0x44]
+ WORD $0x2141; BYTE $0xd4 // and r12d,edx
+ LONG $0xf07b63c4; WORD $0x19ea // rorx r13d,edx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfa // rorx edi,edx,0xb
+ LONG $0x331c8d47 // lea r11d,[r11+r14*1]
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ LONG $0xf26842c4; BYTE $0xe1 // andn r12d,edx,r9d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f2 // rorx r14d,edx,0x6
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xdf // mov edi,r11d
+ LONG $0xf07b43c4; WORD $0x16e3 // rorx r12d,r11d,0x16
+ LONG $0x2a148d47 // lea r10d,[r10+r13*1]
+ WORD $0xc731 // xor edi,eax
+ LONG $0xf07b43c4; WORD $0x0df3 // rorx r14d,r11d,0xd
+ LONG $0xf07b43c4; WORD $0x02eb // rorx r13d,r11d,0x2
+ LONG $0x110c8d42 // lea ecx,[rcx+r10*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xc7 // xor r15d,eax
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3a148d47 // lea r10d,[r10+r15*1]
+ WORD $0x8941; BYTE $0xd4 // mov r12d,edx
+
+ // ROUND(R10, R11, AX, BX, CX, DX, R8, R9, R12, R13, R14, R15, DI, SP, 0x48)
+ LONG $0x244c0344; BYTE $0x48 // add r9d,[rsp+0x48]
+ WORD $0x2141; BYTE $0xcc // and r12d,ecx
+ LONG $0xf07b63c4; WORD $0x19e9 // rorx r13d,ecx,0x19
+ LONG $0xf07b63c4; WORD $0x0bf9 // rorx r15d,ecx,0xb
+ LONG $0x32148d47 // lea r10d,[r10+r14*1]
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ LONG $0xf27042c4; BYTE $0xe0 // andn r12d,ecx,r8d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f1 // rorx r14d,ecx,0x6
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xd7 // mov r15d,r10d
+ LONG $0xf07b43c4; WORD $0x16e2 // rorx r12d,r10d,0x16
+ LONG $0x290c8d47 // lea r9d,[r9+r13*1]
+ WORD $0x3145; BYTE $0xdf // xor r15d,r11d
+ LONG $0xf07b43c4; WORD $0x0df2 // rorx r14d,r10d,0xd
+ LONG $0xf07b43c4; WORD $0x02ea // rorx r13d,r10d,0x2
+ LONG $0x0b1c8d42 // lea ebx,[rbx+r9*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xdf // xor edi,r11d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d45 // lea r9d,[r9+rdi*1]
+ WORD $0x8941; BYTE $0xcc // mov r12d,ecx
+
+ // ROUND(R9, R10, R11, AX, BX, CX, DX, R8, R12, R13, R14, DI, R15, SP, 0x4c)
+ LONG $0x24440344; BYTE $0x4c // add r8d,[rsp+0x4c]
+ WORD $0x2141; BYTE $0xdc // and r12d,ebx
+ LONG $0xf07b63c4; WORD $0x19eb // rorx r13d,ebx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfb // rorx edi,ebx,0xb
+ LONG $0x310c8d47 // lea r9d,[r9+r14*1]
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ LONG $0xf26062c4; BYTE $0xe2 // andn r12d,ebx,edx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f3 // rorx r14d,ebx,0x6
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xcf // mov edi,r9d
+ LONG $0xf07b43c4; WORD $0x16e1 // rorx r12d,r9d,0x16
+ LONG $0x28048d47 // lea r8d,[r8+r13*1]
+ WORD $0x3144; BYTE $0xd7 // xor edi,r10d
+ LONG $0xf07b43c4; WORD $0x0df1 // rorx r14d,r9d,0xd
+ LONG $0xf07b43c4; WORD $0x02e9 // rorx r13d,r9d,0x2
+ LONG $0x00048d42 // lea eax,[rax+r8*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xd7 // xor r15d,r10d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d47 // lea r8d,[r8+r15*1]
+ WORD $0x8941; BYTE $0xdc // mov r12d,ebx
+
+ // ROUND(R8, R9, R10, R11, AX, BX, CX, DX, R12, R13, R14, R15, DI, SP, 0x60)
+ LONG $0x60245403 // add edx,[rsp+0x60]
+ WORD $0x2141; BYTE $0xc4 // and r12d,eax
+ LONG $0xf07b63c4; WORD $0x19e8 // rorx r13d,eax,0x19
+ LONG $0xf07b63c4; WORD $0x0bf8 // rorx r15d,eax,0xb
+ LONG $0x30048d47 // lea r8d,[r8+r14*1]
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ LONG $0xf27862c4; BYTE $0xe1 // andn r12d,eax,ecx
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f0 // rorx r14d,eax,0x6
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xc7 // mov r15d,r8d
+ LONG $0xf07b43c4; WORD $0x16e0 // rorx r12d,r8d,0x16
+ LONG $0x2a148d42 // lea edx,[rdx+r13*1]
+ WORD $0x3145; BYTE $0xcf // xor r15d,r9d
+ LONG $0xf07b43c4; WORD $0x0df0 // rorx r14d,r8d,0xd
+ LONG $0xf07b43c4; WORD $0x02e8 // rorx r13d,r8d,0x2
+ LONG $0x131c8d45 // lea r11d,[r11+rdx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xcf // xor edi,r9d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x148d; BYTE $0x3a // lea edx,[rdx+rdi*1]
+ WORD $0x8941; BYTE $0xc4 // mov r12d,eax
+
+ // ROUND(DX, R8, R9, R10, R11, AX, BX, CX, R12, R13, R14, DI, R15, SP, 0x64)
+ LONG $0x64244c03 // add ecx,[rsp+0x64]
+ WORD $0x2145; BYTE $0xdc // and r12d,r11d
+ LONG $0xf07b43c4; WORD $0x19eb // rorx r13d,r11d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bfb // rorx edi,r11d,0xb
+ LONG $0x32148d42 // lea edx,[rdx+r14*1]
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ LONG $0xf22062c4; BYTE $0xe3 // andn r12d,r11d,ebx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f3 // rorx r14d,r11d,0x6
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xd789 // mov edi,edx
+ LONG $0xf07b63c4; WORD $0x16e2 // rorx r12d,edx,0x16
+ LONG $0x290c8d42 // lea ecx,[rcx+r13*1]
+ WORD $0x3144; BYTE $0xc7 // xor edi,r8d
+ LONG $0xf07b63c4; WORD $0x0df2 // rorx r14d,edx,0xd
+ LONG $0xf07b63c4; WORD $0x02ea // rorx r13d,edx,0x2
+ LONG $0x0a148d45 // lea r10d,[r10+rcx*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xc7 // xor r15d,r8d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d42 // lea ecx,[rcx+r15*1]
+ WORD $0x8945; BYTE $0xdc // mov r12d,r11d
+
+ // ROUND(CX, DX, R8, R9, R10, R11, AX, BX, R12, R13, R14, R15, DI, SP, 0x68)
+ LONG $0x68245c03 // add ebx,[rsp+0x68]
+ WORD $0x2145; BYTE $0xd4 // and r12d,r10d
+ LONG $0xf07b43c4; WORD $0x19ea // rorx r13d,r10d,0x19
+ LONG $0xf07b43c4; WORD $0x0bfa // rorx r15d,r10d,0xb
+ LONG $0x310c8d42 // lea ecx,[rcx+r14*1]
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ LONG $0xf22862c4; BYTE $0xe0 // andn r12d,r10d,eax
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f2 // rorx r14d,r10d,0x6
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xcf // mov r15d,ecx
+ LONG $0xf07b63c4; WORD $0x16e1 // rorx r12d,ecx,0x16
+ LONG $0x2b1c8d42 // lea ebx,[rbx+r13*1]
+ WORD $0x3141; BYTE $0xd7 // xor r15d,edx
+ LONG $0xf07b63c4; WORD $0x0df1 // rorx r14d,ecx,0xd
+ LONG $0xf07b63c4; WORD $0x02e9 // rorx r13d,ecx,0x2
+ LONG $0x190c8d45 // lea r9d,[r9+rbx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xd731 // xor edi,edx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x1c8d; BYTE $0x3b // lea ebx,[rbx+rdi*1]
+ WORD $0x8945; BYTE $0xd4 // mov r12d,r10d
+
+ // ROUND(BX, CX, DX, R8, R9, R10, R11, AX, R12, R13, R14, DI, R15, SP, 0x6c)
+ LONG $0x6c244403 // add eax,[rsp+0x6c]
+ WORD $0x2145; BYTE $0xcc // and r12d,r9d
+ LONG $0xf07b43c4; WORD $0x19e9 // rorx r13d,r9d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bf9 // rorx edi,r9d,0xb
+ LONG $0x331c8d42 // lea ebx,[rbx+r14*1]
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ LONG $0xf23042c4; BYTE $0xe3 // andn r12d,r9d,r11d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f1 // rorx r14d,r9d,0x6
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xdf89 // mov edi,ebx
+ LONG $0xf07b63c4; WORD $0x16e3 // rorx r12d,ebx,0x16
+ LONG $0x28048d42 // lea eax,[rax+r13*1]
+ WORD $0xcf31 // xor edi,ecx
+ LONG $0xf07b63c4; WORD $0x0df3 // rorx r14d,ebx,0xd
+ LONG $0xf07b63c4; WORD $0x02eb // rorx r13d,ebx,0x2
+ LONG $0x00048d45 // lea r8d,[r8+rax*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xcf // xor r15d,ecx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d42 // lea eax,[rax+r15*1]
+ WORD $0x8945; BYTE $0xcc // mov r12d,r9d
+
+ // ROUND(AX, BX, CX, DX, R8, R9, R10, R11, R12, R13, R14, R15, DI, SP, 0x00)
+ LONG $0x241c0344 // add r11d,[rsp]
+ WORD $0x2145; BYTE $0xc4 // and r12d,r8d
+ LONG $0xf07b43c4; WORD $0x19e8 // rorx r13d,r8d,0x19
+ LONG $0xf07b43c4; WORD $0x0bf8 // rorx r15d,r8d,0xb
+ LONG $0x30048d42 // lea eax,[rax+r14*1]
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ LONG $0xf23842c4; BYTE $0xe2 // andn r12d,r8d,r10d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f0 // rorx r14d,r8d,0x6
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xc7 // mov r15d,eax
+ LONG $0xf07b63c4; WORD $0x16e0 // rorx r12d,eax,0x16
+ LONG $0x2b1c8d47 // lea r11d,[r11+r13*1]
+ WORD $0x3141; BYTE $0xdf // xor r15d,ebx
+ LONG $0xf07b63c4; WORD $0x0df0 // rorx r14d,eax,0xd
+ LONG $0xf07b63c4; WORD $0x02e8 // rorx r13d,eax,0x2
+ LONG $0x1a148d42 // lea edx,[rdx+r11*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xdf31 // xor edi,ebx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3b1c8d45 // lea r11d,[r11+rdi*1]
+ WORD $0x8945; BYTE $0xc4 // mov r12d,r8d
+
+ // ROUND(R11, AX, BX, CX, DX, R8, R9, R10, R12, R13, R14, DI, R15, SP, 0x04)
+ LONG $0x24540344; BYTE $0x04 // add r10d,[rsp+0x4]
+ WORD $0x2141; BYTE $0xd4 // and r12d,edx
+ LONG $0xf07b63c4; WORD $0x19ea // rorx r13d,edx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfa // rorx edi,edx,0xb
+ LONG $0x331c8d47 // lea r11d,[r11+r14*1]
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ LONG $0xf26842c4; BYTE $0xe1 // andn r12d,edx,r9d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f2 // rorx r14d,edx,0x6
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xdf // mov edi,r11d
+ LONG $0xf07b43c4; WORD $0x16e3 // rorx r12d,r11d,0x16
+ LONG $0x2a148d47 // lea r10d,[r10+r13*1]
+ WORD $0xc731 // xor edi,eax
+ LONG $0xf07b43c4; WORD $0x0df3 // rorx r14d,r11d,0xd
+ LONG $0xf07b43c4; WORD $0x02eb // rorx r13d,r11d,0x2
+ LONG $0x110c8d42 // lea ecx,[rcx+r10*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xc7 // xor r15d,eax
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3a148d47 // lea r10d,[r10+r15*1]
+ WORD $0x8941; BYTE $0xd4 // mov r12d,edx
+
+ // ROUND(R10, R11, AX, BX, CX, DX, R8, R9, R12, R13, R14, R15, DI, SP, 0x08)
+ LONG $0x244c0344; BYTE $0x08 // add r9d,[rsp+0x8]
+ WORD $0x2141; BYTE $0xcc // and r12d,ecx
+ LONG $0xf07b63c4; WORD $0x19e9 // rorx r13d,ecx,0x19
+ LONG $0xf07b63c4; WORD $0x0bf9 // rorx r15d,ecx,0xb
+ LONG $0x32148d47 // lea r10d,[r10+r14*1]
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ LONG $0xf27042c4; BYTE $0xe0 // andn r12d,ecx,r8d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f1 // rorx r14d,ecx,0x6
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xd7 // mov r15d,r10d
+ LONG $0xf07b43c4; WORD $0x16e2 // rorx r12d,r10d,0x16
+ LONG $0x290c8d47 // lea r9d,[r9+r13*1]
+ WORD $0x3145; BYTE $0xdf // xor r15d,r11d
+ LONG $0xf07b43c4; WORD $0x0df2 // rorx r14d,r10d,0xd
+ LONG $0xf07b43c4; WORD $0x02ea // rorx r13d,r10d,0x2
+ LONG $0x0b1c8d42 // lea ebx,[rbx+r9*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xdf // xor edi,r11d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d45 // lea r9d,[r9+rdi*1]
+ WORD $0x8941; BYTE $0xcc // mov r12d,ecx
+
+ // ROUND(R9, R10, R11, AX, BX, CX, DX, R8, R12, R13, R14, DI, R15, SP, 0x0c)
+ LONG $0x24440344; BYTE $0x0c // add r8d,[rsp+0xc]
+ WORD $0x2141; BYTE $0xdc // and r12d,ebx
+ LONG $0xf07b63c4; WORD $0x19eb // rorx r13d,ebx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfb // rorx edi,ebx,0xb
+ LONG $0x310c8d47 // lea r9d,[r9+r14*1]
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ LONG $0xf26062c4; BYTE $0xe2 // andn r12d,ebx,edx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f3 // rorx r14d,ebx,0x6
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xcf // mov edi,r9d
+ LONG $0xf07b43c4; WORD $0x16e1 // rorx r12d,r9d,0x16
+ LONG $0x28048d47 // lea r8d,[r8+r13*1]
+ WORD $0x3144; BYTE $0xd7 // xor edi,r10d
+ LONG $0xf07b43c4; WORD $0x0df1 // rorx r14d,r9d,0xd
+ LONG $0xf07b43c4; WORD $0x02e9 // rorx r13d,r9d,0x2
+ LONG $0x00048d42 // lea eax,[rax+r8*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xd7 // xor r15d,r10d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d47 // lea r8d,[r8+r15*1]
+ WORD $0x8941; BYTE $0xdc // mov r12d,ebx
+
+ // ROUND(R8, R9, R10, R11, AX, BX, CX, DX, R12, R13, R14, R15, DI, SP, 0x20)
+ LONG $0x20245403 // add edx,[rsp+0x20]
+ WORD $0x2141; BYTE $0xc4 // and r12d,eax
+ LONG $0xf07b63c4; WORD $0x19e8 // rorx r13d,eax,0x19
+ LONG $0xf07b63c4; WORD $0x0bf8 // rorx r15d,eax,0xb
+ LONG $0x30048d47 // lea r8d,[r8+r14*1]
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ LONG $0xf27862c4; BYTE $0xe1 // andn r12d,eax,ecx
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f0 // rorx r14d,eax,0x6
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xc7 // mov r15d,r8d
+ LONG $0xf07b43c4; WORD $0x16e0 // rorx r12d,r8d,0x16
+ LONG $0x2a148d42 // lea edx,[rdx+r13*1]
+ WORD $0x3145; BYTE $0xcf // xor r15d,r9d
+ LONG $0xf07b43c4; WORD $0x0df0 // rorx r14d,r8d,0xd
+ LONG $0xf07b43c4; WORD $0x02e8 // rorx r13d,r8d,0x2
+ LONG $0x131c8d45 // lea r11d,[r11+rdx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xcf // xor edi,r9d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x148d; BYTE $0x3a // lea edx,[rdx+rdi*1]
+ WORD $0x8941; BYTE $0xc4 // mov r12d,eax
+
+ // ROUND(DX, R8, R9, R10, R11, AX, BX, CX, R12, R13, R14, DI, R15, SP, 0x24)
+ LONG $0x24244c03 // add ecx,[rsp+0x24]
+ WORD $0x2145; BYTE $0xdc // and r12d,r11d
+ LONG $0xf07b43c4; WORD $0x19eb // rorx r13d,r11d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bfb // rorx edi,r11d,0xb
+ LONG $0x32148d42 // lea edx,[rdx+r14*1]
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ LONG $0xf22062c4; BYTE $0xe3 // andn r12d,r11d,ebx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f3 // rorx r14d,r11d,0x6
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xd789 // mov edi,edx
+ LONG $0xf07b63c4; WORD $0x16e2 // rorx r12d,edx,0x16
+ LONG $0x290c8d42 // lea ecx,[rcx+r13*1]
+ WORD $0x3144; BYTE $0xc7 // xor edi,r8d
+ LONG $0xf07b63c4; WORD $0x0df2 // rorx r14d,edx,0xd
+ LONG $0xf07b63c4; WORD $0x02ea // rorx r13d,edx,0x2
+ LONG $0x0a148d45 // lea r10d,[r10+rcx*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xc7 // xor r15d,r8d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d42 // lea ecx,[rcx+r15*1]
+ WORD $0x8945; BYTE $0xdc // mov r12d,r11d
+
+ // ROUND(CX, DX, R8, R9, R10, R11, AX, BX, R12, R13, R14, R15, DI, SP, 0x28)
+ LONG $0x28245c03 // add ebx,[rsp+0x28]
+ WORD $0x2145; BYTE $0xd4 // and r12d,r10d
+ LONG $0xf07b43c4; WORD $0x19ea // rorx r13d,r10d,0x19
+ LONG $0xf07b43c4; WORD $0x0bfa // rorx r15d,r10d,0xb
+ LONG $0x310c8d42 // lea ecx,[rcx+r14*1]
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ LONG $0xf22862c4; BYTE $0xe0 // andn r12d,r10d,eax
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f2 // rorx r14d,r10d,0x6
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xcf // mov r15d,ecx
+ LONG $0xf07b63c4; WORD $0x16e1 // rorx r12d,ecx,0x16
+ LONG $0x2b1c8d42 // lea ebx,[rbx+r13*1]
+ WORD $0x3141; BYTE $0xd7 // xor r15d,edx
+ LONG $0xf07b63c4; WORD $0x0df1 // rorx r14d,ecx,0xd
+ LONG $0xf07b63c4; WORD $0x02e9 // rorx r13d,ecx,0x2
+ LONG $0x190c8d45 // lea r9d,[r9+rbx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xd731 // xor edi,edx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x1c8d; BYTE $0x3b // lea ebx,[rbx+rdi*1]
+ WORD $0x8945; BYTE $0xd4 // mov r12d,r10d
+
+ // ROUND(BX, CX, DX, R8, R9, R10, R11, AX, R12, R13, R14, DI, R15, SP, 0x2c)
+ LONG $0x2c244403 // add eax,[rsp+0x2c]
+ WORD $0x2145; BYTE $0xcc // and r12d,r9d
+ LONG $0xf07b43c4; WORD $0x19e9 // rorx r13d,r9d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bf9 // rorx edi,r9d,0xb
+ LONG $0x331c8d42 // lea ebx,[rbx+r14*1]
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ LONG $0xf23042c4; BYTE $0xe3 // andn r12d,r9d,r11d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f1 // rorx r14d,r9d,0x6
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xdf89 // mov edi,ebx
+ LONG $0xf07b63c4; WORD $0x16e3 // rorx r12d,ebx,0x16
+ LONG $0x28048d42 // lea eax,[rax+r13*1]
+ WORD $0xcf31 // xor edi,ecx
+ LONG $0xf07b63c4; WORD $0x0df3 // rorx r14d,ebx,0xd
+ LONG $0xf07b63c4; WORD $0x02eb // rorx r13d,ebx,0x2
+ LONG $0x00048d45 // lea r8d,[r8+rax*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xcf // xor r15d,ecx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d42 // lea eax,[rax+r15*1]
+ WORD $0x8945; BYTE $0xcc // mov r12d,r9d
+
+ MOVQ 0x200(SP), DI // $_ctx
+ ADDQ R14, AX
+
+ LEAQ 0x1c0(SP), BP
+
+ ADDL (DI), AX
+ ADDL 4(DI), BX
+ ADDL 8(DI), CX
+ ADDL 12(DI), DX
+ ADDL 16(DI), R8
+ ADDL 20(DI), R9
+ ADDL 24(DI), R10
+ ADDL 28(DI), R11
+
+ MOVL AX, (DI)
+ MOVL BX, 4(DI)
+ MOVL CX, 8(DI)
+ MOVL DX, 12(DI)
+ MOVL R8, 16(DI)
+ MOVL R9, 20(DI)
+ MOVL R10, 24(DI)
+ MOVL R11, 28(DI)
+
+ CMPQ SI, 0x50(BP) // $_end
+ JE done
+
+ XORQ R14, R14
+ MOVQ BX, DI
+ XORQ CX, DI // magic
+ MOVQ R9, R12
+
+loop2:
+ // ROUND(AX, BX, CX, DX, R8, R9, R10, R11, R12, R13, R14, R15, DI, BP, 0x10)
+ LONG $0x105d0344 // add r11d,[rbp+0x10]
+ WORD $0x2145; BYTE $0xc4 // and r12d,r8d
+ LONG $0xf07b43c4; WORD $0x19e8 // rorx r13d,r8d,0x19
+ LONG $0xf07b43c4; WORD $0x0bf8 // rorx r15d,r8d,0xb
+ LONG $0x30048d42 // lea eax,[rax+r14*1]
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ LONG $0xf23842c4; BYTE $0xe2 // andn r12d,r8d,r10d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f0 // rorx r14d,r8d,0x6
+ LONG $0x231c8d47 // lea r11d,[r11+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xc7 // mov r15d,eax
+ LONG $0xf07b63c4; WORD $0x16e0 // rorx r12d,eax,0x16
+ LONG $0x2b1c8d47 // lea r11d,[r11+r13*1]
+ WORD $0x3141; BYTE $0xdf // xor r15d,ebx
+ LONG $0xf07b63c4; WORD $0x0df0 // rorx r14d,eax,0xd
+ LONG $0xf07b63c4; WORD $0x02e8 // rorx r13d,eax,0x2
+ LONG $0x1a148d42 // lea edx,[rdx+r11*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xdf31 // xor edi,ebx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3b1c8d45 // lea r11d,[r11+rdi*1]
+ WORD $0x8945; BYTE $0xc4 // mov r12d,r8d
+
+ // ROUND(R11, AX, BX, CX, DX, R8, R9, R10, R12, R13, R14, DI, R15, BP, 0x14)
+ LONG $0x14550344 // add r10d,[rbp+0x14]
+ WORD $0x2141; BYTE $0xd4 // and r12d,edx
+ LONG $0xf07b63c4; WORD $0x19ea // rorx r13d,edx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfa // rorx edi,edx,0xb
+ LONG $0x331c8d47 // lea r11d,[r11+r14*1]
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ LONG $0xf26842c4; BYTE $0xe1 // andn r12d,edx,r9d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f2 // rorx r14d,edx,0x6
+ LONG $0x22148d47 // lea r10d,[r10+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xdf // mov edi,r11d
+ LONG $0xf07b43c4; WORD $0x16e3 // rorx r12d,r11d,0x16
+ LONG $0x2a148d47 // lea r10d,[r10+r13*1]
+ WORD $0xc731 // xor edi,eax
+ LONG $0xf07b43c4; WORD $0x0df3 // rorx r14d,r11d,0xd
+ LONG $0xf07b43c4; WORD $0x02eb // rorx r13d,r11d,0x2
+ LONG $0x110c8d42 // lea ecx,[rcx+r10*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xc7 // xor r15d,eax
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x3a148d47 // lea r10d,[r10+r15*1]
+ WORD $0x8941; BYTE $0xd4 // mov r12d,edx
+
+ // ROUND(R10, R11, AX, BX, CX, DX, R8, R9, R12, R13, R14, R15, DI, BP, 0x18)
+ LONG $0x184d0344 // add r9d,[rbp+0x18]
+ WORD $0x2141; BYTE $0xcc // and r12d,ecx
+ LONG $0xf07b63c4; WORD $0x19e9 // rorx r13d,ecx,0x19
+ LONG $0xf07b63c4; WORD $0x0bf9 // rorx r15d,ecx,0xb
+ LONG $0x32148d47 // lea r10d,[r10+r14*1]
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ LONG $0xf27042c4; BYTE $0xe0 // andn r12d,ecx,r8d
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f1 // rorx r14d,ecx,0x6
+ LONG $0x210c8d47 // lea r9d,[r9+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xd7 // mov r15d,r10d
+ LONG $0xf07b43c4; WORD $0x16e2 // rorx r12d,r10d,0x16
+ LONG $0x290c8d47 // lea r9d,[r9+r13*1]
+ WORD $0x3145; BYTE $0xdf // xor r15d,r11d
+ LONG $0xf07b43c4; WORD $0x0df2 // rorx r14d,r10d,0xd
+ LONG $0xf07b43c4; WORD $0x02ea // rorx r13d,r10d,0x2
+ LONG $0x0b1c8d42 // lea ebx,[rbx+r9*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xdf // xor edi,r11d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d45 // lea r9d,[r9+rdi*1]
+ WORD $0x8941; BYTE $0xcc // mov r12d,ecx
+
+ // ROUND(R9, R10, R11, AX, BX, CX, DX, R8, R12, R13, R14, DI, R15, BP, 0x1c)
+ LONG $0x1c450344 // add r8d,[rbp+0x1c]
+ WORD $0x2141; BYTE $0xdc // and r12d,ebx
+ LONG $0xf07b63c4; WORD $0x19eb // rorx r13d,ebx,0x19
+ LONG $0xf07be3c4; WORD $0x0bfb // rorx edi,ebx,0xb
+ LONG $0x310c8d47 // lea r9d,[r9+r14*1]
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ LONG $0xf26062c4; BYTE $0xe2 // andn r12d,ebx,edx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b63c4; WORD $0x06f3 // rorx r14d,ebx,0x6
+ LONG $0x20048d47 // lea r8d,[r8+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8944; BYTE $0xcf // mov edi,r9d
+ LONG $0xf07b43c4; WORD $0x16e1 // rorx r12d,r9d,0x16
+ LONG $0x28048d47 // lea r8d,[r8+r13*1]
+ WORD $0x3144; BYTE $0xd7 // xor edi,r10d
+ LONG $0xf07b43c4; WORD $0x0df1 // rorx r14d,r9d,0xd
+ LONG $0xf07b43c4; WORD $0x02e9 // rorx r13d,r9d,0x2
+ LONG $0x00048d42 // lea eax,[rax+r8*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xd7 // xor r15d,r10d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d47 // lea r8d,[r8+r15*1]
+ WORD $0x8941; BYTE $0xdc // mov r12d,ebx
+
+ // ROUND(R8, R9, R10, R11, AX, BX, CX, DX, R12, R13, R14, R15, DI, BP, 0x30)
+ WORD $0x5503; BYTE $0x30 // add edx,[rbp+0x30]
+ WORD $0x2141; BYTE $0xc4 // and r12d,eax
+ LONG $0xf07b63c4; WORD $0x19e8 // rorx r13d,eax,0x19
+ LONG $0xf07b63c4; WORD $0x0bf8 // rorx r15d,eax,0xb
+ LONG $0x30048d47 // lea r8d,[r8+r14*1]
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ LONG $0xf27862c4; BYTE $0xe1 // andn r12d,eax,ecx
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b63c4; WORD $0x06f0 // rorx r14d,eax,0x6
+ LONG $0x22148d42 // lea edx,[rdx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8945; BYTE $0xc7 // mov r15d,r8d
+ LONG $0xf07b43c4; WORD $0x16e0 // rorx r12d,r8d,0x16
+ LONG $0x2a148d42 // lea edx,[rdx+r13*1]
+ WORD $0x3145; BYTE $0xcf // xor r15d,r9d
+ LONG $0xf07b43c4; WORD $0x0df0 // rorx r14d,r8d,0xd
+ LONG $0xf07b43c4; WORD $0x02e8 // rorx r13d,r8d,0x2
+ LONG $0x131c8d45 // lea r11d,[r11+rdx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3144; BYTE $0xcf // xor edi,r9d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x148d; BYTE $0x3a // lea edx,[rdx+rdi*1]
+ WORD $0x8941; BYTE $0xc4 // mov r12d,eax
+
+ // ROUND(DX, R8, R9, R10, R11, AX, BX, CX, R12, R13, R14, DI, R15, BP, 0x34)
+ WORD $0x4d03; BYTE $0x34 // add ecx,[rbp+0x34]
+ WORD $0x2145; BYTE $0xdc // and r12d,r11d
+ LONG $0xf07b43c4; WORD $0x19eb // rorx r13d,r11d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bfb // rorx edi,r11d,0xb
+ LONG $0x32148d42 // lea edx,[rdx+r14*1]
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ LONG $0xf22062c4; BYTE $0xe3 // andn r12d,r11d,ebx
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f3 // rorx r14d,r11d,0x6
+ LONG $0x210c8d42 // lea ecx,[rcx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xd789 // mov edi,edx
+ LONG $0xf07b63c4; WORD $0x16e2 // rorx r12d,edx,0x16
+ LONG $0x290c8d42 // lea ecx,[rcx+r13*1]
+ WORD $0x3144; BYTE $0xc7 // xor edi,r8d
+ LONG $0xf07b63c4; WORD $0x0df2 // rorx r14d,edx,0xd
+ LONG $0xf07b63c4; WORD $0x02ea // rorx r13d,edx,0x2
+ LONG $0x0a148d45 // lea r10d,[r10+rcx*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3145; BYTE $0xc7 // xor r15d,r8d
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x390c8d42 // lea ecx,[rcx+r15*1]
+ WORD $0x8945; BYTE $0xdc // mov r12d,r11d
+
+ // ROUND(CX, DX, R8, R9, R10, R11, AX, BX, R12, R13, R14, R15, DI, BP, 0x38)
+ WORD $0x5d03; BYTE $0x38 // add ebx,[rbp+0x38]
+ WORD $0x2145; BYTE $0xd4 // and r12d,r10d
+ LONG $0xf07b43c4; WORD $0x19ea // rorx r13d,r10d,0x19
+ LONG $0xf07b43c4; WORD $0x0bfa // rorx r15d,r10d,0xb
+ LONG $0x310c8d42 // lea ecx,[rcx+r14*1]
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ LONG $0xf22862c4; BYTE $0xe0 // andn r12d,r10d,eax
+ WORD $0x3145; BYTE $0xfd // xor r13d,r15d
+ LONG $0xf07b43c4; WORD $0x06f2 // rorx r14d,r10d,0x6
+ LONG $0x231c8d42 // lea ebx,[rbx+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0x8941; BYTE $0xcf // mov r15d,ecx
+ LONG $0xf07b63c4; WORD $0x16e1 // rorx r12d,ecx,0x16
+ LONG $0x2b1c8d42 // lea ebx,[rbx+r13*1]
+ WORD $0x3141; BYTE $0xd7 // xor r15d,edx
+ LONG $0xf07b63c4; WORD $0x0df1 // rorx r14d,ecx,0xd
+ LONG $0xf07b63c4; WORD $0x02e9 // rorx r13d,ecx,0x2
+ LONG $0x190c8d45 // lea r9d,[r9+rbx*1]
+ WORD $0x2144; BYTE $0xff // and edi,r15d
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0xd731 // xor edi,edx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ WORD $0x1c8d; BYTE $0x3b // lea ebx,[rbx+rdi*1]
+ WORD $0x8945; BYTE $0xd4 // mov r12d,r10d
+
+ // ROUND(BX, CX, DX, R8, R9, R10, R11, AX, R12, R13, R14, DI, R15, BP, 0x3c)
+ WORD $0x4503; BYTE $0x3c // add eax,[rbp+0x3c]
+ WORD $0x2145; BYTE $0xcc // and r12d,r9d
+ LONG $0xf07b43c4; WORD $0x19e9 // rorx r13d,r9d,0x19
+ LONG $0xf07bc3c4; WORD $0x0bf9 // rorx edi,r9d,0xb
+ LONG $0x331c8d42 // lea ebx,[rbx+r14*1]
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ LONG $0xf23042c4; BYTE $0xe3 // andn r12d,r9d,r11d
+ WORD $0x3141; BYTE $0xfd // xor r13d,edi
+ LONG $0xf07b43c4; WORD $0x06f1 // rorx r14d,r9d,0x6
+ LONG $0x20048d42 // lea eax,[rax+r12*1]
+ WORD $0x3145; BYTE $0xf5 // xor r13d,r14d
+ WORD $0xdf89 // mov edi,ebx
+ LONG $0xf07b63c4; WORD $0x16e3 // rorx r12d,ebx,0x16
+ LONG $0x28048d42 // lea eax,[rax+r13*1]
+ WORD $0xcf31 // xor edi,ecx
+ LONG $0xf07b63c4; WORD $0x0df3 // rorx r14d,ebx,0xd
+ LONG $0xf07b63c4; WORD $0x02eb // rorx r13d,ebx,0x2
+ LONG $0x00048d45 // lea r8d,[r8+rax*1]
+ WORD $0x2141; BYTE $0xff // and r15d,edi
+ WORD $0x3145; BYTE $0xe6 // xor r14d,r12d
+ WORD $0x3141; BYTE $0xcf // xor r15d,ecx
+ WORD $0x3145; BYTE $0xee // xor r14d,r13d
+ LONG $0x38048d42 // lea eax,[rax+r15*1]
+ WORD $0x8945; BYTE $0xcc // mov r12d,r9d
+
+ ADDQ $-0x40, BP
+ CMPQ BP, SP
+ JAE loop2
+
+ MOVQ 0x200(SP), DI // $_ctx
+ ADDQ R14, AX
+
+ ADDQ $0x1c0, SP
+
+ ADDL (DI), AX
+ ADDL 4(DI), BX
+ ADDL 8(DI), CX
+ ADDL 12(DI), DX
+ ADDL 16(DI), R8
+ ADDL 20(DI), R9
+
+ ADDQ $0x80, SI // input += 2
+ ADDL 24(DI), R10
+ MOVQ SI, R12
+ ADDL 28(DI), R11
+ CMPQ SI, 0x50(SP) // input == _end
+
+ MOVL AX, (DI)
+ LONG $0xe4440f4c // cmove r12,rsp /* next block or stale data */
+ MOVL AX, (DI)
+ MOVL BX, 4(DI)
+ MOVL CX, 8(DI)
+ MOVL DX, 12(DI)
+ MOVL R8, 16(DI)
+ MOVL R9, 20(DI)
+ MOVL R10, 24(DI)
+ MOVL R11, 28(DI)
+
+ JBE loop0
+ LEAQ (SP), BP
+
+done:
+ MOVQ BP, SP
+ MOVQ 0x58(SP), SP // restore saved stack pointer
+ WORD $0xf8c5; BYTE $0x77 // vzeroupper
+
+ RET
+
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.asm b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.asm
new file mode 100644
index 0000000000..c959b1aa26
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.asm
@@ -0,0 +1,686 @@
+
+// 16x Parallel implementation of SHA256 for AVX512
+
+//
+// Minio Cloud Storage, (C) 2017 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//
+// This code is based on the Intel Multi-Buffer Crypto for IPSec library
+// and more specifically the following implementation:
+// https://github.com/intel/intel-ipsec-mb/blob/master/avx512/sha256_x16_avx512.asm
+//
+// For Golang it has been converted into Plan 9 assembly with the help of
+// github.com/minio/asm2plan9s to assemble the AVX512 instructions
+//
+
+// Copyright (c) 2017, Intel Corporation
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Intel Corporation nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#define SHA256_DIGEST_ROW_SIZE 64
+
+// arg1
+#define STATE rdi
+#define STATE_P9 DI
+// arg2
+#define INP_SIZE rsi
+#define INP_SIZE_P9 SI
+
+#define IDX rcx
+#define TBL rdx
+#define TBL_P9 DX
+
+#define INPUT rax
+#define INPUT_P9 AX
+
+#define inp0 r9
+#define SCRATCH_P9 R12
+#define SCRATCH r12
+#define maskp r13
+#define MASKP_P9 R13
+#define mask r14
+#define MASK_P9 R14
+
+#define A zmm0
+#define B zmm1
+#define C zmm2
+#define D zmm3
+#define E zmm4
+#define F zmm5
+#define G zmm6
+#define H zmm7
+#define T1 zmm8
+#define TMP0 zmm9
+#define TMP1 zmm10
+#define TMP2 zmm11
+#define TMP3 zmm12
+#define TMP4 zmm13
+#define TMP5 zmm14
+#define TMP6 zmm15
+
+#define W0 zmm16
+#define W1 zmm17
+#define W2 zmm18
+#define W3 zmm19
+#define W4 zmm20
+#define W5 zmm21
+#define W6 zmm22
+#define W7 zmm23
+#define W8 zmm24
+#define W9 zmm25
+#define W10 zmm26
+#define W11 zmm27
+#define W12 zmm28
+#define W13 zmm29
+#define W14 zmm30
+#define W15 zmm31
+
+
+#define TRANSPOSE16(_r0, _r1, _r2, _r3, _r4, _r5, _r6, _r7, _r8, _r9, _r10, _r11, _r12, _r13, _r14, _r15, _t0, _t1) \
+ \
+ \ // input r0 = {a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0}
+ \ // r1 = {b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0}
+ \ // r2 = {c15 c14 c13 c12 c11 c10 c9 c8 c7 c6 c5 c4 c3 c2 c1 c0}
+ \ // r3 = {d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0}
+ \ // r4 = {e15 e14 e13 e12 e11 e10 e9 e8 e7 e6 e5 e4 e3 e2 e1 e0}
+ \ // r5 = {f15 f14 f13 f12 f11 f10 f9 f8 f7 f6 f5 f4 f3 f2 f1 f0}
+ \ // r6 = {g15 g14 g13 g12 g11 g10 g9 g8 g7 g6 g5 g4 g3 g2 g1 g0}
+ \ // r7 = {h15 h14 h13 h12 h11 h10 h9 h8 h7 h6 h5 h4 h3 h2 h1 h0}
+ \ // r8 = {i15 i14 i13 i12 i11 i10 i9 i8 i7 i6 i5 i4 i3 i2 i1 i0}
+ \ // r9 = {j15 j14 j13 j12 j11 j10 j9 j8 j7 j6 j5 j4 j3 j2 j1 j0}
+ \ // r10 = {k15 k14 k13 k12 k11 k10 k9 k8 k7 k6 k5 k4 k3 k2 k1 k0}
+ \ // r11 = {l15 l14 l13 l12 l11 l10 l9 l8 l7 l6 l5 l4 l3 l2 l1 l0}
+ \ // r12 = {m15 m14 m13 m12 m11 m10 m9 m8 m7 m6 m5 m4 m3 m2 m1 m0}
+ \ // r13 = {n15 n14 n13 n12 n11 n10 n9 n8 n7 n6 n5 n4 n3 n2 n1 n0}
+ \ // r14 = {o15 o14 o13 o12 o11 o10 o9 o8 o7 o6 o5 o4 o3 o2 o1 o0}
+ \ // r15 = {p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0}
+ \
+ \ // output r0 = { p0 o0 n0 m0 l0 k0 j0 i0 h0 g0 f0 e0 d0 c0 b0 a0}
+ \ // r1 = { p1 o1 n1 m1 l1 k1 j1 i1 h1 g1 f1 e1 d1 c1 b1 a1}
+ \ // r2 = { p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2}
+ \ // r3 = { p3 o3 n3 m3 l3 k3 j3 i3 h3 g3 f3 e3 d3 c3 b3 a3}
+ \ // r4 = { p4 o4 n4 m4 l4 k4 j4 i4 h4 g4 f4 e4 d4 c4 b4 a4}
+ \ // r5 = { p5 o5 n5 m5 l5 k5 j5 i5 h5 g5 f5 e5 d5 c5 b5 a5}
+ \ // r6 = { p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6}
+ \ // r7 = { p7 o7 n7 m7 l7 k7 j7 i7 h7 g7 f7 e7 d7 c7 b7 a7}
+ \ // r8 = { p8 o8 n8 m8 l8 k8 j8 i8 h8 g8 f8 e8 d8 c8 b8 a8}
+ \ // r9 = { p9 o9 n9 m9 l9 k9 j9 i9 h9 g9 f9 e9 d9 c9 b9 a9}
+ \ // r10 = {p10 o10 n10 m10 l10 k10 j10 i10 h10 g10 f10 e10 d10 c10 b10 a10}
+ \ // r11 = {p11 o11 n11 m11 l11 k11 j11 i11 h11 g11 f11 e11 d11 c11 b11 a11}
+ \ // r12 = {p12 o12 n12 m12 l12 k12 j12 i12 h12 g12 f12 e12 d12 c12 b12 a12}
+ \ // r13 = {p13 o13 n13 m13 l13 k13 j13 i13 h13 g13 f13 e13 d13 c13 b13 a13}
+ \ // r14 = {p14 o14 n14 m14 l14 k14 j14 i14 h14 g14 f14 e14 d14 c14 b14 a14}
+ \ // r15 = {p15 o15 n15 m15 l15 k15 j15 i15 h15 g15 f15 e15 d15 c15 b15 a15}
+ \
+ \ // process top half
+ vshufps _t0, _r0, _r1, 0x44 \ // t0 = {b13 b12 a13 a12 b9 b8 a9 a8 b5 b4 a5 a4 b1 b0 a1 a0}
+ vshufps _r0, _r0, _r1, 0xEE \ // r0 = {b15 b14 a15 a14 b11 b10 a11 a10 b7 b6 a7 a6 b3 b2 a3 a2}
+ vshufps _t1, _r2, _r3, 0x44 \ // t1 = {d13 d12 c13 c12 d9 d8 c9 c8 d5 d4 c5 c4 d1 d0 c1 c0}
+ vshufps _r2, _r2, _r3, 0xEE \ // r2 = {d15 d14 c15 c14 d11 d10 c11 c10 d7 d6 c7 c6 d3 d2 c3 c2}
+ \
+ vshufps _r3, _t0, _t1, 0xDD \ // r3 = {d13 c13 b13 a13 d9 c9 b9 a9 d5 c5 b5 a5 d1 c1 b1 a1}
+ vshufps _r1, _r0, _r2, 0x88 \ // r1 = {d14 c14 b14 a14 d10 c10 b10 a10 d6 c6 b6 a6 d2 c2 b2 a2}
+ vshufps _r0, _r0, _r2, 0xDD \ // r0 = {d15 c15 b15 a15 d11 c11 b11 a11 d7 c7 b7 a7 d3 c3 b3 a3}
+ vshufps _t0, _t0, _t1, 0x88 \ // t0 = {d12 c12 b12 a12 d8 c8 b8 a8 d4 c4 b4 a4 d0 c0 b0 a0}
+ \
+ \ // use r2 in place of t0
+ vshufps _r2, _r4, _r5, 0x44 \ // r2 = {f13 f12 e13 e12 f9 f8 e9 e8 f5 f4 e5 e4 f1 f0 e1 e0}
+ vshufps _r4, _r4, _r5, 0xEE \ // r4 = {f15 f14 e15 e14 f11 f10 e11 e10 f7 f6 e7 e6 f3 f2 e3 e2}
+ vshufps _t1, _r6, _r7, 0x44 \ // t1 = {h13 h12 g13 g12 h9 h8 g9 g8 h5 h4 g5 g4 h1 h0 g1 g0}
+ vshufps _r6, _r6, _r7, 0xEE \ // r6 = {h15 h14 g15 g14 h11 h10 g11 g10 h7 h6 g7 g6 h3 h2 g3 g2}
+ \
+ vshufps _r7, _r2, _t1, 0xDD \ // r7 = {h13 g13 f13 e13 h9 g9 f9 e9 h5 g5 f5 e5 h1 g1 f1 e1}
+ vshufps _r5, _r4, _r6, 0x88 \ // r5 = {h14 g14 f14 e14 h10 g10 f10 e10 h6 g6 f6 e6 h2 g2 f2 e2}
+ vshufps _r4, _r4, _r6, 0xDD \ // r4 = {h15 g15 f15 e15 h11 g11 f11 e11 h7 g7 f7 e7 h3 g3 f3 e3}
+ vshufps _r2, _r2, _t1, 0x88 \ // r2 = {h12 g12 f12 e12 h8 g8 f8 e8 h4 g4 f4 e4 h0 g0 f0 e0}
+ \
+ \ // use r6 in place of t0
+ vshufps _r6, _r8, _r9, 0x44 \ // r6 = {j13 j12 i13 i12 j9 j8 i9 i8 j5 j4 i5 i4 j1 j0 i1 i0}
+ vshufps _r8, _r8, _r9, 0xEE \ // r8 = {j15 j14 i15 i14 j11 j10 i11 i10 j7 j6 i7 i6 j3 j2 i3 i2}
+ vshufps _t1, _r10, _r11, 0x44 \ // t1 = {l13 l12 k13 k12 l9 l8 k9 k8 l5 l4 k5 k4 l1 l0 k1 k0}
+ vshufps _r10, _r10, _r11, 0xEE \ // r10 = {l15 l14 k15 k14 l11 l10 k11 k10 l7 l6 k7 k6 l3 l2 k3 k2}
+ \
+ vshufps _r11, _r6, _t1, 0xDD \ // r11 = {l13 k13 j13 113 l9 k9 j9 i9 l5 k5 j5 i5 l1 k1 j1 i1}
+ vshufps _r9, _r8, _r10, 0x88 \ // r9 = {l14 k14 j14 114 l10 k10 j10 i10 l6 k6 j6 i6 l2 k2 j2 i2}
+ vshufps _r8, _r8, _r10, 0xDD \ // r8 = {l15 k15 j15 115 l11 k11 j11 i11 l7 k7 j7 i7 l3 k3 j3 i3}
+ vshufps _r6, _r6, _t1, 0x88 \ // r6 = {l12 k12 j12 112 l8 k8 j8 i8 l4 k4 j4 i4 l0 k0 j0 i0}
+ \
+ \ // use r10 in place of t0
+ vshufps _r10, _r12, _r13, 0x44 \ // r10 = {n13 n12 m13 m12 n9 n8 m9 m8 n5 n4 m5 m4 n1 n0 a1 m0}
+ vshufps _r12, _r12, _r13, 0xEE \ // r12 = {n15 n14 m15 m14 n11 n10 m11 m10 n7 n6 m7 m6 n3 n2 a3 m2}
+ vshufps _t1, _r14, _r15, 0x44 \ // t1 = {p13 p12 013 012 p9 p8 09 08 p5 p4 05 04 p1 p0 01 00}
+ vshufps _r14, _r14, _r15, 0xEE \ // r14 = {p15 p14 015 014 p11 p10 011 010 p7 p6 07 06 p3 p2 03 02}
+ \
+ vshufps _r15, _r10, _t1, 0xDD \ // r15 = {p13 013 n13 m13 p9 09 n9 m9 p5 05 n5 m5 p1 01 n1 m1}
+ vshufps _r13, _r12, _r14, 0x88 \ // r13 = {p14 014 n14 m14 p10 010 n10 m10 p6 06 n6 m6 p2 02 n2 m2}
+ vshufps _r12, _r12, _r14, 0xDD \ // r12 = {p15 015 n15 m15 p11 011 n11 m11 p7 07 n7 m7 p3 03 n3 m3}
+ vshufps _r10, _r10, _t1, 0x88 \ // r10 = {p12 012 n12 m12 p8 08 n8 m8 p4 04 n4 m4 p0 00 n0 m0}
+ \
+ \ // At this point, the registers that contain interesting data are:
+ \ // t0, r3, r1, r0, r2, r7, r5, r4, r6, r11, r9, r8, r10, r15, r13, r12
+ \ // Can use t1 and r14 as scratch registers
+ LEAQ PSHUFFLE_TRANSPOSE16_MASK1<>(SB), BX \
+ LEAQ PSHUFFLE_TRANSPOSE16_MASK2<>(SB), R8 \
+ \
+ vmovdqu32 _r14, [rbx] \
+ vpermi2q _r14, _t0, _r2 \ // r14 = {h8 g8 f8 e8 d8 c8 b8 a8 h0 g0 f0 e0 d0 c0 b0 a0}
+ vmovdqu32 _t1, [r8] \
+ vpermi2q _t1, _t0, _r2 \ // t1 = {h12 g12 f12 e12 d12 c12 b12 a12 h4 g4 f4 e4 d4 c4 b4 a4}
+ \
+ vmovdqu32 _r2, [rbx] \
+ vpermi2q _r2, _r3, _r7 \ // r2 = {h9 g9 f9 e9 d9 c9 b9 a9 h1 g1 f1 e1 d1 c1 b1 a1}
+ vmovdqu32 _t0, [r8] \
+ vpermi2q _t0, _r3, _r7 \ // t0 = {h13 g13 f13 e13 d13 c13 b13 a13 h5 g5 f5 e5 d5 c5 b5 a5}
+ \
+ vmovdqu32 _r3, [rbx] \
+ vpermi2q _r3, _r1, _r5 \ // r3 = {h10 g10 f10 e10 d10 c10 b10 a10 h2 g2 f2 e2 d2 c2 b2 a2}
+ vmovdqu32 _r7, [r8] \
+ vpermi2q _r7, _r1, _r5 \ // r7 = {h14 g14 f14 e14 d14 c14 b14 a14 h6 g6 f6 e6 d6 c6 b6 a6}
+ \
+ vmovdqu32 _r1, [rbx] \
+ vpermi2q _r1, _r0, _r4 \ // r1 = {h11 g11 f11 e11 d11 c11 b11 a11 h3 g3 f3 e3 d3 c3 b3 a3}
+ vmovdqu32 _r5, [r8] \
+ vpermi2q _r5, _r0, _r4 \ // r5 = {h15 g15 f15 e15 d15 c15 b15 a15 h7 g7 f7 e7 d7 c7 b7 a7}
+ \
+ vmovdqu32 _r0, [rbx] \
+ vpermi2q _r0, _r6, _r10 \ // r0 = {p8 o8 n8 m8 l8 k8 j8 i8 p0 o0 n0 m0 l0 k0 j0 i0}
+ vmovdqu32 _r4, [r8] \
+ vpermi2q _r4, _r6, _r10 \ // r4 = {p12 o12 n12 m12 l12 k12 j12 i12 p4 o4 n4 m4 l4 k4 j4 i4}
+ \
+ vmovdqu32 _r6, [rbx] \
+ vpermi2q _r6, _r11, _r15 \ // r6 = {p9 o9 n9 m9 l9 k9 j9 i9 p1 o1 n1 m1 l1 k1 j1 i1}
+ vmovdqu32 _r10, [r8] \
+ vpermi2q _r10, _r11, _r15 \ // r10 = {p13 o13 n13 m13 l13 k13 j13 i13 p5 o5 n5 m5 l5 k5 j5 i5}
+ \
+ vmovdqu32 _r11, [rbx] \
+ vpermi2q _r11, _r9, _r13 \ // r11 = {p10 o10 n10 m10 l10 k10 j10 i10 p2 o2 n2 m2 l2 k2 j2 i2}
+ vmovdqu32 _r15, [r8] \
+ vpermi2q _r15, _r9, _r13 \ // r15 = {p14 o14 n14 m14 l14 k14 j14 i14 p6 o6 n6 m6 l6 k6 j6 i6}
+ \
+ vmovdqu32 _r9, [rbx] \
+ vpermi2q _r9, _r8, _r12 \ // r9 = {p11 o11 n11 m11 l11 k11 j11 i11 p3 o3 n3 m3 l3 k3 j3 i3}
+ vmovdqu32 _r13, [r8] \
+ vpermi2q _r13, _r8, _r12 \ // r13 = {p15 o15 n15 m15 l15 k15 j15 i15 p7 o7 n7 m7 l7 k7 j7 i7}
+ \
+ \ // At this point r8 and r12 can be used as scratch registers
+ vshuff64x2 _r8, _r14, _r0, 0xEE \ // r8 = {p8 o8 n8 m8 l8 k8 j8 i8 h8 g8 f8 e8 d8 c8 b8 a8}
+ vshuff64x2 _r0, _r14, _r0, 0x44 \ // r0 = {p0 o0 n0 m0 l0 k0 j0 i0 h0 g0 f0 e0 d0 c0 b0 a0}
+ \
+ vshuff64x2 _r12, _t1, _r4, 0xEE \ // r12 = {p12 o12 n12 m12 l12 k12 j12 i12 h12 g12 f12 e12 d12 c12 b12 a12}
+ vshuff64x2 _r4, _t1, _r4, 0x44 \ // r4 = {p4 o4 n4 m4 l4 k4 j4 i4 h4 g4 f4 e4 d4 c4 b4 a4}
+ \
+ vshuff64x2 _r14, _r7, _r15, 0xEE \ // r14 = {p14 o14 n14 m14 l14 k14 j14 i14 h14 g14 f14 e14 d14 c14 b14 a14}
+ vshuff64x2 _t1, _r7, _r15, 0x44 \ // t1 = {p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6}
+ \
+ vshuff64x2 _r15, _r5, _r13, 0xEE \ // r15 = {p15 o15 n15 m15 l15 k15 j15 i15 h15 g15 f15 e15 d15 c15 b15 a15}
+ vshuff64x2 _r7, _r5, _r13, 0x44 \ // r7 = {p7 o7 n7 m7 l7 k7 j7 i7 h7 g7 f7 e7 d7 c7 b7 a7}
+ \
+ vshuff64x2 _r13, _t0, _r10, 0xEE \ // r13 = {p13 o13 n13 m13 l13 k13 j13 i13 h13 g13 f13 e13 d13 c13 b13 a13}
+ vshuff64x2 _r5, _t0, _r10, 0x44 \ // r5 = {p5 o5 n5 m5 l5 k5 j5 i5 h5 g5 f5 e5 d5 c5 b5 a5}
+ \
+ vshuff64x2 _r10, _r3, _r11, 0xEE \ // r10 = {p10 o10 n10 m10 l10 k10 j10 i10 h10 g10 f10 e10 d10 c10 b10 a10}
+ vshuff64x2 _t0, _r3, _r11, 0x44 \ // t0 = {p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2}
+ \
+ vshuff64x2 _r11, _r1, _r9, 0xEE \ // r11 = {p11 o11 n11 m11 l11 k11 j11 i11 h11 g11 f11 e11 d11 c11 b11 a11}
+ vshuff64x2 _r3, _r1, _r9, 0x44 \ // r3 = {p3 o3 n3 m3 l3 k3 j3 i3 h3 g3 f3 e3 d3 c3 b3 a3}
+ \
+ vshuff64x2 _r9, _r2, _r6, 0xEE \ // r9 = {p9 o9 n9 m9 l9 k9 j9 i9 h9 g9 f9 e9 d9 c9 b9 a9}
+ vshuff64x2 _r1, _r2, _r6, 0x44 \ // r1 = {p1 o1 n1 m1 l1 k1 j1 i1 h1 g1 f1 e1 d1 c1 b1 a1}
+ \
+ vmovdqu32 _r2, _t0 \ // r2 = {p2 o2 n2 m2 l2 k2 j2 i2 h2 g2 f2 e2 d2 c2 b2 a2}
+ vmovdqu32 _r6, _t1 \ // r6 = {p6 o6 n6 m6 l6 k6 j6 i6 h6 g6 f6 e6 d6 c6 b6 a6}
+
+
+// CH(A, B, C) = (A&B) ^ (~A&C)
+// MAJ(E, F, G) = (E&F) ^ (E&G) ^ (F&G)
+// SIGMA0 = ROR_2 ^ ROR_13 ^ ROR_22
+// SIGMA1 = ROR_6 ^ ROR_11 ^ ROR_25
+// sigma0 = ROR_7 ^ ROR_18 ^ SHR_3
+// sigma1 = ROR_17 ^ ROR_19 ^ SHR_10
+
+// Main processing loop per round
+#define PROCESS_LOOP(_WT, _ROUND, _A, _B, _C, _D, _E, _F, _G, _H) \
+ \ // T1 = H + SIGMA1(E) + CH(E, F, G) + Kt + Wt
+ \ // T2 = SIGMA0(A) + MAJ(A, B, C)
+ \ // H=G, G=F, F=E, E=D+T1, D=C, C=B, B=A, A=T1+T2
+ \
+ \ // H becomes T2, then add T1 for A
+ \ // D becomes D + T1 for E
+ \
+ vpaddd T1, _H, TMP3 \ // T1 = H + Kt
+ vmovdqu32 TMP0, _E \
+ vprord TMP1, _E, 6 \ // ROR_6(E)
+ vprord TMP2, _E, 11 \ // ROR_11(E)
+ vprord TMP3, _E, 25 \ // ROR_25(E)
+ vpternlogd TMP0, _F, _G, 0xCA \ // TMP0 = CH(E,F,G)
+ vpaddd T1, T1, _WT \ // T1 = T1 + Wt
+ vpternlogd TMP1, TMP2, TMP3, 0x96 \ // TMP1 = SIGMA1(E)
+ vpaddd T1, T1, TMP0 \ // T1 = T1 + CH(E,F,G)
+ vpaddd T1, T1, TMP1 \ // T1 = T1 + SIGMA1(E)
+ vpaddd _D, _D, T1 \ // D = D + T1
+ \
+ vprord _H, _A, 2 \ // ROR_2(A)
+ vprord TMP2, _A, 13 \ // ROR_13(A)
+ vprord TMP3, _A, 22 \ // ROR_22(A)
+ vmovdqu32 TMP0, _A \
+ vpternlogd TMP0, _B, _C, 0xE8 \ // TMP0 = MAJ(A,B,C)
+ vpternlogd _H, TMP2, TMP3, 0x96 \ // H(T2) = SIGMA0(A)
+ vpaddd _H, _H, TMP0 \ // H(T2) = SIGMA0(A) + MAJ(A,B,C)
+ vpaddd _H, _H, T1 \ // H(A) = H(T2) + T1
+ \
+ vmovdqu32 TMP3, [TBL + ((_ROUND+1)*64)] \ // Next Kt
+
+
+#define MSG_SCHED_ROUND_16_63(_WT, _WTp1, _WTp9, _WTp14) \
+ vprord TMP4, _WTp14, 17 \ // ROR_17(Wt-2)
+ vprord TMP5, _WTp14, 19 \ // ROR_19(Wt-2)
+ vpsrld TMP6, _WTp14, 10 \ // SHR_10(Wt-2)
+ vpternlogd TMP4, TMP5, TMP6, 0x96 \ // TMP4 = sigma1(Wt-2)
+ \
+ vpaddd _WT, _WT, TMP4 \ // Wt = Wt-16 + sigma1(Wt-2)
+ vpaddd _WT, _WT, _WTp9 \ // Wt = Wt-16 + sigma1(Wt-2) + Wt-7
+ \
+ vprord TMP4, _WTp1, 7 \ // ROR_7(Wt-15)
+ vprord TMP5, _WTp1, 18 \ // ROR_18(Wt-15)
+ vpsrld TMP6, _WTp1, 3 \ // SHR_3(Wt-15)
+ vpternlogd TMP4, TMP5, TMP6, 0x96 \ // TMP4 = sigma0(Wt-15)
+ \
+ vpaddd _WT, _WT, TMP4 \ // Wt = Wt-16 + sigma1(Wt-2) +
+ \ // Wt-7 + sigma0(Wt-15) +
+
+
+// Note this is reading in a block of data for one lane
+// When all 16 are read, the data must be transposed to build msg schedule
+#define MSG_SCHED_ROUND_00_15(_WT, OFFSET, LABEL) \
+ TESTQ $(1<(SB), TBL_P9
+ vmovdqu32 TMP2, [TBL]
+
+ // Get first K from table
+ MOVQ table+16(FP), TBL_P9
+ vmovdqu32 TMP3, [TBL]
+
+ // Save digests for later addition
+ vmovdqu32 [SCRATCH + 64*0], A
+ vmovdqu32 [SCRATCH + 64*1], B
+ vmovdqu32 [SCRATCH + 64*2], C
+ vmovdqu32 [SCRATCH + 64*3], D
+ vmovdqu32 [SCRATCH + 64*4], E
+ vmovdqu32 [SCRATCH + 64*5], F
+ vmovdqu32 [SCRATCH + 64*6], G
+ vmovdqu32 [SCRATCH + 64*7], H
+
+ add IDX, 64
+
+ // Transpose input data
+ TRANSPOSE16(W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, W10, W11, W12, W13, W14, W15, TMP0, TMP1)
+
+ vpshufb W0, W0, TMP2
+ vpshufb W1, W1, TMP2
+ vpshufb W2, W2, TMP2
+ vpshufb W3, W3, TMP2
+ vpshufb W4, W4, TMP2
+ vpshufb W5, W5, TMP2
+ vpshufb W6, W6, TMP2
+ vpshufb W7, W7, TMP2
+ vpshufb W8, W8, TMP2
+ vpshufb W9, W9, TMP2
+ vpshufb W10, W10, TMP2
+ vpshufb W11, W11, TMP2
+ vpshufb W12, W12, TMP2
+ vpshufb W13, W13, TMP2
+ vpshufb W14, W14, TMP2
+ vpshufb W15, W15, TMP2
+
+ // MSG Schedule for W0-W15 is now complete in registers
+ // Process first 48 rounds
+ // Calculate next Wt+16 after processing is complete and Wt is unneeded
+
+ PROCESS_LOOP( W0, 0, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W0, W1, W9, W14)
+ PROCESS_LOOP( W1, 1, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W1, W2, W10, W15)
+ PROCESS_LOOP( W2, 2, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63( W2, W3, W11, W0)
+ PROCESS_LOOP( W3, 3, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63( W3, W4, W12, W1)
+ PROCESS_LOOP( W4, 4, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63( W4, W5, W13, W2)
+ PROCESS_LOOP( W5, 5, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63( W5, W6, W14, W3)
+ PROCESS_LOOP( W6, 6, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63( W6, W7, W15, W4)
+ PROCESS_LOOP( W7, 7, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63( W7, W8, W0, W5)
+ PROCESS_LOOP( W8, 8, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W8, W9, W1, W6)
+ PROCESS_LOOP( W9, 9, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W9, W10, W2, W7)
+ PROCESS_LOOP(W10, 10, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63(W10, W11, W3, W8)
+ PROCESS_LOOP(W11, 11, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63(W11, W12, W4, W9)
+ PROCESS_LOOP(W12, 12, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63(W12, W13, W5, W10)
+ PROCESS_LOOP(W13, 13, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63(W13, W14, W6, W11)
+ PROCESS_LOOP(W14, 14, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63(W14, W15, W7, W12)
+ PROCESS_LOOP(W15, 15, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63(W15, W0, W8, W13)
+ PROCESS_LOOP( W0, 16, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W0, W1, W9, W14)
+ PROCESS_LOOP( W1, 17, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W1, W2, W10, W15)
+ PROCESS_LOOP( W2, 18, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63( W2, W3, W11, W0)
+ PROCESS_LOOP( W3, 19, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63( W3, W4, W12, W1)
+ PROCESS_LOOP( W4, 20, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63( W4, W5, W13, W2)
+ PROCESS_LOOP( W5, 21, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63( W5, W6, W14, W3)
+ PROCESS_LOOP( W6, 22, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63( W6, W7, W15, W4)
+ PROCESS_LOOP( W7, 23, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63( W7, W8, W0, W5)
+ PROCESS_LOOP( W8, 24, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W8, W9, W1, W6)
+ PROCESS_LOOP( W9, 25, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W9, W10, W2, W7)
+ PROCESS_LOOP(W10, 26, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63(W10, W11, W3, W8)
+ PROCESS_LOOP(W11, 27, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63(W11, W12, W4, W9)
+ PROCESS_LOOP(W12, 28, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63(W12, W13, W5, W10)
+ PROCESS_LOOP(W13, 29, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63(W13, W14, W6, W11)
+ PROCESS_LOOP(W14, 30, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63(W14, W15, W7, W12)
+ PROCESS_LOOP(W15, 31, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63(W15, W0, W8, W13)
+ PROCESS_LOOP( W0, 32, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W0, W1, W9, W14)
+ PROCESS_LOOP( W1, 33, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W1, W2, W10, W15)
+ PROCESS_LOOP( W2, 34, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63( W2, W3, W11, W0)
+ PROCESS_LOOP( W3, 35, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63( W3, W4, W12, W1)
+ PROCESS_LOOP( W4, 36, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63( W4, W5, W13, W2)
+ PROCESS_LOOP( W5, 37, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63( W5, W6, W14, W3)
+ PROCESS_LOOP( W6, 38, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63( W6, W7, W15, W4)
+ PROCESS_LOOP( W7, 39, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63( W7, W8, W0, W5)
+ PROCESS_LOOP( W8, 40, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_16_63( W8, W9, W1, W6)
+ PROCESS_LOOP( W9, 41, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_16_63( W9, W10, W2, W7)
+ PROCESS_LOOP(W10, 42, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_16_63(W10, W11, W3, W8)
+ PROCESS_LOOP(W11, 43, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_16_63(W11, W12, W4, W9)
+ PROCESS_LOOP(W12, 44, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_16_63(W12, W13, W5, W10)
+ PROCESS_LOOP(W13, 45, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_16_63(W13, W14, W6, W11)
+ PROCESS_LOOP(W14, 46, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_16_63(W14, W15, W7, W12)
+ PROCESS_LOOP(W15, 47, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_16_63(W15, W0, W8, W13)
+
+ // Check if this is the last block
+ sub INP_SIZE, 1
+ JE lastLoop
+
+ // Load next mask for inputs
+ ADDQ $8, MASKP_P9
+ MOVQ (MASKP_P9), MASK_P9
+
+ // Process last 16 rounds
+ // Read in next block msg data for use in first 16 words of msg sched
+
+ PROCESS_LOOP( W0, 48, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_00_15( W0, 0, skipNext0)
+ PROCESS_LOOP( W1, 49, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_00_15( W1, 1, skipNext1)
+ PROCESS_LOOP( W2, 50, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_00_15( W2, 2, skipNext2)
+ PROCESS_LOOP( W3, 51, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_00_15( W3, 3, skipNext3)
+ PROCESS_LOOP( W4, 52, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_00_15( W4, 4, skipNext4)
+ PROCESS_LOOP( W5, 53, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_00_15( W5, 5, skipNext5)
+ PROCESS_LOOP( W6, 54, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_00_15( W6, 6, skipNext6)
+ PROCESS_LOOP( W7, 55, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_00_15( W7, 7, skipNext7)
+ PROCESS_LOOP( W8, 56, A, B, C, D, E, F, G, H)
+ MSG_SCHED_ROUND_00_15( W8, 8, skipNext8)
+ PROCESS_LOOP( W9, 57, H, A, B, C, D, E, F, G)
+ MSG_SCHED_ROUND_00_15( W9, 9, skipNext9)
+ PROCESS_LOOP(W10, 58, G, H, A, B, C, D, E, F)
+ MSG_SCHED_ROUND_00_15(W10, 10, skipNext10)
+ PROCESS_LOOP(W11, 59, F, G, H, A, B, C, D, E)
+ MSG_SCHED_ROUND_00_15(W11, 11, skipNext11)
+ PROCESS_LOOP(W12, 60, E, F, G, H, A, B, C, D)
+ MSG_SCHED_ROUND_00_15(W12, 12, skipNext12)
+ PROCESS_LOOP(W13, 61, D, E, F, G, H, A, B, C)
+ MSG_SCHED_ROUND_00_15(W13, 13, skipNext13)
+ PROCESS_LOOP(W14, 62, C, D, E, F, G, H, A, B)
+ MSG_SCHED_ROUND_00_15(W14, 14, skipNext14)
+ PROCESS_LOOP(W15, 63, B, C, D, E, F, G, H, A)
+ MSG_SCHED_ROUND_00_15(W15, 15, skipNext15)
+
+ // Add old digest
+ vmovdqu32 TMP2, A
+ vmovdqu32 A, [SCRATCH + 64*0]
+ vpaddd A{k1}, A, TMP2
+ vmovdqu32 TMP2, B
+ vmovdqu32 B, [SCRATCH + 64*1]
+ vpaddd B{k1}, B, TMP2
+ vmovdqu32 TMP2, C
+ vmovdqu32 C, [SCRATCH + 64*2]
+ vpaddd C{k1}, C, TMP2
+ vmovdqu32 TMP2, D
+ vmovdqu32 D, [SCRATCH + 64*3]
+ vpaddd D{k1}, D, TMP2
+ vmovdqu32 TMP2, E
+ vmovdqu32 E, [SCRATCH + 64*4]
+ vpaddd E{k1}, E, TMP2
+ vmovdqu32 TMP2, F
+ vmovdqu32 F, [SCRATCH + 64*5]
+ vpaddd F{k1}, F, TMP2
+ vmovdqu32 TMP2, G
+ vmovdqu32 G, [SCRATCH + 64*6]
+ vpaddd G{k1}, G, TMP2
+ vmovdqu32 TMP2, H
+ vmovdqu32 H, [SCRATCH + 64*7]
+ vpaddd H{k1}, H, TMP2
+
+ kmovq k1, mask
+ JMP lloop
+
+lastLoop:
+ // Process last 16 rounds
+ PROCESS_LOOP( W0, 48, A, B, C, D, E, F, G, H)
+ PROCESS_LOOP( W1, 49, H, A, B, C, D, E, F, G)
+ PROCESS_LOOP( W2, 50, G, H, A, B, C, D, E, F)
+ PROCESS_LOOP( W3, 51, F, G, H, A, B, C, D, E)
+ PROCESS_LOOP( W4, 52, E, F, G, H, A, B, C, D)
+ PROCESS_LOOP( W5, 53, D, E, F, G, H, A, B, C)
+ PROCESS_LOOP( W6, 54, C, D, E, F, G, H, A, B)
+ PROCESS_LOOP( W7, 55, B, C, D, E, F, G, H, A)
+ PROCESS_LOOP( W8, 56, A, B, C, D, E, F, G, H)
+ PROCESS_LOOP( W9, 57, H, A, B, C, D, E, F, G)
+ PROCESS_LOOP(W10, 58, G, H, A, B, C, D, E, F)
+ PROCESS_LOOP(W11, 59, F, G, H, A, B, C, D, E)
+ PROCESS_LOOP(W12, 60, E, F, G, H, A, B, C, D)
+ PROCESS_LOOP(W13, 61, D, E, F, G, H, A, B, C)
+ PROCESS_LOOP(W14, 62, C, D, E, F, G, H, A, B)
+ PROCESS_LOOP(W15, 63, B, C, D, E, F, G, H, A)
+
+ // Add old digest
+ vmovdqu32 TMP2, A
+ vmovdqu32 A, [SCRATCH + 64*0]
+ vpaddd A{k1}, A, TMP2
+ vmovdqu32 TMP2, B
+ vmovdqu32 B, [SCRATCH + 64*1]
+ vpaddd B{k1}, B, TMP2
+ vmovdqu32 TMP2, C
+ vmovdqu32 C, [SCRATCH + 64*2]
+ vpaddd C{k1}, C, TMP2
+ vmovdqu32 TMP2, D
+ vmovdqu32 D, [SCRATCH + 64*3]
+ vpaddd D{k1}, D, TMP2
+ vmovdqu32 TMP2, E
+ vmovdqu32 E, [SCRATCH + 64*4]
+ vpaddd E{k1}, E, TMP2
+ vmovdqu32 TMP2, F
+ vmovdqu32 F, [SCRATCH + 64*5]
+ vpaddd F{k1}, F, TMP2
+ vmovdqu32 TMP2, G
+ vmovdqu32 G, [SCRATCH + 64*6]
+ vpaddd G{k1}, G, TMP2
+ vmovdqu32 TMP2, H
+ vmovdqu32 H, [SCRATCH + 64*7]
+ vpaddd H{k1}, H, TMP2
+
+ // Write out digest
+ vmovdqu32 [STATE + 0*SHA256_DIGEST_ROW_SIZE], A
+ vmovdqu32 [STATE + 1*SHA256_DIGEST_ROW_SIZE], B
+ vmovdqu32 [STATE + 2*SHA256_DIGEST_ROW_SIZE], C
+ vmovdqu32 [STATE + 3*SHA256_DIGEST_ROW_SIZE], D
+ vmovdqu32 [STATE + 4*SHA256_DIGEST_ROW_SIZE], E
+ vmovdqu32 [STATE + 5*SHA256_DIGEST_ROW_SIZE], F
+ vmovdqu32 [STATE + 6*SHA256_DIGEST_ROW_SIZE], G
+ vmovdqu32 [STATE + 7*SHA256_DIGEST_ROW_SIZE], H
+
+ VZEROUPPER
+ RET
+
+//
+// Tables
+//
+
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x000(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x008(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x010(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x018(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x020(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x028(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x030(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x038(SB)/8, $0x0c0d0e0f08090a0b
+GLOBL PSHUFFLE_BYTE_FLIP_MASK<>(SB), 8, $64
+
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x000(SB)/8, $0x0000000000000000
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x008(SB)/8, $0x0000000000000001
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x010(SB)/8, $0x0000000000000008
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x018(SB)/8, $0x0000000000000009
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x020(SB)/8, $0x0000000000000004
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x028(SB)/8, $0x0000000000000005
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x030(SB)/8, $0x000000000000000C
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x038(SB)/8, $0x000000000000000D
+GLOBL PSHUFFLE_TRANSPOSE16_MASK1<>(SB), 8, $64
+
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x000(SB)/8, $0x0000000000000002
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x008(SB)/8, $0x0000000000000003
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x010(SB)/8, $0x000000000000000A
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x018(SB)/8, $0x000000000000000B
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x020(SB)/8, $0x0000000000000006
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x028(SB)/8, $0x0000000000000007
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x030(SB)/8, $0x000000000000000E
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x038(SB)/8, $0x000000000000000F
+GLOBL PSHUFFLE_TRANSPOSE16_MASK2<>(SB), 8, $64
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go
new file mode 100644
index 0000000000..db8e48d311
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.go
@@ -0,0 +1,500 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2017 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+import (
+ "encoding/binary"
+ "errors"
+ "hash"
+ "sort"
+ "sync/atomic"
+ "time"
+)
+
+//go:noescape
+func sha256X16Avx512(digests *[512]byte, scratch *[512]byte, table *[512]uint64, mask []uint64, inputs [16][]byte)
+
+// Avx512ServerUID - Do not start at 0 but next multiple of 16 so as to be able to
+// differentiate with default initialiation value of 0
+const Avx512ServerUID = 16
+
+var uidCounter uint64
+
+// NewAvx512 - initialize sha256 Avx512 implementation.
+func NewAvx512(a512srv *Avx512Server) hash.Hash {
+ uid := atomic.AddUint64(&uidCounter, 1)
+ return &Avx512Digest{uid: uid, a512srv: a512srv}
+}
+
+// Avx512Digest - Type for computing SHA256 using Avx512
+type Avx512Digest struct {
+ uid uint64
+ a512srv *Avx512Server
+ x [chunk]byte
+ nx int
+ len uint64
+ final bool
+ result [Size]byte
+}
+
+// Size - Return size of checksum
+func (d *Avx512Digest) Size() int { return Size }
+
+// BlockSize - Return blocksize of checksum
+func (d Avx512Digest) BlockSize() int { return BlockSize }
+
+// Reset - reset sha digest to its initial values
+func (d *Avx512Digest) Reset() {
+ d.a512srv.blocksCh <- blockInput{uid: d.uid, reset: true}
+ d.nx = 0
+ d.len = 0
+ d.final = false
+}
+
+// Write to digest
+func (d *Avx512Digest) Write(p []byte) (nn int, err error) {
+
+ if d.final {
+ return 0, errors.New("Avx512Digest already finalized. Reset first before writing again")
+ }
+
+ nn = len(p)
+ d.len += uint64(nn)
+ if d.nx > 0 {
+ n := copy(d.x[d.nx:], p)
+ d.nx += n
+ if d.nx == chunk {
+ d.a512srv.blocksCh <- blockInput{uid: d.uid, msg: d.x[:]}
+ d.nx = 0
+ }
+ p = p[n:]
+ }
+ if len(p) >= chunk {
+ n := len(p) &^ (chunk - 1)
+ d.a512srv.blocksCh <- blockInput{uid: d.uid, msg: p[:n]}
+ p = p[n:]
+ }
+ if len(p) > 0 {
+ d.nx = copy(d.x[:], p)
+ }
+ return
+}
+
+// Sum - Return sha256 sum in bytes
+func (d *Avx512Digest) Sum(in []byte) (result []byte) {
+
+ if d.final {
+ return append(in, d.result[:]...)
+ }
+
+ trail := make([]byte, 0, 128)
+ trail = append(trail, d.x[:d.nx]...)
+
+ len := d.len
+ // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64.
+ var tmp [64]byte
+ tmp[0] = 0x80
+ if len%64 < 56 {
+ trail = append(trail, tmp[0:56-len%64]...)
+ } else {
+ trail = append(trail, tmp[0:64+56-len%64]...)
+ }
+ d.nx = 0
+
+ // Length in bits.
+ len <<= 3
+ for i := uint(0); i < 8; i++ {
+ tmp[i] = byte(len >> (56 - 8*i))
+ }
+ trail = append(trail, tmp[0:8]...)
+
+ sumCh := make(chan [Size]byte)
+ d.a512srv.blocksCh <- blockInput{uid: d.uid, msg: trail, final: true, sumCh: sumCh}
+ d.result = <-sumCh
+ d.final = true
+ return append(in, d.result[:]...)
+}
+
+var table = [512]uint64{
+ 0x428a2f98428a2f98, 0x428a2f98428a2f98, 0x428a2f98428a2f98, 0x428a2f98428a2f98,
+ 0x428a2f98428a2f98, 0x428a2f98428a2f98, 0x428a2f98428a2f98, 0x428a2f98428a2f98,
+ 0x7137449171374491, 0x7137449171374491, 0x7137449171374491, 0x7137449171374491,
+ 0x7137449171374491, 0x7137449171374491, 0x7137449171374491, 0x7137449171374491,
+ 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf,
+ 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf,
+ 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5,
+ 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5,
+ 0x3956c25b3956c25b, 0x3956c25b3956c25b, 0x3956c25b3956c25b, 0x3956c25b3956c25b,
+ 0x3956c25b3956c25b, 0x3956c25b3956c25b, 0x3956c25b3956c25b, 0x3956c25b3956c25b,
+ 0x59f111f159f111f1, 0x59f111f159f111f1, 0x59f111f159f111f1, 0x59f111f159f111f1,
+ 0x59f111f159f111f1, 0x59f111f159f111f1, 0x59f111f159f111f1, 0x59f111f159f111f1,
+ 0x923f82a4923f82a4, 0x923f82a4923f82a4, 0x923f82a4923f82a4, 0x923f82a4923f82a4,
+ 0x923f82a4923f82a4, 0x923f82a4923f82a4, 0x923f82a4923f82a4, 0x923f82a4923f82a4,
+ 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5,
+ 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5,
+ 0xd807aa98d807aa98, 0xd807aa98d807aa98, 0xd807aa98d807aa98, 0xd807aa98d807aa98,
+ 0xd807aa98d807aa98, 0xd807aa98d807aa98, 0xd807aa98d807aa98, 0xd807aa98d807aa98,
+ 0x12835b0112835b01, 0x12835b0112835b01, 0x12835b0112835b01, 0x12835b0112835b01,
+ 0x12835b0112835b01, 0x12835b0112835b01, 0x12835b0112835b01, 0x12835b0112835b01,
+ 0x243185be243185be, 0x243185be243185be, 0x243185be243185be, 0x243185be243185be,
+ 0x243185be243185be, 0x243185be243185be, 0x243185be243185be, 0x243185be243185be,
+ 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3,
+ 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3,
+ 0x72be5d7472be5d74, 0x72be5d7472be5d74, 0x72be5d7472be5d74, 0x72be5d7472be5d74,
+ 0x72be5d7472be5d74, 0x72be5d7472be5d74, 0x72be5d7472be5d74, 0x72be5d7472be5d74,
+ 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe,
+ 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe,
+ 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7,
+ 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7,
+ 0xc19bf174c19bf174, 0xc19bf174c19bf174, 0xc19bf174c19bf174, 0xc19bf174c19bf174,
+ 0xc19bf174c19bf174, 0xc19bf174c19bf174, 0xc19bf174c19bf174, 0xc19bf174c19bf174,
+ 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1,
+ 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1,
+ 0xefbe4786efbe4786, 0xefbe4786efbe4786, 0xefbe4786efbe4786, 0xefbe4786efbe4786,
+ 0xefbe4786efbe4786, 0xefbe4786efbe4786, 0xefbe4786efbe4786, 0xefbe4786efbe4786,
+ 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6,
+ 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6,
+ 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc,
+ 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc,
+ 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f,
+ 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f,
+ 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa,
+ 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa,
+ 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc,
+ 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc,
+ 0x76f988da76f988da, 0x76f988da76f988da, 0x76f988da76f988da, 0x76f988da76f988da,
+ 0x76f988da76f988da, 0x76f988da76f988da, 0x76f988da76f988da, 0x76f988da76f988da,
+ 0x983e5152983e5152, 0x983e5152983e5152, 0x983e5152983e5152, 0x983e5152983e5152,
+ 0x983e5152983e5152, 0x983e5152983e5152, 0x983e5152983e5152, 0x983e5152983e5152,
+ 0xa831c66da831c66d, 0xa831c66da831c66d, 0xa831c66da831c66d, 0xa831c66da831c66d,
+ 0xa831c66da831c66d, 0xa831c66da831c66d, 0xa831c66da831c66d, 0xa831c66da831c66d,
+ 0xb00327c8b00327c8, 0xb00327c8b00327c8, 0xb00327c8b00327c8, 0xb00327c8b00327c8,
+ 0xb00327c8b00327c8, 0xb00327c8b00327c8, 0xb00327c8b00327c8, 0xb00327c8b00327c8,
+ 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7,
+ 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7,
+ 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3,
+ 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3,
+ 0xd5a79147d5a79147, 0xd5a79147d5a79147, 0xd5a79147d5a79147, 0xd5a79147d5a79147,
+ 0xd5a79147d5a79147, 0xd5a79147d5a79147, 0xd5a79147d5a79147, 0xd5a79147d5a79147,
+ 0x06ca635106ca6351, 0x06ca635106ca6351, 0x06ca635106ca6351, 0x06ca635106ca6351,
+ 0x06ca635106ca6351, 0x06ca635106ca6351, 0x06ca635106ca6351, 0x06ca635106ca6351,
+ 0x1429296714292967, 0x1429296714292967, 0x1429296714292967, 0x1429296714292967,
+ 0x1429296714292967, 0x1429296714292967, 0x1429296714292967, 0x1429296714292967,
+ 0x27b70a8527b70a85, 0x27b70a8527b70a85, 0x27b70a8527b70a85, 0x27b70a8527b70a85,
+ 0x27b70a8527b70a85, 0x27b70a8527b70a85, 0x27b70a8527b70a85, 0x27b70a8527b70a85,
+ 0x2e1b21382e1b2138, 0x2e1b21382e1b2138, 0x2e1b21382e1b2138, 0x2e1b21382e1b2138,
+ 0x2e1b21382e1b2138, 0x2e1b21382e1b2138, 0x2e1b21382e1b2138, 0x2e1b21382e1b2138,
+ 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc,
+ 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc,
+ 0x53380d1353380d13, 0x53380d1353380d13, 0x53380d1353380d13, 0x53380d1353380d13,
+ 0x53380d1353380d13, 0x53380d1353380d13, 0x53380d1353380d13, 0x53380d1353380d13,
+ 0x650a7354650a7354, 0x650a7354650a7354, 0x650a7354650a7354, 0x650a7354650a7354,
+ 0x650a7354650a7354, 0x650a7354650a7354, 0x650a7354650a7354, 0x650a7354650a7354,
+ 0x766a0abb766a0abb, 0x766a0abb766a0abb, 0x766a0abb766a0abb, 0x766a0abb766a0abb,
+ 0x766a0abb766a0abb, 0x766a0abb766a0abb, 0x766a0abb766a0abb, 0x766a0abb766a0abb,
+ 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e,
+ 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e,
+ 0x92722c8592722c85, 0x92722c8592722c85, 0x92722c8592722c85, 0x92722c8592722c85,
+ 0x92722c8592722c85, 0x92722c8592722c85, 0x92722c8592722c85, 0x92722c8592722c85,
+ 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1,
+ 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1,
+ 0xa81a664ba81a664b, 0xa81a664ba81a664b, 0xa81a664ba81a664b, 0xa81a664ba81a664b,
+ 0xa81a664ba81a664b, 0xa81a664ba81a664b, 0xa81a664ba81a664b, 0xa81a664ba81a664b,
+ 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70,
+ 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70,
+ 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3,
+ 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3,
+ 0xd192e819d192e819, 0xd192e819d192e819, 0xd192e819d192e819, 0xd192e819d192e819,
+ 0xd192e819d192e819, 0xd192e819d192e819, 0xd192e819d192e819, 0xd192e819d192e819,
+ 0xd6990624d6990624, 0xd6990624d6990624, 0xd6990624d6990624, 0xd6990624d6990624,
+ 0xd6990624d6990624, 0xd6990624d6990624, 0xd6990624d6990624, 0xd6990624d6990624,
+ 0xf40e3585f40e3585, 0xf40e3585f40e3585, 0xf40e3585f40e3585, 0xf40e3585f40e3585,
+ 0xf40e3585f40e3585, 0xf40e3585f40e3585, 0xf40e3585f40e3585, 0xf40e3585f40e3585,
+ 0x106aa070106aa070, 0x106aa070106aa070, 0x106aa070106aa070, 0x106aa070106aa070,
+ 0x106aa070106aa070, 0x106aa070106aa070, 0x106aa070106aa070, 0x106aa070106aa070,
+ 0x19a4c11619a4c116, 0x19a4c11619a4c116, 0x19a4c11619a4c116, 0x19a4c11619a4c116,
+ 0x19a4c11619a4c116, 0x19a4c11619a4c116, 0x19a4c11619a4c116, 0x19a4c11619a4c116,
+ 0x1e376c081e376c08, 0x1e376c081e376c08, 0x1e376c081e376c08, 0x1e376c081e376c08,
+ 0x1e376c081e376c08, 0x1e376c081e376c08, 0x1e376c081e376c08, 0x1e376c081e376c08,
+ 0x2748774c2748774c, 0x2748774c2748774c, 0x2748774c2748774c, 0x2748774c2748774c,
+ 0x2748774c2748774c, 0x2748774c2748774c, 0x2748774c2748774c, 0x2748774c2748774c,
+ 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5,
+ 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5,
+ 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3,
+ 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3,
+ 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a,
+ 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a,
+ 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f,
+ 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f,
+ 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3,
+ 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3,
+ 0x748f82ee748f82ee, 0x748f82ee748f82ee, 0x748f82ee748f82ee, 0x748f82ee748f82ee,
+ 0x748f82ee748f82ee, 0x748f82ee748f82ee, 0x748f82ee748f82ee, 0x748f82ee748f82ee,
+ 0x78a5636f78a5636f, 0x78a5636f78a5636f, 0x78a5636f78a5636f, 0x78a5636f78a5636f,
+ 0x78a5636f78a5636f, 0x78a5636f78a5636f, 0x78a5636f78a5636f, 0x78a5636f78a5636f,
+ 0x84c8781484c87814, 0x84c8781484c87814, 0x84c8781484c87814, 0x84c8781484c87814,
+ 0x84c8781484c87814, 0x84c8781484c87814, 0x84c8781484c87814, 0x84c8781484c87814,
+ 0x8cc702088cc70208, 0x8cc702088cc70208, 0x8cc702088cc70208, 0x8cc702088cc70208,
+ 0x8cc702088cc70208, 0x8cc702088cc70208, 0x8cc702088cc70208, 0x8cc702088cc70208,
+ 0x90befffa90befffa, 0x90befffa90befffa, 0x90befffa90befffa, 0x90befffa90befffa,
+ 0x90befffa90befffa, 0x90befffa90befffa, 0x90befffa90befffa, 0x90befffa90befffa,
+ 0xa4506ceba4506ceb, 0xa4506ceba4506ceb, 0xa4506ceba4506ceb, 0xa4506ceba4506ceb,
+ 0xa4506ceba4506ceb, 0xa4506ceba4506ceb, 0xa4506ceba4506ceb, 0xa4506ceba4506ceb,
+ 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7,
+ 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7,
+ 0xc67178f2c67178f2, 0xc67178f2c67178f2, 0xc67178f2c67178f2, 0xc67178f2c67178f2,
+ 0xc67178f2c67178f2, 0xc67178f2c67178f2, 0xc67178f2c67178f2, 0xc67178f2c67178f2}
+
+// Interface function to assembly ode
+func blockAvx512(digests *[512]byte, input [16][]byte, mask []uint64) [16][Size]byte {
+
+ scratch := [512]byte{}
+ sha256X16Avx512(digests, &scratch, &table, mask, input)
+
+ output := [16][Size]byte{}
+ for i := 0; i < 16; i++ {
+ output[i] = getDigest(i, digests[:])
+ }
+
+ return output
+}
+
+func getDigest(index int, state []byte) (sum [Size]byte) {
+ for j := 0; j < 16; j += 2 {
+ for i := index*4 + j*Size; i < index*4+(j+1)*Size; i += Size {
+ binary.BigEndian.PutUint32(sum[j*2:], binary.LittleEndian.Uint32(state[i:i+4]))
+ }
+ }
+ return
+}
+
+// Message to send across input channel
+type blockInput struct {
+ uid uint64
+ msg []byte
+ reset bool
+ final bool
+ sumCh chan [Size]byte
+}
+
+// Avx512Server - Type to implement 16x parallel handling of SHA256 invocations
+type Avx512Server struct {
+ blocksCh chan blockInput // Input channel
+ totalIn int // Total number of inputs waiting to be processed
+ lanes [16]Avx512LaneInfo // Array with info per lane (out of 16)
+ digests map[uint64][Size]byte // Map of uids to (interim) digest results
+}
+
+// Avx512LaneInfo - Info for each lane
+type Avx512LaneInfo struct {
+ uid uint64 // unique identification for this SHA processing
+ block []byte // input block to be processed
+ outputCh chan [Size]byte // channel for output result
+}
+
+// NewAvx512Server - Create new object for parallel processing handling
+func NewAvx512Server() *Avx512Server {
+ a512srv := &Avx512Server{}
+ a512srv.digests = make(map[uint64][Size]byte)
+ a512srv.blocksCh = make(chan blockInput)
+
+ // Start a single thread for reading from the input channel
+ go a512srv.Process()
+ return a512srv
+}
+
+// Process - Sole handler for reading from the input channel
+func (a512srv *Avx512Server) Process() {
+ for {
+ select {
+ case block := <-a512srv.blocksCh:
+ if block.reset {
+ a512srv.reset(block.uid)
+ continue
+ }
+ index := block.uid & 0xf
+ // fmt.Println("Adding message:", block.uid, index)
+
+ if a512srv.lanes[index].block != nil { // If slot is already filled, process all inputs
+ //fmt.Println("Invoking Blocks()")
+ a512srv.blocks()
+ }
+ a512srv.totalIn++
+ a512srv.lanes[index] = Avx512LaneInfo{uid: block.uid, block: block.msg}
+ if block.final {
+ a512srv.lanes[index].outputCh = block.sumCh
+ }
+ if a512srv.totalIn == len(a512srv.lanes) {
+ // fmt.Println("Invoking Blocks() while FULL: ")
+ a512srv.blocks()
+ }
+
+ // TODO: test with larger timeout
+ case <-time.After(1 * time.Microsecond):
+ for _, lane := range a512srv.lanes {
+ if lane.block != nil { // check if there is any input to process
+ // fmt.Println("Invoking Blocks() on TIMEOUT: ")
+ a512srv.blocks()
+ break // we are done
+ }
+ }
+ }
+ }
+}
+
+// Do a reset for this calculation
+func (a512srv *Avx512Server) reset(uid uint64) {
+
+ // Check if there is a message still waiting to be processed (and remove if so)
+ for i, lane := range a512srv.lanes {
+ if lane.uid == uid {
+ if lane.block != nil {
+ a512srv.lanes[i] = Avx512LaneInfo{} // clear message
+ a512srv.totalIn--
+ }
+ }
+ }
+
+ // Delete entry from hash map
+ delete(a512srv.digests, uid)
+}
+
+// Invoke assembly and send results back
+func (a512srv *Avx512Server) blocks() {
+
+ inputs := [16][]byte{}
+ for i := range inputs {
+ inputs[i] = a512srv.lanes[i].block
+ }
+
+ mask := expandMask(genMask(inputs))
+ outputs := blockAvx512(a512srv.getDigests(), inputs, mask)
+
+ a512srv.totalIn = 0
+ for i := 0; i < len(outputs); i++ {
+ uid, outputCh := a512srv.lanes[i].uid, a512srv.lanes[i].outputCh
+ a512srv.digests[uid] = outputs[i]
+ a512srv.lanes[i] = Avx512LaneInfo{}
+
+ if outputCh != nil {
+ // Send back result
+ outputCh <- outputs[i]
+ delete(a512srv.digests, uid) // Delete entry from hashmap
+ }
+ }
+}
+
+func (a512srv *Avx512Server) Write(uid uint64, p []byte) (nn int, err error) {
+ a512srv.blocksCh <- blockInput{uid: uid, msg: p}
+ return len(p), nil
+}
+
+// Sum - return sha256 sum in bytes for a given sum id.
+func (a512srv *Avx512Server) Sum(uid uint64, p []byte) [32]byte {
+ sumCh := make(chan [32]byte)
+ a512srv.blocksCh <- blockInput{uid: uid, msg: p, final: true, sumCh: sumCh}
+ return <-sumCh
+}
+
+func (a512srv *Avx512Server) getDigests() *[512]byte {
+ digests := [512]byte{}
+ for i, lane := range a512srv.lanes {
+ a, ok := a512srv.digests[lane.uid]
+ if ok {
+ binary.BigEndian.PutUint32(digests[(i+0*16)*4:], binary.LittleEndian.Uint32(a[0:4]))
+ binary.BigEndian.PutUint32(digests[(i+1*16)*4:], binary.LittleEndian.Uint32(a[4:8]))
+ binary.BigEndian.PutUint32(digests[(i+2*16)*4:], binary.LittleEndian.Uint32(a[8:12]))
+ binary.BigEndian.PutUint32(digests[(i+3*16)*4:], binary.LittleEndian.Uint32(a[12:16]))
+ binary.BigEndian.PutUint32(digests[(i+4*16)*4:], binary.LittleEndian.Uint32(a[16:20]))
+ binary.BigEndian.PutUint32(digests[(i+5*16)*4:], binary.LittleEndian.Uint32(a[20:24]))
+ binary.BigEndian.PutUint32(digests[(i+6*16)*4:], binary.LittleEndian.Uint32(a[24:28]))
+ binary.BigEndian.PutUint32(digests[(i+7*16)*4:], binary.LittleEndian.Uint32(a[28:32]))
+ } else {
+ binary.LittleEndian.PutUint32(digests[(i+0*16)*4:], init0)
+ binary.LittleEndian.PutUint32(digests[(i+1*16)*4:], init1)
+ binary.LittleEndian.PutUint32(digests[(i+2*16)*4:], init2)
+ binary.LittleEndian.PutUint32(digests[(i+3*16)*4:], init3)
+ binary.LittleEndian.PutUint32(digests[(i+4*16)*4:], init4)
+ binary.LittleEndian.PutUint32(digests[(i+5*16)*4:], init5)
+ binary.LittleEndian.PutUint32(digests[(i+6*16)*4:], init6)
+ binary.LittleEndian.PutUint32(digests[(i+7*16)*4:], init7)
+ }
+ }
+ return &digests
+}
+
+// Helper struct for sorting blocks based on length
+type lane struct {
+ len uint
+ pos uint
+}
+
+type lanes []lane
+
+func (lns lanes) Len() int { return len(lns) }
+func (lns lanes) Swap(i, j int) { lns[i], lns[j] = lns[j], lns[i] }
+func (lns lanes) Less(i, j int) bool { return lns[i].len < lns[j].len }
+
+// Helper struct for
+type maskRounds struct {
+ mask uint64
+ rounds uint64
+}
+
+func genMask(input [16][]byte) [16]maskRounds {
+
+ // Sort on blocks length small to large
+ var sorted [16]lane
+ for c, inpt := range input {
+ sorted[c] = lane{uint(len(inpt)), uint(c)}
+ }
+ sort.Sort(lanes(sorted[:]))
+
+ // Create mask array including 'rounds' between masks
+ m, round, index := uint64(0xffff), uint64(0), 0
+ var mr [16]maskRounds
+ for _, s := range sorted {
+ if s.len > 0 {
+ if uint64(s.len)>>6 > round {
+ mr[index] = maskRounds{m, (uint64(s.len) >> 6) - round}
+ index++
+ }
+ round = uint64(s.len) >> 6
+ }
+ m = m & ^(1 << uint(s.pos))
+ }
+
+ return mr
+}
+
+// TODO: remove function
+func expandMask(mr [16]maskRounds) []uint64 {
+ size := uint64(0)
+ for _, r := range mr {
+ size += r.rounds
+ }
+ result, index := make([]uint64, size), 0
+ for _, r := range mr {
+ for j := uint64(0); j < r.rounds; j++ {
+ result[index] = r.mask
+ index++
+ }
+ }
+ return result
+}
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s
new file mode 100644
index 0000000000..275bcacbc1
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx512_amd64.s
@@ -0,0 +1,267 @@
+//+build !noasm,!appengine
+
+TEXT ·sha256X16Avx512(SB), 7, $0
+ MOVQ digests+0(FP), DI
+ MOVQ scratch+8(FP), R12
+ MOVQ mask_len+32(FP), SI
+ MOVQ mask_base+24(FP), R13
+ MOVQ (R13), R14
+ LONG $0x92fbc1c4; BYTE $0xce
+ LEAQ inputs+48(FP), AX
+ QUAD $0xf162076f487ef162; QUAD $0x7ef162014f6f487e; QUAD $0x487ef16202576f48; QUAD $0x6f487ef162035f6f; QUAD $0x6f6f487ef1620467; QUAD $0x06776f487ef16205; LONG $0x487ef162; WORD $0x7f6f; BYTE $0x07
+ MOVQ table+16(FP), DX
+ WORD $0x3148; BYTE $0xc9
+ TESTQ $(1<<0), R14
+ JE skipInput0
+ MOVQ 0*24(AX), R9
+ LONG $0x487cc162; WORD $0x0410; BYTE $0x09
+
+skipInput0:
+ TESTQ $(1<<1), R14
+ JE skipInput1
+ MOVQ 1*24(AX), R9
+ LONG $0x487cc162; WORD $0x0c10; BYTE $0x09
+
+skipInput1:
+ TESTQ $(1<<2), R14
+ JE skipInput2
+ MOVQ 2*24(AX), R9
+ LONG $0x487cc162; WORD $0x1410; BYTE $0x09
+
+skipInput2:
+ TESTQ $(1<<3), R14
+ JE skipInput3
+ MOVQ 3*24(AX), R9
+ LONG $0x487cc162; WORD $0x1c10; BYTE $0x09
+
+skipInput3:
+ TESTQ $(1<<4), R14
+ JE skipInput4
+ MOVQ 4*24(AX), R9
+ LONG $0x487cc162; WORD $0x2410; BYTE $0x09
+
+skipInput4:
+ TESTQ $(1<<5), R14
+ JE skipInput5
+ MOVQ 5*24(AX), R9
+ LONG $0x487cc162; WORD $0x2c10; BYTE $0x09
+
+skipInput5:
+ TESTQ $(1<<6), R14
+ JE skipInput6
+ MOVQ 6*24(AX), R9
+ LONG $0x487cc162; WORD $0x3410; BYTE $0x09
+
+skipInput6:
+ TESTQ $(1<<7), R14
+ JE skipInput7
+ MOVQ 7*24(AX), R9
+ LONG $0x487cc162; WORD $0x3c10; BYTE $0x09
+
+skipInput7:
+ TESTQ $(1<<8), R14
+ JE skipInput8
+ MOVQ 8*24(AX), R9
+ LONG $0x487c4162; WORD $0x0410; BYTE $0x09
+
+skipInput8:
+ TESTQ $(1<<9), R14
+ JE skipInput9
+ MOVQ 9*24(AX), R9
+ LONG $0x487c4162; WORD $0x0c10; BYTE $0x09
+
+skipInput9:
+ TESTQ $(1<<10), R14
+ JE skipInput10
+ MOVQ 10*24(AX), R9
+ LONG $0x487c4162; WORD $0x1410; BYTE $0x09
+
+skipInput10:
+ TESTQ $(1<<11), R14
+ JE skipInput11
+ MOVQ 11*24(AX), R9
+ LONG $0x487c4162; WORD $0x1c10; BYTE $0x09
+
+skipInput11:
+ TESTQ $(1<<12), R14
+ JE skipInput12
+ MOVQ 12*24(AX), R9
+ LONG $0x487c4162; WORD $0x2410; BYTE $0x09
+
+skipInput12:
+ TESTQ $(1<<13), R14
+ JE skipInput13
+ MOVQ 13*24(AX), R9
+ LONG $0x487c4162; WORD $0x2c10; BYTE $0x09
+
+skipInput13:
+ TESTQ $(1<<14), R14
+ JE skipInput14
+ MOVQ 14*24(AX), R9
+ LONG $0x487c4162; WORD $0x3410; BYTE $0x09
+
+skipInput14:
+ TESTQ $(1<<15), R14
+ JE skipInput15
+ MOVQ 15*24(AX), R9
+ LONG $0x487c4162; WORD $0x3c10; BYTE $0x09
+
+skipInput15:
+lloop:
+ LEAQ PSHUFFLE_BYTE_FLIP_MASK<>(SB), DX
+ LONG $0x487e7162; WORD $0x1a6f
+ MOVQ table+16(FP), DX
+ QUAD $0xd162226f487e7162; QUAD $0x7ed16224047f487e; QUAD $0x7ed16201244c7f48; QUAD $0x7ed1620224547f48; QUAD $0x7ed16203245c7f48; QUAD $0x7ed1620424647f48; QUAD $0x7ed16205246c7f48; QUAD $0x7ed1620624747f48; QUAD $0xc1834807247c7f48; QUAD $0x44c9c6407c316240; QUAD $0x62eec1c6407ca162; QUAD $0xa16244d3c6406c31; QUAD $0x34c162eed3c6406c; QUAD $0x407ca162dddac648; QUAD $0xc6407ca16288cac6; QUAD $0xcac648345162ddc2; QUAD $0x44d5c6405ca16288; QUAD $0x62eee5c6405ca162; QUAD $0xa16244d7c6404c31; QUAD $0x6cc162eef7c6404c; QUAD $0x405ca162ddfac640; QUAD $0xc6405ca16288eec6; QUAD $0xd2c6406cc162dde6; QUAD $0x44f1c6403c816288; QUAD $0x62eec1c6403c0162; QUAD $0x016244d3c6402c11; QUAD $0x4c4162eed3c6402c; QUAD $0x403c0162dddac640; QUAD $0xc6403c016288cac6; QUAD $0xf2c6404cc162ddc2; QUAD $0x44d5c6401c016288; QUAD $0x62eee5c6401c0162; QUAD $0x016244d7c6400c11; QUAD $0x2c4162eef7c6400c; QUAD $0x401c0162ddfac640; QUAD $0xc6401c016288eec6; QUAD $0xd2c6402c4162dde6; BYTE $0x88
+ LEAQ PSHUFFLE_TRANSPOSE16_MASK1<>(SB), BX
+ LEAQ PSHUFFLE_TRANSPOSE16_MASK2<>(SB), R8
+ QUAD $0x2262336f487e6162; QUAD $0x487e5162f27648b5; QUAD $0xd27648b53262106f; QUAD $0xa262136f487ee162; QUAD $0x487e5162d77640e5; QUAD $0xcf7640e53262086f; QUAD $0xa2621b6f487ee162; QUAD $0x487ec162dd7640f5; QUAD $0xfd7640f5a262386f; QUAD $0xa2620b6f487ee162; QUAD $0x487ec162cc7640fd; QUAD $0xec7640fda262286f; QUAD $0x8262036f487ee162; QUAD $0x487ec162c27640cd; QUAD $0xe27640cd8262206f; QUAD $0x8262336f487ee162; QUAD $0x487e4162f77640a5; QUAD $0xd77640a50262106f; QUAD $0x02621b6f487e6162; QUAD $0x487e4162dd7640b5; QUAD $0xfd7640b50262386f; QUAD $0x02620b6f487e6162; QUAD $0x487e4162cc7640bd; QUAD $0xec7640bd0262286f; QUAD $0x62eec023408d2362; QUAD $0x236244c023408da3; QUAD $0xada362eee42348ad; QUAD $0x40c5036244e42348; QUAD $0x2340c51362eef723; QUAD $0xfd2340d5036244d7; QUAD $0x44fd2340d58362ee; QUAD $0x62eeea2348b50362; QUAD $0x036244ea2348b583; QUAD $0xe51362eed32340e5; QUAD $0x40f5036244cb2340; QUAD $0x2340f58362eed923; QUAD $0xce2340ed236244d9; QUAD $0x44ce2340eda362ee; QUAD $0xc162d16f487ec162; QUAD $0x407dc262f26f487e; QUAD $0xcb004075c262c300; QUAD $0xc262d300406dc262; QUAD $0x405dc262db004065; QUAD $0xeb004055c262e300; QUAD $0xc262f300404dc262; QUAD $0x403d4262fb004045; QUAD $0xcb0040354262c300; QUAD $0x4262d300402d4262; QUAD $0x401d4262db004025; QUAD $0xeb0040154262e300; QUAD $0x4262f300400d4262; QUAD $0x48455162fb004005; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d3162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6201626f487e7162; QUAD $0x916211c672481591; QUAD $0x05916213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe407dc16296ef25; QUAD $0x62c1fe407d8162c5; QUAD $0xb16207c1724815b1; QUAD $0x05b16212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe407dc16296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d3162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815916202626f48; QUAD $0x72480d916211c772; QUAD $0xd7724805916213c7; QUAD $0x96ef25480d53620a; QUAD $0x8162cdfe4075c162; QUAD $0x4815b162cafe4075; QUAD $0x72480db16207c272; QUAD $0xd2724805b16212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe4075c162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x3162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c0724815b16203; QUAD $0x6213c072480db162; QUAD $0x53620ad0724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe406d8162d5fe40; QUAD $0x07c3724815b162d3; QUAD $0x6212c372480db162; QUAD $0x536203d3724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d3162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0xb16204626f487e71; QUAD $0x0db16211c1724815; QUAD $0x4805b16213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4065c16296ef; QUAD $0xb162dcfe40658162; QUAD $0x0db16207c4724815; QUAD $0x4805b16212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4065c16296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x724815b16205626f; QUAD $0xc272480db16211c2; QUAD $0x0ad2724805b16213; QUAD $0x6296ef25480d5362; QUAD $0x5d8162e5fe405dc1; QUAD $0x724815b162e5fe40; QUAD $0xc572480db16207c5; QUAD $0x03d5724805b16212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe405dc1; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d3162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x06626f487e7162d0; QUAD $0x6211c3724815b162; QUAD $0xb16213c372480db1; QUAD $0x0d53620ad3724805; QUAD $0x4055c16296ef2548; QUAD $0xeefe40558162edfe; QUAD $0x6207c6724815b162; QUAD $0xb16212c672480db1; QUAD $0x0d536203d6724805; QUAD $0x4055c16296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d3162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x15b16207626f487e; QUAD $0x480db16211c47248; QUAD $0x724805b16213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe404dc16296; QUAD $0x15b162f7fe404d81; QUAD $0x480db16207c77248; QUAD $0x724805b16212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe404dc16296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d31; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc5724815b1620862; QUAD $0x13c572480db16211; QUAD $0x620ad5724805b162; QUAD $0xc16296ef25480d53; QUAD $0x4045a162fdfe4045; QUAD $0xc07248159162f8fe; QUAD $0x12c072480d916207; QUAD $0x6203d07248059162; QUAD $0xc16296ef25480d53; QUAD $0x48455162fdfe4045; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d1162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6209626f487e7162; QUAD $0xb16211c6724815b1; QUAD $0x05b16213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe403d416296ef25; QUAD $0x62c1fe403d2162c5; QUAD $0x916207c172481591; QUAD $0x05916212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe403d416296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d1162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815b1620a626f48; QUAD $0x72480db16211c772; QUAD $0xd7724805b16213c7; QUAD $0x96ef25480d53620a; QUAD $0x2162cdfe40354162; QUAD $0x48159162cafe4035; QUAD $0x72480d916207c272; QUAD $0xd2724805916212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe40354162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x1162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c072481591620b; QUAD $0x6213c072480d9162; QUAD $0x53620ad072480591; QUAD $0x2d416296ef25480d; QUAD $0xfe402d2162d5fe40; QUAD $0x07c37248159162d3; QUAD $0x6212c372480d9162; QUAD $0x536203d372480591; QUAD $0x2d416296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d1162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0x91620c626f487e71; QUAD $0x0d916211c1724815; QUAD $0x4805916213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4025416296ef; QUAD $0x9162dcfe40252162; QUAD $0x0d916207c4724815; QUAD $0x4805916212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4025416296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x72481591620d626f; QUAD $0xc272480d916211c2; QUAD $0x0ad2724805916213; QUAD $0x6296ef25480d5362; QUAD $0x1d2162e5fe401d41; QUAD $0x7248159162e5fe40; QUAD $0xc572480d916207c5; QUAD $0x03d5724805916212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe401d41; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d1162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x0e626f487e7162d0; QUAD $0x6211c37248159162; QUAD $0x916213c372480d91; QUAD $0x0d53620ad3724805; QUAD $0x4015416296ef2548; QUAD $0xeefe40152162edfe; QUAD $0x6207c67248159162; QUAD $0x916212c672480d91; QUAD $0x0d536203d6724805; QUAD $0x4015416296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d1162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x1591620f626f487e; QUAD $0x480d916211c47248; QUAD $0x724805916213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe400d416296; QUAD $0x159162f7fe400d21; QUAD $0x480d916207c77248; QUAD $0x724805916212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe400d416296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d11; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc572481591621062; QUAD $0x13c572480d916211; QUAD $0x620ad57248059162; QUAD $0x416296ef25480d53; QUAD $0x40050162fdfe4005; QUAD $0xc0724815b162f8fe; QUAD $0x12c072480db16207; QUAD $0x6203d0724805b162; QUAD $0x416296ef25480d53; QUAD $0x48455162fdfe4005; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d3162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6211626f487e7162; QUAD $0x916211c672481591; QUAD $0x05916213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe407dc16296ef25; QUAD $0x62c1fe407d8162c5; QUAD $0xb16207c1724815b1; QUAD $0x05b16212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe407dc16296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d3162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815916212626f48; QUAD $0x72480d916211c772; QUAD $0xd7724805916213c7; QUAD $0x96ef25480d53620a; QUAD $0x8162cdfe4075c162; QUAD $0x4815b162cafe4075; QUAD $0x72480db16207c272; QUAD $0xd2724805b16212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe4075c162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x3162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c0724815b16213; QUAD $0x6213c072480db162; QUAD $0x53620ad0724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe406d8162d5fe40; QUAD $0x07c3724815b162d3; QUAD $0x6212c372480db162; QUAD $0x536203d3724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d3162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0xb16214626f487e71; QUAD $0x0db16211c1724815; QUAD $0x4805b16213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4065c16296ef; QUAD $0xb162dcfe40658162; QUAD $0x0db16207c4724815; QUAD $0x4805b16212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4065c16296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x724815b16215626f; QUAD $0xc272480db16211c2; QUAD $0x0ad2724805b16213; QUAD $0x6296ef25480d5362; QUAD $0x5d8162e5fe405dc1; QUAD $0x724815b162e5fe40; QUAD $0xc572480db16207c5; QUAD $0x03d5724805b16212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe405dc1; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d3162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x16626f487e7162d0; QUAD $0x6211c3724815b162; QUAD $0xb16213c372480db1; QUAD $0x0d53620ad3724805; QUAD $0x4055c16296ef2548; QUAD $0xeefe40558162edfe; QUAD $0x6207c6724815b162; QUAD $0xb16212c672480db1; QUAD $0x0d536203d6724805; QUAD $0x4055c16296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d3162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x15b16217626f487e; QUAD $0x480db16211c47248; QUAD $0x724805b16213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe404dc16296; QUAD $0x15b162f7fe404d81; QUAD $0x480db16207c77248; QUAD $0x724805b16212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe404dc16296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d31; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc5724815b1621862; QUAD $0x13c572480db16211; QUAD $0x620ad5724805b162; QUAD $0xc16296ef25480d53; QUAD $0x4045a162fdfe4045; QUAD $0xc07248159162f8fe; QUAD $0x12c072480d916207; QUAD $0x6203d07248059162; QUAD $0xc16296ef25480d53; QUAD $0x48455162fdfe4045; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d1162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6219626f487e7162; QUAD $0xb16211c6724815b1; QUAD $0x05b16213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe403d416296ef25; QUAD $0x62c1fe403d2162c5; QUAD $0x916207c172481591; QUAD $0x05916212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe403d416296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d1162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815b1621a626f48; QUAD $0x72480db16211c772; QUAD $0xd7724805b16213c7; QUAD $0x96ef25480d53620a; QUAD $0x2162cdfe40354162; QUAD $0x48159162cafe4035; QUAD $0x72480d916207c272; QUAD $0xd2724805916212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe40354162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x1162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c072481591621b; QUAD $0x6213c072480d9162; QUAD $0x53620ad072480591; QUAD $0x2d416296ef25480d; QUAD $0xfe402d2162d5fe40; QUAD $0x07c37248159162d3; QUAD $0x6212c372480d9162; QUAD $0x536203d372480591; QUAD $0x2d416296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d1162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0x91621c626f487e71; QUAD $0x0d916211c1724815; QUAD $0x4805916213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4025416296ef; QUAD $0x9162dcfe40252162; QUAD $0x0d916207c4724815; QUAD $0x4805916212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4025416296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x72481591621d626f; QUAD $0xc272480d916211c2; QUAD $0x0ad2724805916213; QUAD $0x6296ef25480d5362; QUAD $0x1d2162e5fe401d41; QUAD $0x7248159162e5fe40; QUAD $0xc572480d916207c5; QUAD $0x03d5724805916212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe401d41; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d1162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x1e626f487e7162d0; QUAD $0x6211c37248159162; QUAD $0x916213c372480d91; QUAD $0x0d53620ad3724805; QUAD $0x4015416296ef2548; QUAD $0xeefe40152162edfe; QUAD $0x6207c67248159162; QUAD $0x916212c672480d91; QUAD $0x0d536203d6724805; QUAD $0x4015416296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d1162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x1591621f626f487e; QUAD $0x480d916211c47248; QUAD $0x724805916213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe400d416296; QUAD $0x159162f7fe400d21; QUAD $0x480d916207c77248; QUAD $0x724805916212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe400d416296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d11; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc572481591622062; QUAD $0x13c572480d916211; QUAD $0x620ad57248059162; QUAD $0x416296ef25480d53; QUAD $0x40050162fdfe4005; QUAD $0xc0724815b162f8fe; QUAD $0x12c072480db16207; QUAD $0x6203d0724805b162; QUAD $0x416296ef25480d53; QUAD $0x48455162fdfe4005; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d3162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6221626f487e7162; QUAD $0x916211c672481591; QUAD $0x05916213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe407dc16296ef25; QUAD $0x62c1fe407d8162c5; QUAD $0xb16207c1724815b1; QUAD $0x05b16212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe407dc16296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d3162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815916222626f48; QUAD $0x72480d916211c772; QUAD $0xd7724805916213c7; QUAD $0x96ef25480d53620a; QUAD $0x8162cdfe4075c162; QUAD $0x4815b162cafe4075; QUAD $0x72480db16207c272; QUAD $0xd2724805b16212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe4075c162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x3162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c0724815b16223; QUAD $0x6213c072480db162; QUAD $0x53620ad0724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe406d8162d5fe40; QUAD $0x07c3724815b162d3; QUAD $0x6212c372480db162; QUAD $0x536203d3724805b1; QUAD $0x6dc16296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d3162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0xb16224626f487e71; QUAD $0x0db16211c1724815; QUAD $0x4805b16213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4065c16296ef; QUAD $0xb162dcfe40658162; QUAD $0x0db16207c4724815; QUAD $0x4805b16212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4065c16296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x724815b16225626f; QUAD $0xc272480db16211c2; QUAD $0x0ad2724805b16213; QUAD $0x6296ef25480d5362; QUAD $0x5d8162e5fe405dc1; QUAD $0x724815b162e5fe40; QUAD $0xc572480db16207c5; QUAD $0x03d5724805b16212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe405dc1; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d3162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x26626f487e7162d0; QUAD $0x6211c3724815b162; QUAD $0xb16213c372480db1; QUAD $0x0d53620ad3724805; QUAD $0x4055c16296ef2548; QUAD $0xeefe40558162edfe; QUAD $0x6207c6724815b162; QUAD $0xb16212c672480db1; QUAD $0x0d536203d6724805; QUAD $0x4055c16296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d3162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x15b16227626f487e; QUAD $0x480db16211c47248; QUAD $0x724805b16213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe404dc16296; QUAD $0x15b162f7fe404d81; QUAD $0x480db16207c77248; QUAD $0x724805b16212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe404dc16296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d31; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc5724815b1622862; QUAD $0x13c572480db16211; QUAD $0x620ad5724805b162; QUAD $0xc16296ef25480d53; QUAD $0x4045a162fdfe4045; QUAD $0xc07248159162f8fe; QUAD $0x12c072480d916207; QUAD $0x6203d07248059162; QUAD $0xc16296ef25480d53; QUAD $0x48455162fdfe4045; QUAD $0xcc6f487e7162c4fe; QUAD $0x6206c472482df162; QUAD $0xf1620bc4724825f1; QUAD $0x55736219c472481d; QUAD $0x483d1162cace2548; QUAD $0xd42548255362c0fe; QUAD $0x62c1fe483d516296; QUAD $0x65d162c2fe483d51; QUAD $0x724845f162d8fe48; QUAD $0xc0724825f16202c0; QUAD $0x16c072481df1620d; QUAD $0x7362c86f487e7162; QUAD $0x25d362e8ca254875; QUAD $0x4845d16296fc2548; QUAD $0xf8fe4845d162f9fe; QUAD $0x6229626f487e7162; QUAD $0xb16211c6724815b1; QUAD $0x05b16213c672480d; QUAD $0x480d53620ad67248; QUAD $0xfe403d416296ef25; QUAD $0x62c1fe403d2162c5; QUAD $0x916207c172481591; QUAD $0x05916212c172480d; QUAD $0x480d536203d17248; QUAD $0xfe403d416296ef25; QUAD $0x62c4fe484d5162c5; QUAD $0x2df162cb6f487e71; QUAD $0x4825f16206c37248; QUAD $0x72481df1620bc372; QUAD $0xcd25485d736219c3; QUAD $0x62c1fe483d1162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xd0fe486dd162c2fe; QUAD $0x6202c772484df162; QUAD $0xf1620dc7724825f1; QUAD $0x7e716216c772481d; QUAD $0x25487d7362cf6f48; QUAD $0xf4254825d362e8c9; QUAD $0x62f1fe484dd16296; QUAD $0x7e7162f0fe484dd1; QUAD $0x4815b1622a626f48; QUAD $0x72480db16211c772; QUAD $0xd7724805b16213c7; QUAD $0x96ef25480d53620a; QUAD $0x2162cdfe40354162; QUAD $0x48159162cafe4035; QUAD $0x72480d916207c272; QUAD $0xd2724805916212c2; QUAD $0x96ef25480d536203; QUAD $0x5162cdfe40354162; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x1162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x11c072481591622b; QUAD $0x6213c072480d9162; QUAD $0x53620ad072480591; QUAD $0x2d416296ef25480d; QUAD $0xfe402d2162d5fe40; QUAD $0x07c37248159162d3; QUAD $0x6212c372480d9162; QUAD $0x536203d372480591; QUAD $0x2d416296ef25480d; QUAD $0xfe485d5162d5fe40; QUAD $0x62c96f487e7162c4; QUAD $0xf16206c172482df1; QUAD $0x1df1620bc1724825; QUAD $0x486d736219c17248; QUAD $0xfe483d1162cacb25; QUAD $0x96d42548255362c3; QUAD $0x5162c1fe483d5162; QUAD $0x487dd162c2fe483d; QUAD $0xc572485df162c0fe; QUAD $0x0dc5724825f16202; QUAD $0x6216c572481df162; QUAD $0x4d7362cd6f487e71; QUAD $0x4825d362e8cf2548; QUAD $0xfe485dd16296e425; QUAD $0x62e0fe485dd162e1; QUAD $0x91622c626f487e71; QUAD $0x0d916211c1724815; QUAD $0x4805916213c17248; QUAD $0x25480d53620ad172; QUAD $0xddfe4025416296ef; QUAD $0x9162dcfe40252162; QUAD $0x0d916207c4724815; QUAD $0x4805916212c47248; QUAD $0x25480d536203d472; QUAD $0xddfe4025416296ef; QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; QUAD $0x72481591622d626f; QUAD $0xc272480d916211c2; QUAD $0x0ad2724805916213; QUAD $0x6296ef25480d5362; QUAD $0x1d2162e5fe401d41; QUAD $0x7248159162e5fe40; QUAD $0xc572480d916207c5; QUAD $0x03d5724805916212; QUAD $0x6296ef25480d5362; QUAD $0x6d5162e5fe401d41; QUAD $0x6f487e7162c4fe48; QUAD $0x06c772482df162cf; QUAD $0x620bc7724825f162; QUAD $0x736219c772481df1; QUAD $0x3d1162cac925487d; QUAD $0x2548255362c5fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x486df162f0fe484d; QUAD $0x724825f16202c372; QUAD $0xc372481df1620dc3; QUAD $0x62cb6f487e716216; QUAD $0xd362e8cd25485d73; QUAD $0x6dd16296d4254825; QUAD $0xfe486dd162d1fe48; QUAD $0x2e626f487e7162d0; QUAD $0x6211c37248159162; QUAD $0x916213c372480d91; QUAD $0x0d53620ad3724805; QUAD $0x4015416296ef2548; QUAD $0xeefe40152162edfe; QUAD $0x6207c67248159162; QUAD $0x916212c672480d91; QUAD $0x0d536203d6724805; QUAD $0x4015416296ef2548; QUAD $0xc4fe48755162edfe; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d1162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x1591622f626f487e; QUAD $0x480d916211c47248; QUAD $0x724805916213c472; QUAD $0xef25480d53620ad4; QUAD $0x62f5fe400d416296; QUAD $0x159162f7fe400d21; QUAD $0x480d916207c77248; QUAD $0x724805916212c772; QUAD $0xef25480d536203d7; QUAD $0x62f5fe400d416296; QUAD $0x7e7162c4fe487d51; QUAD $0x72482df162cd6f48; QUAD $0xc5724825f16206c5; QUAD $0x19c572481df1620b; QUAD $0x62cacf25484d7362; QUAD $0x255362c7fe483d11; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162e0fe485dd162; QUAD $0x25f16202c172487d; QUAD $0x481df1620dc17248; QUAD $0x6f487e716216c172; QUAD $0xe8cb25486d7362c9; QUAD $0x6296c4254825d362; QUAD $0x7dd162c1fe487dd1; QUAD $0x6f487e7162c0fe48; QUAD $0xc572481591623062; QUAD $0x13c572480d916211; QUAD $0x620ad57248059162; QUAD $0x416296ef25480d53; QUAD $0x40050162fdfe4005; QUAD $0xc0724815b162f8fe; QUAD $0x12c072480db16207; QUAD $0x6203d0724805b162; QUAD $0x416296ef25480d53; QUAD $0x01ee8348fdfe4005
+ JE lastLoop
+ ADDQ $8, R13
+ MOVQ (R13), R14
+ QUAD $0x7162c4fe48455162; QUAD $0x482df162cc6f487e; QUAD $0x724825f16206c472; QUAD $0xc472481df1620bc4; QUAD $0xcace254855736219; QUAD $0x5362c0fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d8fe4865d162c2; QUAD $0xf16202c0724845f1; QUAD $0x1df1620dc0724825; QUAD $0x487e716216c07248; QUAD $0xca2548757362c86f; QUAD $0x96fc254825d362e8; QUAD $0xd162f9fe4845d162; QUAD $0x487e7162f8fe4845; WORD $0x626f; BYTE $0x31
+ TESTQ $(1<<0), R14
+ JE skipNext0
+ MOVQ 0*24(AX), R9
+ LONG $0x487cc162; WORD $0x0410; BYTE $0x09
+
+skipNext0:
+ QUAD $0x7162c4fe484d5162; QUAD $0x482df162cb6f487e; QUAD $0x724825f16206c372; QUAD $0xc372481df1620bc3; QUAD $0xcacd25485d736219; QUAD $0x5362c1fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d0fe486dd162c2; QUAD $0xf16202c772484df1; QUAD $0x1df1620dc7724825; QUAD $0x487e716216c77248; QUAD $0xc925487d7362cf6f; QUAD $0x96f4254825d362e8; QUAD $0xd162f1fe484dd162; QUAD $0x487e7162f0fe484d; WORD $0x626f; BYTE $0x32
+ TESTQ $(1<<1), R14
+ JE skipNext1
+ MOVQ 1*24(AX), R9
+ LONG $0x487cc162; WORD $0x0c10; BYTE $0x09
+
+skipNext1:
+ QUAD $0x7162c4fe48555162; QUAD $0x482df162ca6f487e; QUAD $0x724825f16206c272; QUAD $0xc272481df1620bc2; QUAD $0xcacc254865736219; QUAD $0x5362c2fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62c8fe4875d162c2; QUAD $0xf16202c6724855f1; QUAD $0x1df1620dc6724825; QUAD $0x487e716216c67248; QUAD $0xc82548457362ce6f; QUAD $0x96ec254825d362e8; QUAD $0xd162e9fe4855d162; QUAD $0x487e7162e8fe4855; WORD $0x626f; BYTE $0x33
+ TESTQ $(1<<2), R14
+ JE skipNext2
+ MOVQ 2*24(AX), R9
+ LONG $0x487cc162; WORD $0x1410; BYTE $0x09
+
+skipNext2:
+ QUAD $0x7162c4fe485d5162; QUAD $0x482df162c96f487e; QUAD $0x724825f16206c172; QUAD $0xc172481df1620bc1; QUAD $0xcacb25486d736219; QUAD $0x5362c3fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62c0fe487dd162c2; QUAD $0xf16202c572485df1; QUAD $0x1df1620dc5724825; QUAD $0x487e716216c57248; QUAD $0xcf25484d7362cd6f; QUAD $0x96e4254825d362e8; QUAD $0xd162e1fe485dd162; QUAD $0x487e7162e0fe485d; WORD $0x626f; BYTE $0x34
+ TESTQ $(1<<3), R14
+ JE skipNext3
+ MOVQ 3*24(AX), R9
+ LONG $0x487cc162; WORD $0x1c10; BYTE $0x09
+
+skipNext3:
+ QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; WORD $0x626f; BYTE $0x35
+ TESTQ $(1<<4), R14
+ JE skipNext4
+ MOVQ 4*24(AX), R9
+ LONG $0x487cc162; WORD $0x2410; BYTE $0x09
+
+skipNext4:
+ QUAD $0x7162c4fe486d5162; QUAD $0x482df162cf6f487e; QUAD $0x724825f16206c772; QUAD $0xc772481df1620bc7; QUAD $0xcac925487d736219; QUAD $0x5362c5fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f0fe484dd162c2; QUAD $0xf16202c372486df1; QUAD $0x1df1620dc3724825; QUAD $0x487e716216c37248; QUAD $0xcd25485d7362cb6f; QUAD $0x96d4254825d362e8; QUAD $0xd162d1fe486dd162; QUAD $0x487e7162d0fe486d; WORD $0x626f; BYTE $0x36
+ TESTQ $(1<<5), R14
+ JE skipNext5
+ MOVQ 5*24(AX), R9
+ LONG $0x487cc162; WORD $0x2c10; BYTE $0x09
+
+skipNext5:
+ QUAD $0x7162c4fe48755162; QUAD $0x482df162ce6f487e; QUAD $0x724825f16206c672; QUAD $0xc672481df1620bc6; QUAD $0xcac8254845736219; QUAD $0x5362c6fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62e8fe4855d162c2; QUAD $0xf16202c2724875f1; QUAD $0x1df1620dc2724825; QUAD $0x487e716216c27248; QUAD $0xcc2548657362ca6f; QUAD $0x96cc254825d362e8; QUAD $0xd162c9fe4875d162; QUAD $0x487e7162c8fe4875; WORD $0x626f; BYTE $0x37
+ TESTQ $(1<<6), R14
+ JE skipNext6
+ MOVQ 6*24(AX), R9
+ LONG $0x487cc162; WORD $0x3410; BYTE $0x09
+
+skipNext6:
+ QUAD $0x7162c4fe487d5162; QUAD $0x482df162cd6f487e; QUAD $0x724825f16206c572; QUAD $0xc572481df1620bc5; QUAD $0xcacf25484d736219; QUAD $0x5362c7fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62e0fe485dd162c2; QUAD $0xf16202c172487df1; QUAD $0x1df1620dc1724825; QUAD $0x487e716216c17248; QUAD $0xcb25486d7362c96f; QUAD $0x96c4254825d362e8; QUAD $0xd162c1fe487dd162; QUAD $0x487e7162c0fe487d; WORD $0x626f; BYTE $0x38
+ TESTQ $(1<<7), R14
+ JE skipNext7
+ MOVQ 7*24(AX), R9
+ LONG $0x487cc162; WORD $0x3c10; BYTE $0x09
+
+skipNext7:
+ QUAD $0x7162c4fe48455162; QUAD $0x482df162cc6f487e; QUAD $0x724825f16206c472; QUAD $0xc472481df1620bc4; QUAD $0xcace254855736219; QUAD $0x5362c0fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d8fe4865d162c2; QUAD $0xf16202c0724845f1; QUAD $0x1df1620dc0724825; QUAD $0x487e716216c07248; QUAD $0xca2548757362c86f; QUAD $0x96fc254825d362e8; QUAD $0xd162f9fe4845d162; QUAD $0x487e7162f8fe4845; WORD $0x626f; BYTE $0x39
+ TESTQ $(1<<8), R14
+ JE skipNext8
+ MOVQ 8*24(AX), R9
+ LONG $0x487c4162; WORD $0x0410; BYTE $0x09
+
+skipNext8:
+ QUAD $0x7162c4fe484d5162; QUAD $0x482df162cb6f487e; QUAD $0x724825f16206c372; QUAD $0xc372481df1620bc3; QUAD $0xcacd25485d736219; QUAD $0x5362c1fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d0fe486dd162c2; QUAD $0xf16202c772484df1; QUAD $0x1df1620dc7724825; QUAD $0x487e716216c77248; QUAD $0xc925487d7362cf6f; QUAD $0x96f4254825d362e8; QUAD $0xd162f1fe484dd162; QUAD $0x487e7162f0fe484d; WORD $0x626f; BYTE $0x3a
+ TESTQ $(1<<9), R14
+ JE skipNext9
+ MOVQ 9*24(AX), R9
+ LONG $0x487c4162; WORD $0x0c10; BYTE $0x09
+
+skipNext9:
+ QUAD $0x7162c4fe48555162; QUAD $0x482df162ca6f487e; QUAD $0x724825f16206c272; QUAD $0xc272481df1620bc2; QUAD $0xcacc254865736219; QUAD $0x5362c2fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62c8fe4875d162c2; QUAD $0xf16202c6724855f1; QUAD $0x1df1620dc6724825; QUAD $0x487e716216c67248; QUAD $0xc82548457362ce6f; QUAD $0x96ec254825d362e8; QUAD $0xd162e9fe4855d162; QUAD $0x487e7162e8fe4855; WORD $0x626f; BYTE $0x3b
+ TESTQ $(1<<10), R14
+ JE skipNext10
+ MOVQ 10*24(AX), R9
+ LONG $0x487c4162; WORD $0x1410; BYTE $0x09
+
+skipNext10:
+ QUAD $0x7162c4fe485d5162; QUAD $0x482df162c96f487e; QUAD $0x724825f16206c172; QUAD $0xc172481df1620bc1; QUAD $0xcacb25486d736219; QUAD $0x5362c3fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62c0fe487dd162c2; QUAD $0xf16202c572485df1; QUAD $0x1df1620dc5724825; QUAD $0x487e716216c57248; QUAD $0xcf25484d7362cd6f; QUAD $0x96e4254825d362e8; QUAD $0xd162e1fe485dd162; QUAD $0x487e7162e0fe485d; WORD $0x626f; BYTE $0x3c
+ TESTQ $(1<<11), R14
+ JE skipNext11
+ MOVQ 11*24(AX), R9
+ LONG $0x487c4162; WORD $0x1c10; BYTE $0x09
+
+skipNext11:
+ QUAD $0x7162c4fe48655162; QUAD $0x482df162c86f487e; QUAD $0x724825f16206c072; QUAD $0xc072481df1620bc0; QUAD $0xcaca254875736219; QUAD $0x5362c4fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f8fe4845d162c2; QUAD $0xf16202c4724865f1; QUAD $0x1df1620dc4724825; QUAD $0x487e716216c47248; QUAD $0xce2548557362cc6f; QUAD $0x96dc254825d362e8; QUAD $0xd162d9fe4865d162; QUAD $0x487e7162d8fe4865; WORD $0x626f; BYTE $0x3d
+ TESTQ $(1<<12), R14
+ JE skipNext12
+ MOVQ 12*24(AX), R9
+ LONG $0x487c4162; WORD $0x2410; BYTE $0x09
+
+skipNext12:
+ QUAD $0x7162c4fe486d5162; QUAD $0x482df162cf6f487e; QUAD $0x724825f16206c772; QUAD $0xc772481df1620bc7; QUAD $0xcac925487d736219; QUAD $0x5362c5fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62f0fe484dd162c2; QUAD $0xf16202c372486df1; QUAD $0x1df1620dc3724825; QUAD $0x487e716216c37248; QUAD $0xcd25485d7362cb6f; QUAD $0x96d4254825d362e8; QUAD $0xd162d1fe486dd162; QUAD $0x487e7162d0fe486d; WORD $0x626f; BYTE $0x3e
+ TESTQ $(1<<13), R14
+ JE skipNext13
+ MOVQ 13*24(AX), R9
+ LONG $0x487c4162; WORD $0x2c10; BYTE $0x09
+
+skipNext13:
+ QUAD $0x7162c4fe48755162; QUAD $0x482df162ce6f487e; QUAD $0x724825f16206c672; QUAD $0xc672481df1620bc6; QUAD $0xcac8254845736219; QUAD $0x5362c6fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62e8fe4855d162c2; QUAD $0xf16202c2724875f1; QUAD $0x1df1620dc2724825; QUAD $0x487e716216c27248; QUAD $0xcc2548657362ca6f; QUAD $0x96cc254825d362e8; QUAD $0xd162c9fe4875d162; QUAD $0x487e7162c8fe4875; WORD $0x626f; BYTE $0x3f
+ TESTQ $(1<<14), R14
+ JE skipNext14
+ MOVQ 14*24(AX), R9
+ LONG $0x487c4162; WORD $0x3410; BYTE $0x09
+
+skipNext14:
+ QUAD $0x7162c4fe487d5162; QUAD $0x482df162cd6f487e; QUAD $0x724825f16206c572; QUAD $0xc572481df1620bc5; QUAD $0xcacf25484d736219; QUAD $0x5362c7fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62e0fe485dd162c2; QUAD $0xf16202c172487df1; QUAD $0x1df1620dc1724825; QUAD $0x487e716216c17248; QUAD $0xcb25486d7362c96f; QUAD $0x96c4254825d362e8; QUAD $0xd162c1fe487dd162; QUAD $0x487e7162c0fe487d; WORD $0x626f; BYTE $0x40
+ TESTQ $(1<<15), R14
+ JE skipNext15
+ MOVQ 15*24(AX), R9
+ LONG $0x487c4162; WORD $0x3c10; BYTE $0x09
+
+skipNext15:
+ QUAD $0xd162d86f487e7162; QUAD $0x7dd16224046f487e; QUAD $0x6f487e7162c3fe49; QUAD $0x244c6f487ed162d9; QUAD $0x62cbfe4975d16201; QUAD $0x7ed162da6f487e71; QUAD $0x6dd1620224546f48; QUAD $0x6f487e7162d3fe49; QUAD $0x245c6f487ed162db; QUAD $0x62dbfe4965d16203; QUAD $0x7ed162dc6f487e71; QUAD $0x5dd1620424646f48; QUAD $0x6f487e7162e3fe49; QUAD $0x246c6f487ed162dd; QUAD $0x62ebfe4955d16205; QUAD $0x7ed162de6f487e71; QUAD $0x4dd1620624746f48; QUAD $0x6f487e7162f3fe49; QUAD $0x247c6f487ed162df; QUAD $0xc4fbfe4945d16207; LONG $0xce92fbc1
+ JMP lloop
+
+lastLoop:
+ QUAD $0x7162c4fe48455162; QUAD $0x482df162cc6f487e; QUAD $0x724825f16206c472; QUAD $0xc472481df1620bc4; QUAD $0xcace254855736219; QUAD $0x5362c0fe483d3162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d8fe4865d162c2; QUAD $0xf16202c0724845f1; QUAD $0x1df1620dc0724825; QUAD $0x487e716216c07248; QUAD $0xca2548757362c86f; QUAD $0x96fc254825d362e8; QUAD $0xd162f9fe4845d162; QUAD $0x487e7162f8fe4845; QUAD $0xfe484d516231626f; QUAD $0x62cb6f487e7162c4; QUAD $0xf16206c372482df1; QUAD $0x1df1620bc3724825; QUAD $0x485d736219c37248; QUAD $0xfe483d3162cacd25; QUAD $0x96d42548255362c1; QUAD $0x5162c1fe483d5162; QUAD $0x486dd162c2fe483d; QUAD $0xc772484df162d0fe; QUAD $0x0dc7724825f16202; QUAD $0x6216c772481df162; QUAD $0x7d7362cf6f487e71; QUAD $0x4825d362e8c92548; QUAD $0xfe484dd16296f425; QUAD $0x62f0fe484dd162f1; QUAD $0x516232626f487e71; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x3162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x62c4fe485d516233; QUAD $0x2df162c96f487e71; QUAD $0x4825f16206c17248; QUAD $0x72481df1620bc172; QUAD $0xcb25486d736219c1; QUAD $0x62c3fe483d3162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xc0fe487dd162c2fe; QUAD $0x6202c572485df162; QUAD $0xf1620dc5724825f1; QUAD $0x7e716216c572481d; QUAD $0x25484d7362cd6f48; QUAD $0xe4254825d362e8cf; QUAD $0x62e1fe485dd16296; QUAD $0x7e7162e0fe485dd1; QUAD $0x4865516234626f48; QUAD $0xc86f487e7162c4fe; QUAD $0x6206c072482df162; QUAD $0xf1620bc0724825f1; QUAD $0x75736219c072481d; QUAD $0x483d3162caca2548; QUAD $0xd42548255362c4fe; QUAD $0x62c1fe483d516296; QUAD $0x45d162c2fe483d51; QUAD $0x724865f162f8fe48; QUAD $0xc4724825f16202c4; QUAD $0x16c472481df1620d; QUAD $0x7362cc6f487e7162; QUAD $0x25d362e8ce254855; QUAD $0x4865d16296dc2548; QUAD $0xd8fe4865d162d9fe; QUAD $0x6235626f487e7162; QUAD $0x7e7162c4fe486d51; QUAD $0x72482df162cf6f48; QUAD $0xc7724825f16206c7; QUAD $0x19c772481df1620b; QUAD $0x62cac925487d7362; QUAD $0x255362c5fe483d31; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162f0fe484dd162; QUAD $0x25f16202c372486d; QUAD $0x481df1620dc37248; QUAD $0x6f487e716216c372; QUAD $0xe8cd25485d7362cb; QUAD $0x6296d4254825d362; QUAD $0x6dd162d1fe486dd1; QUAD $0x6f487e7162d0fe48; QUAD $0xc4fe487551623662; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d3162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x7d516237626f487e; QUAD $0x6f487e7162c4fe48; QUAD $0x06c572482df162cd; QUAD $0x620bc5724825f162; QUAD $0x736219c572481df1; QUAD $0x3d3162cacf25484d; QUAD $0x2548255362c7fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x487df162e0fe485d; QUAD $0x724825f16202c172; QUAD $0xc172481df1620dc1; QUAD $0x62c96f487e716216; QUAD $0xd362e8cb25486d73; QUAD $0x7dd16296c4254825; QUAD $0xfe487dd162c1fe48; QUAD $0x38626f487e7162c0; QUAD $0x7162c4fe48455162; QUAD $0x482df162cc6f487e; QUAD $0x724825f16206c472; QUAD $0xc472481df1620bc4; QUAD $0xcace254855736219; QUAD $0x5362c0fe483d1162; QUAD $0x3d516296d4254825; QUAD $0xfe483d5162c1fe48; QUAD $0x62d8fe4865d162c2; QUAD $0xf16202c0724845f1; QUAD $0x1df1620dc0724825; QUAD $0x487e716216c07248; QUAD $0xca2548757362c86f; QUAD $0x96fc254825d362e8; QUAD $0xd162f9fe4845d162; QUAD $0x487e7162f8fe4845; QUAD $0xfe484d516239626f; QUAD $0x62cb6f487e7162c4; QUAD $0xf16206c372482df1; QUAD $0x1df1620bc3724825; QUAD $0x485d736219c37248; QUAD $0xfe483d1162cacd25; QUAD $0x96d42548255362c1; QUAD $0x5162c1fe483d5162; QUAD $0x486dd162c2fe483d; QUAD $0xc772484df162d0fe; QUAD $0x0dc7724825f16202; QUAD $0x6216c772481df162; QUAD $0x7d7362cf6f487e71; QUAD $0x4825d362e8c92548; QUAD $0xfe484dd16296f425; QUAD $0x62f0fe484dd162f1; QUAD $0x51623a626f487e71; QUAD $0x487e7162c4fe4855; QUAD $0xc272482df162ca6f; QUAD $0x0bc2724825f16206; QUAD $0x6219c272481df162; QUAD $0x1162cacc25486573; QUAD $0x48255362c2fe483d; QUAD $0xfe483d516296d425; QUAD $0x62c2fe483d5162c1; QUAD $0x55f162c8fe4875d1; QUAD $0x4825f16202c67248; QUAD $0x72481df1620dc672; QUAD $0xce6f487e716216c6; QUAD $0x62e8c82548457362; QUAD $0xd16296ec254825d3; QUAD $0x4855d162e9fe4855; QUAD $0x626f487e7162e8fe; QUAD $0x62c4fe485d51623b; QUAD $0x2df162c96f487e71; QUAD $0x4825f16206c17248; QUAD $0x72481df1620bc172; QUAD $0xcb25486d736219c1; QUAD $0x62c3fe483d1162ca; QUAD $0x516296d425482553; QUAD $0x483d5162c1fe483d; QUAD $0xc0fe487dd162c2fe; QUAD $0x6202c572485df162; QUAD $0xf1620dc5724825f1; QUAD $0x7e716216c572481d; QUAD $0x25484d7362cd6f48; QUAD $0xe4254825d362e8cf; QUAD $0x62e1fe485dd16296; QUAD $0x7e7162e0fe485dd1; QUAD $0x486551623c626f48; QUAD $0xc86f487e7162c4fe; QUAD $0x6206c072482df162; QUAD $0xf1620bc0724825f1; QUAD $0x75736219c072481d; QUAD $0x483d1162caca2548; QUAD $0xd42548255362c4fe; QUAD $0x62c1fe483d516296; QUAD $0x45d162c2fe483d51; QUAD $0x724865f162f8fe48; QUAD $0xc4724825f16202c4; QUAD $0x16c472481df1620d; QUAD $0x7362cc6f487e7162; QUAD $0x25d362e8ce254855; QUAD $0x4865d16296dc2548; QUAD $0xd8fe4865d162d9fe; QUAD $0x623d626f487e7162; QUAD $0x7e7162c4fe486d51; QUAD $0x72482df162cf6f48; QUAD $0xc7724825f16206c7; QUAD $0x19c772481df1620b; QUAD $0x62cac925487d7362; QUAD $0x255362c5fe483d11; QUAD $0x483d516296d42548; QUAD $0xc2fe483d5162c1fe; QUAD $0xf162f0fe484dd162; QUAD $0x25f16202c372486d; QUAD $0x481df1620dc37248; QUAD $0x6f487e716216c372; QUAD $0xe8cd25485d7362cb; QUAD $0x6296d4254825d362; QUAD $0x6dd162d1fe486dd1; QUAD $0x6f487e7162d0fe48; QUAD $0xc4fe487551623e62; QUAD $0xf162ce6f487e7162; QUAD $0x25f16206c672482d; QUAD $0x481df1620bc67248; QUAD $0x254845736219c672; QUAD $0xc6fe483d1162cac8; QUAD $0x6296d42548255362; QUAD $0x3d5162c1fe483d51; QUAD $0xfe4855d162c2fe48; QUAD $0x02c2724875f162e8; QUAD $0x620dc2724825f162; QUAD $0x716216c272481df1; QUAD $0x48657362ca6f487e; QUAD $0x254825d362e8cc25; QUAD $0xc9fe4875d16296cc; QUAD $0x7162c8fe4875d162; QUAD $0x7d51623f626f487e; QUAD $0x6f487e7162c4fe48; QUAD $0x06c572482df162cd; QUAD $0x620bc5724825f162; QUAD $0x736219c572481df1; QUAD $0x3d1162cacf25484d; QUAD $0x2548255362c7fe48; QUAD $0xc1fe483d516296d4; QUAD $0xd162c2fe483d5162; QUAD $0x487df162e0fe485d; QUAD $0x724825f16202c172; QUAD $0xc172481df1620dc1; QUAD $0x62c96f487e716216; QUAD $0xd362e8cb25486d73; QUAD $0x7dd16296c4254825; QUAD $0xfe487dd162c1fe48; QUAD $0x40626f487e7162c0; QUAD $0xd162d86f487e7162; QUAD $0x7dd16224046f487e; QUAD $0x6f487e7162c3fe49; QUAD $0x244c6f487ed162d9; QUAD $0x62cbfe4975d16201; QUAD $0x7ed162da6f487e71; QUAD $0x6dd1620224546f48; QUAD $0x6f487e7162d3fe49; QUAD $0x245c6f487ed162db; QUAD $0x62dbfe4965d16203; QUAD $0x7ed162dc6f487e71; QUAD $0x5dd1620424646f48; QUAD $0x6f487e7162e3fe49; QUAD $0x246c6f487ed162dd; QUAD $0x62ebfe4955d16205; QUAD $0x7ed162de6f487e71; QUAD $0x4dd1620624746f48; QUAD $0x6f487e7162f3fe49; QUAD $0x247c6f487ed162df; QUAD $0x62fbfe4945d16207; QUAD $0x7ef162077f487ef1; QUAD $0x487ef162014f7f48; QUAD $0x7f487ef16202577f; QUAD $0x677f487ef162035f; QUAD $0x056f7f487ef16204; QUAD $0x6206777f487ef162; LONG $0x7f487ef1; WORD $0x077f
+ VZEROUPPER
+ RET
+
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x000(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x008(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x010(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x018(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x020(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x028(SB)/8, $0x0c0d0e0f08090a0b
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x030(SB)/8, $0x0405060700010203
+DATA PSHUFFLE_BYTE_FLIP_MASK<>+0x038(SB)/8, $0x0c0d0e0f08090a0b
+GLOBL PSHUFFLE_BYTE_FLIP_MASK<>(SB), 8, $64
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x000(SB)/8, $0x0000000000000000
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x008(SB)/8, $0x0000000000000001
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x010(SB)/8, $0x0000000000000008
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x018(SB)/8, $0x0000000000000009
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x020(SB)/8, $0x0000000000000004
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x028(SB)/8, $0x0000000000000005
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x030(SB)/8, $0x000000000000000C
+DATA PSHUFFLE_TRANSPOSE16_MASK1<>+0x038(SB)/8, $0x000000000000000D
+GLOBL PSHUFFLE_TRANSPOSE16_MASK1<>(SB), 8, $64
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x000(SB)/8, $0x0000000000000002
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x008(SB)/8, $0x0000000000000003
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x010(SB)/8, $0x000000000000000A
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x018(SB)/8, $0x000000000000000B
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x020(SB)/8, $0x0000000000000006
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x028(SB)/8, $0x0000000000000007
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x030(SB)/8, $0x000000000000000E
+DATA PSHUFFLE_TRANSPOSE16_MASK2<>+0x038(SB)/8, $0x000000000000000F
+GLOBL PSHUFFLE_TRANSPOSE16_MASK2<>(SB), 8, $64
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.go
new file mode 100644
index 0000000000..c2f71181f3
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.go
@@ -0,0 +1,22 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+//go:noescape
+func blockAvx(h []uint32, message []uint8, reserved0, reserved1, reserved2, reserved3 uint64)
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.s
new file mode 100644
index 0000000000..9f444d49f5
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockAvx_amd64.s
@@ -0,0 +1,408 @@
+//+build !noasm,!appengine
+
+// SHA256 implementation for AVX
+
+//
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// This code is based on an Intel White-Paper:
+// "Fast SHA-256 Implementations on Intel Architecture Processors"
+//
+// together with the reference implementation from the following authors:
+// James Guilford
+// Kirk Yap
+// Tim Chen
+//
+// For Golang it has been converted to Plan 9 assembly with the help of
+// github.com/minio/asm2plan9s to assemble Intel instructions to their Plan9
+// equivalents
+//
+
+#include "textflag.h"
+
+#define ROTATE_XS \
+ MOVOU X4, X15 \
+ MOVOU X5, X4 \
+ MOVOU X6, X5 \
+ MOVOU X7, X6 \
+ MOVOU X15, X7
+
+// compute s0 four at a time and s1 two at a time
+// compute W[-16] + W[-7] 4 at a time
+#define FOUR_ROUNDS_AND_SCHED(a, b, c, d, e, f, g, h) \
+ MOVL e, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL a, R14 \ // y1 = a
+ LONG $0x0f41e3c4; WORD $0x04c6 \ // VPALIGNR XMM0,XMM7,XMM6,0x4 /* XTMP0 = W[-7] */
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ XORL e, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL f, R15 \ // y2 = f
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL a, R14 \ // y1 = a ^ (a >> (22-13)
+ XORL g, R15 \ // y2 = f^g
+ LONG $0xc4fef9c5 \ // VPADDD XMM0,XMM0,XMM4 /* XTMP0 = W[-7] + W[-16] */
+ XORL e, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6) )
+ ANDL e, R15 \ // y2 = (f^g)&e
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ \
+ \ // compute s0
+ \
+ LONG $0x0f51e3c4; WORD $0x04cc \ // VPALIGNR XMM1,XMM5,XMM4,0x4 /* XTMP1 = W[-15] */
+ XORL a, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL g, R15 \ // y2 = CH = ((f^g)&e)^g
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+48(FP), R15 \ // y2 = k + w + S1 + CH
+ MOVL a, R13 \ // y0 = a
+ ADDL R15, h \ // h = h + S1 + CH + k + w
+ \ // ROTATE_ARGS
+ MOVL a, R15 \ // y2 = a
+ LONG $0xd172e9c5; BYTE $0x07 \ // VPSRLD XMM2,XMM1,0x7 /* */
+ ORL c, R13 \ // y0 = a|c
+ ADDL h, d \ // d = d + h + S1 + CH + k + w
+ ANDL c, R15 \ // y2 = a&c
+ LONG $0xf172e1c5; BYTE $0x19 \ // VPSLLD XMM3,XMM1,0x19 /* */
+ ANDL b, R13 \ // y0 = (a|c)&b
+ ADDL R14, h \ // h = h + S1 + CH + k + w + S0
+ LONG $0xdaebe1c5 \ // VPOR XMM3,XMM3,XMM2 /* XTMP1 = W[-15] MY_ROR 7 */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, h \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL d, R13 \ // y0 = e
+ MOVL h, R14 \ // y1 = a
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ XORL d, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL e, R15 \ // y2 = f
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ LONG $0xd172e9c5; BYTE $0x12 \ // VPSRLD XMM2,XMM1,0x12 /* */
+ XORL h, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL f, R15 \ // y2 = f^g
+ LONG $0xd172b9c5; BYTE $0x03 \ // VPSRLD XMM8,XMM1,0x3 /* XTMP4 = W[-15] >> 3 */
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ XORL d, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL d, R15 \ // y2 = (f^g)&e
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ LONG $0xf172f1c5; BYTE $0x0e \ // VPSLLD XMM1,XMM1,0xe /* */
+ XORL h, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ XORL f, R15 \ // y2 = CH = ((f^g)&e)^g
+ LONG $0xd9efe1c5 \ // VPXOR XMM3,XMM3,XMM1 /* */
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+52(FP), R15 \ // y2 = k + w + S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ LONG $0xdaefe1c5 \ // VPXOR XMM3,XMM3,XMM2 /* XTMP1 = W[-15] MY_ROR 7 ^ W[-15] MY_ROR */
+ MOVL h, R13 \ // y0 = a
+ ADDL R15, g \ // h = h + S1 + CH + k + w
+ MOVL h, R15 \ // y2 = a
+ LONG $0xef61c1c4; BYTE $0xc8 \ // VPXOR XMM1,XMM3,XMM8 /* XTMP1 = s0 */
+ ORL b, R13 \ // y0 = a|c
+ ADDL g, c \ // d = d + h + S1 + CH + k + w
+ ANDL b, R15 \ // y2 = a&c
+ \
+ \ // compute low s1
+ \
+ LONG $0xd770f9c5; BYTE $0xfa \ // VPSHUFD XMM2,XMM7,0xfa /* XTMP2 = W[-2] {BBAA} */
+ ANDL a, R13 \ // y0 = (a|c)&b
+ ADDL R14, g \ // h = h + S1 + CH + k + w + S0
+ LONG $0xc1fef9c5 \ // VPADDD XMM0,XMM0,XMM1 /* XTMP0 = W[-16] + W[-7] + s0 */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, g \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL c, R13 \ // y0 = e
+ MOVL g, R14 \ // y1 = a
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ XORL c, R13 \ // y0 = e ^ (e >> (25-11))
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ MOVL d, R15 \ // y2 = f
+ XORL g, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ LONG $0xd272b9c5; BYTE $0x0a \ // VPSRLD XMM8,XMM2,0xa /* XTMP4 = W[-2] >> 10 {BBAA} */
+ XORL e, R15 \ // y2 = f^g
+ LONG $0xd273e1c5; BYTE $0x13 \ // VPSRLQ XMM3,XMM2,0x13 /* XTMP3 = W[-2] MY_ROR 19 {xBxA} */
+ XORL c, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL c, R15 \ // y2 = (f^g)&e
+ LONG $0xd273e9c5; BYTE $0x11 \ // VPSRLQ XMM2,XMM2,0x11 /* XTMP2 = W[-2] MY_ROR 17 {xBxA} */
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ XORL g, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ XORL e, R15 \ // y2 = CH = ((f^g)&e)^g
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ LONG $0xd3efe9c5 \ // VPXOR XMM2,XMM2,XMM3 /* */
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL _xfer+56(FP), R15 \ // y2 = k + w + S1 + CH
+ LONG $0xc2ef39c5 \ // VPXOR XMM8,XMM8,XMM2 /* XTMP4 = s1 {xBxA} */
+ MOVL g, R13 \ // y0 = a
+ ADDL R15, f \ // h = h + S1 + CH + k + w
+ MOVL g, R15 \ // y2 = a
+ LONG $0x003942c4; BYTE $0xc2 \ // VPSHUFB XMM8,XMM8,XMM10 /* XTMP4 = s1 {00BA} */
+ ORL a, R13 \ // y0 = a|c
+ ADDL f, b \ // d = d + h + S1 + CH + k + w
+ ANDL a, R15 \ // y2 = a&c
+ LONG $0xfe79c1c4; BYTE $0xc0 \ // VPADDD XMM0,XMM0,XMM8 /* XTMP0 = {..., ..., W[1], W[0]} */
+ ANDL h, R13 \ // y0 = (a|c)&b
+ ADDL R14, f \ // h = h + S1 + CH + k + w + S0
+ \
+ \ // compute high s1
+ \
+ LONG $0xd070f9c5; BYTE $0x50 \ // VPSHUFD XMM2,XMM0,0x50 /* XTMP2 = W[-2] {DDCC} */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, f \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL b, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL f, R14 \ // y1 = a
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ XORL b, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL c, R15 \ // y2 = f
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ LONG $0xd272a1c5; BYTE $0x0a \ // VPSRLD XMM11,XMM2,0xa /* XTMP5 = W[-2] >> 10 {DDCC} */
+ XORL f, R14 \ // y1 = a ^ (a >> (22-13)
+ XORL d, R15 \ // y2 = f^g
+ LONG $0xd273e1c5; BYTE $0x13 \ // VPSRLQ XMM3,XMM2,0x13 /* XTMP3 = W[-2] MY_ROR 19 {xDxC} */
+ XORL b, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL b, R15 \ // y2 = (f^g)&e
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ LONG $0xd273e9c5; BYTE $0x11 \ // VPSRLQ XMM2,XMM2,0x11 /* XTMP2 = W[-2] MY_ROR 17 {xDxC} */
+ XORL f, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL d, R15 \ // y2 = CH = ((f^g)&e)^g
+ LONG $0xd3efe9c5 \ // VPXOR XMM2,XMM2,XMM3 /* */
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+60(FP), R15 \ // y2 = k + w + S1 + CH
+ LONG $0xdaef21c5 \ // VPXOR XMM11,XMM11,XMM2 /* XTMP5 = s1 {xDxC} */
+ MOVL f, R13 \ // y0 = a
+ ADDL R15, e \ // h = h + S1 + CH + k + w
+ MOVL f, R15 \ // y2 = a
+ LONG $0x002142c4; BYTE $0xdc \ // VPSHUFB XMM11,XMM11,XMM12 /* XTMP5 = s1 {DC00} */
+ ORL h, R13 \ // y0 = a|c
+ ADDL e, a \ // d = d + h + S1 + CH + k + w
+ ANDL h, R15 \ // y2 = a&c
+ LONG $0xe0fea1c5 \ // VPADDD XMM4,XMM11,XMM0 /* X0 = {W[3], W[2], W[1], W[0]} */
+ ANDL g, R13 \ // y0 = (a|c)&b
+ ADDL R14, e \ // h = h + S1 + CH + k + w + S0
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, e \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ ROTATE_XS
+
+#define DO_ROUND(a, b, c, d, e, f, g, h, offset) \
+ MOVL e, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL a, R14 \ // y1 = a
+ XORL e, R13 \ // y0 = e ^ (e >> (25-11))
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ MOVL f, R15 \ // y2 = f
+ XORL a, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL g, R15 \ // y2 = f^g
+ XORL e, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ ANDL e, R15 \ // y2 = (f^g)&e
+ XORL a, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL g, R15 \ // y2 = CH = ((f^g)&e)^g
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL _xfer+offset(FP), R15 \ // y2 = k + w + S1 + CH
+ MOVL a, R13 \ // y0 = a
+ ADDL R15, h \ // h = h + S1 + CH + k + w
+ MOVL a, R15 \ // y2 = a
+ ORL c, R13 \ // y0 = a|c
+ ADDL h, d \ // d = d + h + S1 + CH + k + w
+ ANDL c, R15 \ // y2 = a&c
+ ANDL b, R13 \ // y0 = (a|c)&b
+ ADDL R14, h \ // h = h + S1 + CH + k + w + S0
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, h // h = h + S1 + CH + k + w + S0 + MAJ
+
+// func blockAvx(h []uint32, message []uint8, reserved0, reserved1, reserved2, reserved3 uint64)
+TEXT ·blockAvx(SB), 7, $0-80
+
+ MOVQ h+0(FP), SI // SI: &h
+ MOVQ message_base+24(FP), R8 // &message
+ MOVQ message_len+32(FP), R9 // length of message
+ CMPQ R9, $0
+ JEQ done_hash
+ ADDQ R8, R9
+ MOVQ R9, reserved2+64(FP) // store end of message
+
+ // Register definition
+ // a --> eax
+ // b --> ebx
+ // c --> ecx
+ // d --> r8d
+ // e --> edx
+ // f --> r9d
+ // g --> r10d
+ // h --> r11d
+ //
+ // y0 --> r13d
+ // y1 --> r14d
+ // y2 --> r15d
+
+ MOVL (0*4)(SI), AX // a = H0
+ MOVL (1*4)(SI), BX // b = H1
+ MOVL (2*4)(SI), CX // c = H2
+ MOVL (3*4)(SI), R8 // d = H3
+ MOVL (4*4)(SI), DX // e = H4
+ MOVL (5*4)(SI), R9 // f = H5
+ MOVL (6*4)(SI), R10 // g = H6
+ MOVL (7*4)(SI), R11 // h = H7
+
+ MOVOU bflipMask<>(SB), X13
+ MOVOU shuf00BA<>(SB), X10 // shuffle xBxA -> 00BA
+ MOVOU shufDC00<>(SB), X12 // shuffle xDxC -> DC00
+
+ MOVQ message_base+24(FP), SI // SI: &message
+
+loop0:
+ LEAQ constants<>(SB), BP
+
+ // byte swap first 16 dwords
+ MOVOU 0*16(SI), X4
+ LONG $0x0059c2c4; BYTE $0xe5 // VPSHUFB XMM4, XMM4, XMM13
+ MOVOU 1*16(SI), X5
+ LONG $0x0051c2c4; BYTE $0xed // VPSHUFB XMM5, XMM5, XMM13
+ MOVOU 2*16(SI), X6
+ LONG $0x0049c2c4; BYTE $0xf5 // VPSHUFB XMM6, XMM6, XMM13
+ MOVOU 3*16(SI), X7
+ LONG $0x0041c2c4; BYTE $0xfd // VPSHUFB XMM7, XMM7, XMM13
+
+ MOVQ SI, reserved3+72(FP)
+ MOVD $0x3, DI
+
+ // schedule 48 input dwords, by doing 3 rounds of 16 each
+loop1:
+ LONG $0x4dfe59c5; BYTE $0x00 // VPADDD XMM9, XMM4, 0[RBP] /* Add 1st constant to first part of message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(AX, BX, CX, R8, DX, R9, R10, R11)
+
+ LONG $0x4dfe59c5; BYTE $0x10 // VPADDD XMM9, XMM4, 16[RBP] /* Add 2nd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(DX, R9, R10, R11, AX, BX, CX, R8)
+
+ LONG $0x4dfe59c5; BYTE $0x20 // VPADDD XMM9, XMM4, 32[RBP] /* Add 3rd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(AX, BX, CX, R8, DX, R9, R10, R11)
+
+ LONG $0x4dfe59c5; BYTE $0x30 // VPADDD XMM9, XMM4, 48[RBP] /* Add 4th constant to message */
+ MOVOU X9, reserved0+48(FP)
+ ADDQ $64, BP
+ FOUR_ROUNDS_AND_SCHED(DX, R9, R10, R11, AX, BX, CX, R8)
+
+ SUBQ $1, DI
+ JNE loop1
+
+ MOVD $0x2, DI
+
+loop2:
+ LONG $0x4dfe59c5; BYTE $0x00 // VPADDD XMM9, XMM4, 0[RBP] /* Add 1st constant to first part of message */
+ MOVOU X9, reserved0+48(FP)
+ DO_ROUND( AX, BX, CX, R8, DX, R9, R10, R11, 48)
+ DO_ROUND(R11, AX, BX, CX, R8, DX, R9, R10, 52)
+ DO_ROUND(R10, R11, AX, BX, CX, R8, DX, R9, 56)
+ DO_ROUND( R9, R10, R11, AX, BX, CX, R8, DX, 60)
+
+ LONG $0x4dfe51c5; BYTE $0x10 // VPADDD XMM9, XMM5, 16[RBP] /* Add 2nd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ ADDQ $32, BP
+ DO_ROUND( DX, R9, R10, R11, AX, BX, CX, R8, 48)
+ DO_ROUND( R8, DX, R9, R10, R11, AX, BX, CX, 52)
+ DO_ROUND( CX, R8, DX, R9, R10, R11, AX, BX, 56)
+ DO_ROUND( BX, CX, R8, DX, R9, R10, R11, AX, 60)
+
+ MOVOU X6, X4
+ MOVOU X7, X5
+
+ SUBQ $1, DI
+ JNE loop2
+
+ MOVQ h+0(FP), SI // SI: &h
+ ADDL (0*4)(SI), AX // H0 = a + H0
+ MOVL AX, (0*4)(SI)
+ ADDL (1*4)(SI), BX // H1 = b + H1
+ MOVL BX, (1*4)(SI)
+ ADDL (2*4)(SI), CX // H2 = c + H2
+ MOVL CX, (2*4)(SI)
+ ADDL (3*4)(SI), R8 // H3 = d + H3
+ MOVL R8, (3*4)(SI)
+ ADDL (4*4)(SI), DX // H4 = e + H4
+ MOVL DX, (4*4)(SI)
+ ADDL (5*4)(SI), R9 // H5 = f + H5
+ MOVL R9, (5*4)(SI)
+ ADDL (6*4)(SI), R10 // H6 = g + H6
+ MOVL R10, (6*4)(SI)
+ ADDL (7*4)(SI), R11 // H7 = h + H7
+ MOVL R11, (7*4)(SI)
+
+ MOVQ reserved3+72(FP), SI
+ ADDQ $64, SI
+ CMPQ reserved2+64(FP), SI
+ JNE loop0
+
+done_hash:
+ RET
+
+// Constants table
+DATA constants<>+0x0(SB)/8, $0x71374491428a2f98
+DATA constants<>+0x8(SB)/8, $0xe9b5dba5b5c0fbcf
+DATA constants<>+0x10(SB)/8, $0x59f111f13956c25b
+DATA constants<>+0x18(SB)/8, $0xab1c5ed5923f82a4
+DATA constants<>+0x20(SB)/8, $0x12835b01d807aa98
+DATA constants<>+0x28(SB)/8, $0x550c7dc3243185be
+DATA constants<>+0x30(SB)/8, $0x80deb1fe72be5d74
+DATA constants<>+0x38(SB)/8, $0xc19bf1749bdc06a7
+DATA constants<>+0x40(SB)/8, $0xefbe4786e49b69c1
+DATA constants<>+0x48(SB)/8, $0x240ca1cc0fc19dc6
+DATA constants<>+0x50(SB)/8, $0x4a7484aa2de92c6f
+DATA constants<>+0x58(SB)/8, $0x76f988da5cb0a9dc
+DATA constants<>+0x60(SB)/8, $0xa831c66d983e5152
+DATA constants<>+0x68(SB)/8, $0xbf597fc7b00327c8
+DATA constants<>+0x70(SB)/8, $0xd5a79147c6e00bf3
+DATA constants<>+0x78(SB)/8, $0x1429296706ca6351
+DATA constants<>+0x80(SB)/8, $0x2e1b213827b70a85
+DATA constants<>+0x88(SB)/8, $0x53380d134d2c6dfc
+DATA constants<>+0x90(SB)/8, $0x766a0abb650a7354
+DATA constants<>+0x98(SB)/8, $0x92722c8581c2c92e
+DATA constants<>+0xa0(SB)/8, $0xa81a664ba2bfe8a1
+DATA constants<>+0xa8(SB)/8, $0xc76c51a3c24b8b70
+DATA constants<>+0xb0(SB)/8, $0xd6990624d192e819
+DATA constants<>+0xb8(SB)/8, $0x106aa070f40e3585
+DATA constants<>+0xc0(SB)/8, $0x1e376c0819a4c116
+DATA constants<>+0xc8(SB)/8, $0x34b0bcb52748774c
+DATA constants<>+0xd0(SB)/8, $0x4ed8aa4a391c0cb3
+DATA constants<>+0xd8(SB)/8, $0x682e6ff35b9cca4f
+DATA constants<>+0xe0(SB)/8, $0x78a5636f748f82ee
+DATA constants<>+0xe8(SB)/8, $0x8cc7020884c87814
+DATA constants<>+0xf0(SB)/8, $0xa4506ceb90befffa
+DATA constants<>+0xf8(SB)/8, $0xc67178f2bef9a3f7
+
+DATA bflipMask<>+0x00(SB)/8, $0x0405060700010203
+DATA bflipMask<>+0x08(SB)/8, $0x0c0d0e0f08090a0b
+
+DATA shuf00BA<>+0x00(SB)/8, $0x0b0a090803020100
+DATA shuf00BA<>+0x08(SB)/8, $0xFFFFFFFFFFFFFFFF
+
+DATA shufDC00<>+0x00(SB)/8, $0xFFFFFFFFFFFFFFFF
+DATA shufDC00<>+0x08(SB)/8, $0x0b0a090803020100
+
+GLOBL constants<>(SB), 8, $256
+GLOBL bflipMask<>(SB), (NOPTR+RODATA), $16
+GLOBL shuf00BA<>(SB), (NOPTR+RODATA), $16
+GLOBL shufDC00<>(SB), (NOPTR+RODATA), $16
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go
new file mode 100644
index 0000000000..483689ef0f
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.go
@@ -0,0 +1,6 @@
+//+build !noasm,!appengine
+
+package sha256
+
+//go:noescape
+func blockSha(h *[8]uint32, message []uint8)
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s
new file mode 100644
index 0000000000..909fc0ef85
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockSha_amd64.s
@@ -0,0 +1,266 @@
+//+build !noasm,!appengine
+
+// SHA intrinsic version of SHA256
+
+// Kristofer Peterson, (C) 2018.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "textflag.h"
+
+DATA K<>+0x00(SB)/4, $0x428a2f98
+DATA K<>+0x04(SB)/4, $0x71374491
+DATA K<>+0x08(SB)/4, $0xb5c0fbcf
+DATA K<>+0x0c(SB)/4, $0xe9b5dba5
+DATA K<>+0x10(SB)/4, $0x3956c25b
+DATA K<>+0x14(SB)/4, $0x59f111f1
+DATA K<>+0x18(SB)/4, $0x923f82a4
+DATA K<>+0x1c(SB)/4, $0xab1c5ed5
+DATA K<>+0x20(SB)/4, $0xd807aa98
+DATA K<>+0x24(SB)/4, $0x12835b01
+DATA K<>+0x28(SB)/4, $0x243185be
+DATA K<>+0x2c(SB)/4, $0x550c7dc3
+DATA K<>+0x30(SB)/4, $0x72be5d74
+DATA K<>+0x34(SB)/4, $0x80deb1fe
+DATA K<>+0x38(SB)/4, $0x9bdc06a7
+DATA K<>+0x3c(SB)/4, $0xc19bf174
+DATA K<>+0x40(SB)/4, $0xe49b69c1
+DATA K<>+0x44(SB)/4, $0xefbe4786
+DATA K<>+0x48(SB)/4, $0x0fc19dc6
+DATA K<>+0x4c(SB)/4, $0x240ca1cc
+DATA K<>+0x50(SB)/4, $0x2de92c6f
+DATA K<>+0x54(SB)/4, $0x4a7484aa
+DATA K<>+0x58(SB)/4, $0x5cb0a9dc
+DATA K<>+0x5c(SB)/4, $0x76f988da
+DATA K<>+0x60(SB)/4, $0x983e5152
+DATA K<>+0x64(SB)/4, $0xa831c66d
+DATA K<>+0x68(SB)/4, $0xb00327c8
+DATA K<>+0x6c(SB)/4, $0xbf597fc7
+DATA K<>+0x70(SB)/4, $0xc6e00bf3
+DATA K<>+0x74(SB)/4, $0xd5a79147
+DATA K<>+0x78(SB)/4, $0x06ca6351
+DATA K<>+0x7c(SB)/4, $0x14292967
+DATA K<>+0x80(SB)/4, $0x27b70a85
+DATA K<>+0x84(SB)/4, $0x2e1b2138
+DATA K<>+0x88(SB)/4, $0x4d2c6dfc
+DATA K<>+0x8c(SB)/4, $0x53380d13
+DATA K<>+0x90(SB)/4, $0x650a7354
+DATA K<>+0x94(SB)/4, $0x766a0abb
+DATA K<>+0x98(SB)/4, $0x81c2c92e
+DATA K<>+0x9c(SB)/4, $0x92722c85
+DATA K<>+0xa0(SB)/4, $0xa2bfe8a1
+DATA K<>+0xa4(SB)/4, $0xa81a664b
+DATA K<>+0xa8(SB)/4, $0xc24b8b70
+DATA K<>+0xac(SB)/4, $0xc76c51a3
+DATA K<>+0xb0(SB)/4, $0xd192e819
+DATA K<>+0xb4(SB)/4, $0xd6990624
+DATA K<>+0xb8(SB)/4, $0xf40e3585
+DATA K<>+0xbc(SB)/4, $0x106aa070
+DATA K<>+0xc0(SB)/4, $0x19a4c116
+DATA K<>+0xc4(SB)/4, $0x1e376c08
+DATA K<>+0xc8(SB)/4, $0x2748774c
+DATA K<>+0xcc(SB)/4, $0x34b0bcb5
+DATA K<>+0xd0(SB)/4, $0x391c0cb3
+DATA K<>+0xd4(SB)/4, $0x4ed8aa4a
+DATA K<>+0xd8(SB)/4, $0x5b9cca4f
+DATA K<>+0xdc(SB)/4, $0x682e6ff3
+DATA K<>+0xe0(SB)/4, $0x748f82ee
+DATA K<>+0xe4(SB)/4, $0x78a5636f
+DATA K<>+0xe8(SB)/4, $0x84c87814
+DATA K<>+0xec(SB)/4, $0x8cc70208
+DATA K<>+0xf0(SB)/4, $0x90befffa
+DATA K<>+0xf4(SB)/4, $0xa4506ceb
+DATA K<>+0xf8(SB)/4, $0xbef9a3f7
+DATA K<>+0xfc(SB)/4, $0xc67178f2
+GLOBL K<>(SB), RODATA|NOPTR, $256
+
+DATA SHUF_MASK<>+0x00(SB)/8, $0x0405060700010203
+DATA SHUF_MASK<>+0x08(SB)/8, $0x0c0d0e0f08090a0b
+GLOBL SHUF_MASK<>(SB), RODATA|NOPTR, $16
+
+// Register Usage
+// BX base address of constant table (constant)
+// DX hash_state (constant)
+// SI hash_data.data
+// DI hash_data.data + hash_data.length - 64 (constant)
+// X0 scratch
+// X1 scratch
+// X2 working hash state // ABEF
+// X3 working hash state // CDGH
+// X4 first 16 bytes of block
+// X5 second 16 bytes of block
+// X6 third 16 bytes of block
+// X7 fourth 16 bytes of block
+// X12 saved hash state // ABEF
+// X13 saved hash state // CDGH
+// X15 data shuffle mask (constant)
+
+TEXT ·blockSha(SB), NOSPLIT, $0-32
+ MOVQ h+0(FP), DX
+ MOVQ message_base+8(FP), SI
+ MOVQ message_len+16(FP), DI
+ LEAQ -64(SI)(DI*1), DI
+ MOVOU (DX), X2
+ MOVOU 16(DX), X1
+ MOVO X2, X3
+ PUNPCKLLQ X1, X2
+ PUNPCKHLQ X1, X3
+ PSHUFD $0x27, X2, X2
+ PSHUFD $0x27, X3, X3
+ MOVO SHUF_MASK<>(SB), X15
+ LEAQ K<>(SB), BX
+
+ JMP TEST
+
+LOOP:
+ MOVO X2, X12
+ MOVO X3, X13
+
+ // load block and shuffle
+ MOVOU (SI), X4
+ MOVOU 16(SI), X5
+ MOVOU 32(SI), X6
+ MOVOU 48(SI), X7
+ PSHUFB X15, X4
+ PSHUFB X15, X5
+ PSHUFB X15, X6
+ PSHUFB X15, X7
+
+#define ROUND456 \
+ PADDL X5, X0 \
+ LONG $0xdacb380f \ // SHA256RNDS2 XMM3, XMM2
+ MOVO X5, X1 \
+ LONG $0x0f3a0f66; WORD $0x04cc \ // PALIGNR XMM1, XMM4, 4
+ PADDL X1, X6 \
+ LONG $0xf5cd380f \ // SHA256MSG2 XMM6, XMM5
+ PSHUFD $0x4e, X0, X0 \
+ LONG $0xd3cb380f \ // SHA256RNDS2 XMM2, XMM3
+ LONG $0xe5cc380f // SHA256MSG1 XMM4, XMM5
+
+#define ROUND567 \
+ PADDL X6, X0 \
+ LONG $0xdacb380f \ // SHA256RNDS2 XMM3, XMM2
+ MOVO X6, X1 \
+ LONG $0x0f3a0f66; WORD $0x04cd \ // PALIGNR XMM1, XMM5, 4
+ PADDL X1, X7 \
+ LONG $0xfecd380f \ // SHA256MSG2 XMM7, XMM6
+ PSHUFD $0x4e, X0, X0 \
+ LONG $0xd3cb380f \ // SHA256RNDS2 XMM2, XMM3
+ LONG $0xeecc380f // SHA256MSG1 XMM5, XMM6
+
+#define ROUND674 \
+ PADDL X7, X0 \
+ LONG $0xdacb380f \ // SHA256RNDS2 XMM3, XMM2
+ MOVO X7, X1 \
+ LONG $0x0f3a0f66; WORD $0x04ce \ // PALIGNR XMM1, XMM6, 4
+ PADDL X1, X4 \
+ LONG $0xe7cd380f \ // SHA256MSG2 XMM4, XMM7
+ PSHUFD $0x4e, X0, X0 \
+ LONG $0xd3cb380f \ // SHA256RNDS2 XMM2, XMM3
+ LONG $0xf7cc380f // SHA256MSG1 XMM6, XMM7
+
+#define ROUND745 \
+ PADDL X4, X0 \
+ LONG $0xdacb380f \ // SHA256RNDS2 XMM3, XMM2
+ MOVO X4, X1 \
+ LONG $0x0f3a0f66; WORD $0x04cf \ // PALIGNR XMM1, XMM7, 4
+ PADDL X1, X5 \
+ LONG $0xeccd380f \ // SHA256MSG2 XMM5, XMM4
+ PSHUFD $0x4e, X0, X0 \
+ LONG $0xd3cb380f \ // SHA256RNDS2 XMM2, XMM3
+ LONG $0xfccc380f // SHA256MSG1 XMM7, XMM4
+
+ // rounds 0-3
+ MOVO (BX), X0
+ PADDL X4, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+
+ // rounds 4-7
+ MOVO 1*16(BX), X0
+ PADDL X5, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+ LONG $0xe5cc380f // SHA256MSG1 XMM4, XMM5
+
+ // rounds 8-11
+ MOVO 2*16(BX), X0
+ PADDL X6, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+ LONG $0xeecc380f // SHA256MSG1 XMM5, XMM6
+
+ MOVO 3*16(BX), X0; ROUND674 // rounds 12-15
+ MOVO 4*16(BX), X0; ROUND745 // rounds 16-19
+ MOVO 5*16(BX), X0; ROUND456 // rounds 20-23
+ MOVO 6*16(BX), X0; ROUND567 // rounds 24-27
+ MOVO 7*16(BX), X0; ROUND674 // rounds 28-31
+ MOVO 8*16(BX), X0; ROUND745 // rounds 32-35
+ MOVO 9*16(BX), X0; ROUND456 // rounds 36-39
+ MOVO 10*16(BX), X0; ROUND567 // rounds 40-43
+ MOVO 11*16(BX), X0; ROUND674 // rounds 44-47
+ MOVO 12*16(BX), X0; ROUND745 // rounds 48-51
+
+ // rounds 52-55
+ MOVO 13*16(BX), X0
+ PADDL X5, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ MOVO X5, X1
+ LONG $0x0f3a0f66; WORD $0x04cc // PALIGNR XMM1, XMM4, 4
+ PADDL X1, X6
+ LONG $0xf5cd380f // SHA256MSG2 XMM6, XMM5
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+
+ // rounds 56-59
+ MOVO 14*16(BX), X0
+ PADDL X6, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ MOVO X6, X1
+ LONG $0x0f3a0f66; WORD $0x04cd // PALIGNR XMM1, XMM5, 4
+ PADDL X1, X7
+ LONG $0xfecd380f // SHA256MSG2 XMM7, XMM6
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+
+ // rounds 60-63
+ MOVO 15*16(BX), X0
+ PADDL X7, X0
+ LONG $0xdacb380f // SHA256RNDS2 XMM3, XMM2
+ PSHUFD $0x4e, X0, X0
+ LONG $0xd3cb380f // SHA256RNDS2 XMM2, XMM3
+
+ PADDL X12, X2
+ PADDL X13, X3
+
+ ADDQ $64, SI
+
+TEST:
+ CMPQ SI, DI
+ JBE LOOP
+
+ PSHUFD $0x4e, X3, X0
+ LONG $0x0e3a0f66; WORD $0xf0c2 // PBLENDW XMM0, XMM2, 0xf0
+ PSHUFD $0x4e, X2, X1
+ LONG $0x0e3a0f66; WORD $0x0fcb // PBLENDW XMM1, XMM3, 0x0f
+ PSHUFD $0x1b, X0, X0
+ PSHUFD $0x1b, X1, X1
+
+ MOVOU X0, (DX)
+ MOVOU X1, 16(DX)
+
+ RET
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.go b/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.go
new file mode 100644
index 0000000000..1ae2320bd5
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.go
@@ -0,0 +1,22 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+//go:noescape
+func blockSsse(h []uint32, message []uint8, reserved0, reserved1, reserved2, reserved3 uint64)
diff --git a/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.s b/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.s
new file mode 100644
index 0000000000..7afb45c87f
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256blockSsse_amd64.s
@@ -0,0 +1,429 @@
+//+build !noasm,!appengine
+
+// SHA256 implementation for SSSE3
+
+//
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// This code is based on an Intel White-Paper:
+// "Fast SHA-256 Implementations on Intel Architecture Processors"
+//
+// together with the reference implementation from the following authors:
+// James Guilford
+// Kirk Yap
+// Tim Chen
+//
+// For Golang it has been converted to Plan 9 assembly with the help of
+// github.com/minio/asm2plan9s to assemble Intel instructions to their Plan9
+// equivalents
+//
+
+#include "textflag.h"
+
+#define ROTATE_XS \
+ MOVOU X4, X15 \
+ MOVOU X5, X4 \
+ MOVOU X6, X5 \
+ MOVOU X7, X6 \
+ MOVOU X15, X7
+
+// compute s0 four at a time and s1 two at a time
+// compute W[-16] + W[-7] 4 at a time
+#define FOUR_ROUNDS_AND_SCHED(a, b, c, d, e, f, g, h) \
+ MOVL e, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL a, R14 \ // y1 = a
+ MOVOU X7, X0 \
+ LONG $0x0f3a0f66; WORD $0x04c6 \ // PALIGNR XMM0,XMM6,0x4 /* XTMP0 = W[-7] */
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ XORL e, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL f, R15 \ // y2 = f
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL a, R14 \ // y1 = a ^ (a >> (22-13)
+ XORL g, R15 \ // y2 = f^g
+ LONG $0xc4fe0f66 \ // PADDD XMM0,XMM4 /* XTMP0 = W[-7] + W[-16] */
+ XORL e, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6) )
+ ANDL e, R15 \ // y2 = (f^g)&e
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ \
+ \ // compute s0
+ \
+ MOVOU X5, X1 \
+ LONG $0x0f3a0f66; WORD $0x04cc \ // PALIGNR XMM1,XMM4,0x4 /* XTMP1 = W[-15] */
+ XORL a, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL g, R15 \ // y2 = CH = ((f^g)&e)^g
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+48(FP), R15 \ // y2 = k + w + S1 + CH
+ MOVL a, R13 \ // y0 = a
+ ADDL R15, h \ // h = h + S1 + CH + k + w
+ \ // ROTATE_ARGS
+ MOVL a, R15 \ // y2 = a
+ MOVOU X1, X2 \
+ LONG $0xd2720f66; BYTE $0x07 \ // PSRLD XMM2,0x7 /* */
+ ORL c, R13 \ // y0 = a|c
+ ADDL h, d \ // d = d + h + S1 + CH + k + w
+ ANDL c, R15 \ // y2 = a&c
+ MOVOU X1, X3 \
+ LONG $0xf3720f66; BYTE $0x19 \ // PSLLD XMM3,0x19 /* */
+ ANDL b, R13 \ // y0 = (a|c)&b
+ ADDL R14, h \ // h = h + S1 + CH + k + w + S0
+ LONG $0xdaeb0f66 \ // POR XMM3,XMM2 /* XTMP1 = W[-15] MY_ROR 7 */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, h \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL d, R13 \ // y0 = e
+ MOVL h, R14 \ // y1 = a
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ XORL d, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL e, R15 \ // y2 = f
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ MOVOU X1, X2 \
+ LONG $0xd2720f66; BYTE $0x12 \ // PSRLD XMM2,0x12 /* */
+ XORL h, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL f, R15 \ // y2 = f^g
+ MOVOU X1, X8 \
+ LONG $0x720f4166; WORD $0x03d0 \ // PSRLD XMM8,0x3 /* XTMP4 = W[-15] >> 3 */
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ XORL d, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL d, R15 \ // y2 = (f^g)&e
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ LONG $0xf1720f66; BYTE $0x0e \ // PSLLD XMM1,0xe /* */
+ XORL h, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ XORL f, R15 \ // y2 = CH = ((f^g)&e)^g
+ LONG $0xd9ef0f66 \ // PXOR XMM3,XMM1 /* */
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+52(FP), R15 \ // y2 = k + w + S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ LONG $0xdaef0f66 \ // PXOR XMM3,XMM2 /* XTMP1 = W[-15] MY_ROR 7 ^ W[-15] MY_ROR */
+ MOVL h, R13 \ // y0 = a
+ ADDL R15, g \ // h = h + S1 + CH + k + w
+ MOVL h, R15 \ // y2 = a
+ MOVOU X3, X1 \
+ LONG $0xef0f4166; BYTE $0xc8 \ // PXOR XMM1,XMM8 /* XTMP1 = s0 */
+ ORL b, R13 \ // y0 = a|c
+ ADDL g, c \ // d = d + h + S1 + CH + k + w
+ ANDL b, R15 \ // y2 = a&c
+ \
+ \ // compute low s1
+ \
+ LONG $0xd7700f66; BYTE $0xfa \ // PSHUFD XMM2,XMM7,0xfa /* XTMP2 = W[-2] {BBAA} */
+ ANDL a, R13 \ // y0 = (a|c)&b
+ ADDL R14, g \ // h = h + S1 + CH + k + w + S0
+ LONG $0xc1fe0f66 \ // PADDD XMM0,XMM1 /* XTMP0 = W[-16] + W[-7] + s0 */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, g \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL c, R13 \ // y0 = e
+ MOVL g, R14 \ // y1 = a
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ XORL c, R13 \ // y0 = e ^ (e >> (25-11))
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ MOVL d, R15 \ // y2 = f
+ XORL g, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ MOVOU X2, X8 \
+ LONG $0x720f4166; WORD $0x0ad0 \ // PSRLD XMM8,0xa /* XTMP4 = W[-2] >> 10 {BBAA} */
+ XORL e, R15 \ // y2 = f^g
+ MOVOU X2, X3 \
+ LONG $0xd3730f66; BYTE $0x13 \ // PSRLQ XMM3,0x13 /* XTMP3 = W[-2] MY_ROR 19 {xBxA} */
+ XORL c, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL c, R15 \ // y2 = (f^g)&e
+ LONG $0xd2730f66; BYTE $0x11 \ // PSRLQ XMM2,0x11 /* XTMP2 = W[-2] MY_ROR 17 {xBxA} */
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ XORL g, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ XORL e, R15 \ // y2 = CH = ((f^g)&e)^g
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ LONG $0xd3ef0f66 \ // PXOR XMM2,XMM3 /* */
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL _xfer+56(FP), R15 \ // y2 = k + w + S1 + CH
+ LONG $0xef0f4466; BYTE $0xc2 \ // PXOR XMM8,XMM2 /* XTMP4 = s1 {xBxA} */
+ MOVL g, R13 \ // y0 = a
+ ADDL R15, f \ // h = h + S1 + CH + k + w
+ MOVL g, R15 \ // y2 = a
+ LONG $0x380f4566; WORD $0xc200 \ // PSHUFB XMM8,XMM10 /* XTMP4 = s1 {00BA} */
+ ORL a, R13 \ // y0 = a|c
+ ADDL f, b \ // d = d + h + S1 + CH + k + w
+ ANDL a, R15 \ // y2 = a&c
+ LONG $0xfe0f4166; BYTE $0xc0 \ // PADDD XMM0,XMM8 /* XTMP0 = {..., ..., W[1], W[0]} */
+ ANDL h, R13 \ // y0 = (a|c)&b
+ ADDL R14, f \ // h = h + S1 + CH + k + w + S0
+ \
+ \ // compute high s1
+ \
+ LONG $0xd0700f66; BYTE $0x50 \ // PSHUFD XMM2,XMM0,0x50 /* XTMP2 = W[-2] {DDCC} */
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, f \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ MOVL b, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL f, R14 \ // y1 = a
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ XORL b, R13 \ // y0 = e ^ (e >> (25-11))
+ MOVL c, R15 \ // y2 = f
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ MOVOU X2, X11 \
+ LONG $0x720f4166; WORD $0x0ad3 \ // PSRLD XMM11,0xa /* XTMP5 = W[-2] >> 10 {DDCC} */
+ XORL f, R14 \ // y1 = a ^ (a >> (22-13)
+ XORL d, R15 \ // y2 = f^g
+ MOVOU X2, X3 \
+ LONG $0xd3730f66; BYTE $0x13 \ // PSRLQ XMM3,0x13 /* XTMP3 = W[-2] MY_ROR 19 {xDxC} */
+ XORL b, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ANDL b, R15 \ // y2 = (f^g)&e
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ LONG $0xd2730f66; BYTE $0x11 \ // PSRLQ XMM2,0x11 /* XTMP2 = W[-2] MY_ROR 17 {xDxC} */
+ XORL f, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL d, R15 \ // y2 = CH = ((f^g)&e)^g
+ LONG $0xd3ef0f66 \ // PXOR XMM2,XMM3 /* */
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ADDL _xfer+60(FP), R15 \ // y2 = k + w + S1 + CH
+ LONG $0xef0f4466; BYTE $0xda \ // PXOR XMM11,XMM2 /* XTMP5 = s1 {xDxC} */
+ MOVL f, R13 \ // y0 = a
+ ADDL R15, e \ // h = h + S1 + CH + k + w
+ MOVL f, R15 \ // y2 = a
+ LONG $0x380f4566; WORD $0xdc00 \ // PSHUFB XMM11,XMM12 /* XTMP5 = s1 {DC00} */
+ ORL h, R13 \ // y0 = a|c
+ ADDL e, a \ // d = d + h + S1 + CH + k + w
+ ANDL h, R15 \ // y2 = a&c
+ MOVOU X11, X4 \
+ LONG $0xe0fe0f66 \ // PADDD XMM4,XMM0 /* X0 = {W[3], W[2], W[1], W[0]} */
+ ANDL g, R13 \ // y0 = (a|c)&b
+ ADDL R14, e \ // h = h + S1 + CH + k + w + S0
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, e \ // h = h + S1 + CH + k + w + S0 + MAJ
+ \ // ROTATE_ARGS
+ ROTATE_XS
+
+#define DO_ROUND(a, b, c, d, e, f, g, h, offset) \
+ MOVL e, R13 \ // y0 = e
+ ROLL $18, R13 \ // y0 = e >> (25-11)
+ MOVL a, R14 \ // y1 = a
+ XORL e, R13 \ // y0 = e ^ (e >> (25-11))
+ ROLL $23, R14 \ // y1 = a >> (22-13)
+ MOVL f, R15 \ // y2 = f
+ XORL a, R14 \ // y1 = a ^ (a >> (22-13)
+ ROLL $27, R13 \ // y0 = (e >> (11-6)) ^ (e >> (25-6))
+ XORL g, R15 \ // y2 = f^g
+ XORL e, R13 \ // y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
+ ROLL $21, R14 \ // y1 = (a >> (13-2)) ^ (a >> (22-2))
+ ANDL e, R15 \ // y2 = (f^g)&e
+ XORL a, R14 \ // y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
+ ROLL $26, R13 \ // y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
+ XORL g, R15 \ // y2 = CH = ((f^g)&e)^g
+ ADDL R13, R15 \ // y2 = S1 + CH
+ ROLL $30, R14 \ // y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
+ ADDL _xfer+offset(FP), R15 \ // y2 = k + w + S1 + CH
+ MOVL a, R13 \ // y0 = a
+ ADDL R15, h \ // h = h + S1 + CH + k + w
+ MOVL a, R15 \ // y2 = a
+ ORL c, R13 \ // y0 = a|c
+ ADDL h, d \ // d = d + h + S1 + CH + k + w
+ ANDL c, R15 \ // y2 = a&c
+ ANDL b, R13 \ // y0 = (a|c)&b
+ ADDL R14, h \ // h = h + S1 + CH + k + w + S0
+ ORL R15, R13 \ // y0 = MAJ = (a|c)&b)|(a&c)
+ ADDL R13, h // h = h + S1 + CH + k + w + S0 + MAJ
+
+// func blockSsse(h []uint32, message []uint8, reserved0, reserved1, reserved2, reserved3 uint64)
+TEXT ·blockSsse(SB), 7, $0-80
+
+ MOVQ h+0(FP), SI // SI: &h
+ MOVQ message_base+24(FP), R8 // &message
+ MOVQ message_len+32(FP), R9 // length of message
+ CMPQ R9, $0
+ JEQ done_hash
+ ADDQ R8, R9
+ MOVQ R9, reserved2+64(FP) // store end of message
+
+ // Register definition
+ // a --> eax
+ // b --> ebx
+ // c --> ecx
+ // d --> r8d
+ // e --> edx
+ // f --> r9d
+ // g --> r10d
+ // h --> r11d
+ //
+ // y0 --> r13d
+ // y1 --> r14d
+ // y2 --> r15d
+
+ MOVL (0*4)(SI), AX // a = H0
+ MOVL (1*4)(SI), BX // b = H1
+ MOVL (2*4)(SI), CX // c = H2
+ MOVL (3*4)(SI), R8 // d = H3
+ MOVL (4*4)(SI), DX // e = H4
+ MOVL (5*4)(SI), R9 // f = H5
+ MOVL (6*4)(SI), R10 // g = H6
+ MOVL (7*4)(SI), R11 // h = H7
+
+ MOVOU bflipMask<>(SB), X13
+ MOVOU shuf00BA<>(SB), X10 // shuffle xBxA -> 00BA
+ MOVOU shufDC00<>(SB), X12 // shuffle xDxC -> DC00
+
+ MOVQ message_base+24(FP), SI // SI: &message
+
+loop0:
+ LEAQ constants<>(SB), BP
+
+ // byte swap first 16 dwords
+ MOVOU 0*16(SI), X4
+ LONG $0x380f4166; WORD $0xe500 // PSHUFB XMM4, XMM13
+ MOVOU 1*16(SI), X5
+ LONG $0x380f4166; WORD $0xed00 // PSHUFB XMM5, XMM13
+ MOVOU 2*16(SI), X6
+ LONG $0x380f4166; WORD $0xf500 // PSHUFB XMM6, XMM13
+ MOVOU 3*16(SI), X7
+ LONG $0x380f4166; WORD $0xfd00 // PSHUFB XMM7, XMM13
+
+ MOVQ SI, reserved3+72(FP)
+ MOVD $0x3, DI
+
+ // Align
+ // nop WORD PTR [rax+rax*1+0x0]
+
+ // schedule 48 input dwords, by doing 3 rounds of 16 each
+loop1:
+ MOVOU X4, X9
+ LONG $0xfe0f4466; WORD $0x004d // PADDD XMM9, 0[RBP] /* Add 1st constant to first part of message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(AX, BX, CX, R8, DX, R9, R10, R11)
+
+ MOVOU X4, X9
+ LONG $0xfe0f4466; WORD $0x104d // PADDD XMM9, 16[RBP] /* Add 2nd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(DX, R9, R10, R11, AX, BX, CX, R8)
+
+ MOVOU X4, X9
+ LONG $0xfe0f4466; WORD $0x204d // PADDD XMM9, 32[RBP] /* Add 3rd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ FOUR_ROUNDS_AND_SCHED(AX, BX, CX, R8, DX, R9, R10, R11)
+
+ MOVOU X4, X9
+ LONG $0xfe0f4466; WORD $0x304d // PADDD XMM9, 48[RBP] /* Add 4th constant to message */
+ MOVOU X9, reserved0+48(FP)
+ ADDQ $64, BP
+ FOUR_ROUNDS_AND_SCHED(DX, R9, R10, R11, AX, BX, CX, R8)
+
+ SUBQ $1, DI
+ JNE loop1
+
+ MOVD $0x2, DI
+
+loop2:
+ MOVOU X4, X9
+ LONG $0xfe0f4466; WORD $0x004d // PADDD XMM9, 0[RBP] /* Add 1st constant to first part of message */
+ MOVOU X9, reserved0+48(FP)
+ DO_ROUND( AX, BX, CX, R8, DX, R9, R10, R11, 48)
+ DO_ROUND(R11, AX, BX, CX, R8, DX, R9, R10, 52)
+ DO_ROUND(R10, R11, AX, BX, CX, R8, DX, R9, 56)
+ DO_ROUND( R9, R10, R11, AX, BX, CX, R8, DX, 60)
+
+ MOVOU X5, X9
+ LONG $0xfe0f4466; WORD $0x104d // PADDD XMM9, 16[RBP] /* Add 2nd constant to message */
+ MOVOU X9, reserved0+48(FP)
+ ADDQ $32, BP
+ DO_ROUND( DX, R9, R10, R11, AX, BX, CX, R8, 48)
+ DO_ROUND( R8, DX, R9, R10, R11, AX, BX, CX, 52)
+ DO_ROUND( CX, R8, DX, R9, R10, R11, AX, BX, 56)
+ DO_ROUND( BX, CX, R8, DX, R9, R10, R11, AX, 60)
+
+ MOVOU X6, X4
+ MOVOU X7, X5
+
+ SUBQ $1, DI
+ JNE loop2
+
+ MOVQ h+0(FP), SI // SI: &h
+ ADDL (0*4)(SI), AX // H0 = a + H0
+ MOVL AX, (0*4)(SI)
+ ADDL (1*4)(SI), BX // H1 = b + H1
+ MOVL BX, (1*4)(SI)
+ ADDL (2*4)(SI), CX // H2 = c + H2
+ MOVL CX, (2*4)(SI)
+ ADDL (3*4)(SI), R8 // H3 = d + H3
+ MOVL R8, (3*4)(SI)
+ ADDL (4*4)(SI), DX // H4 = e + H4
+ MOVL DX, (4*4)(SI)
+ ADDL (5*4)(SI), R9 // H5 = f + H5
+ MOVL R9, (5*4)(SI)
+ ADDL (6*4)(SI), R10 // H6 = g + H6
+ MOVL R10, (6*4)(SI)
+ ADDL (7*4)(SI), R11 // H7 = h + H7
+ MOVL R11, (7*4)(SI)
+
+ MOVQ reserved3+72(FP), SI
+ ADDQ $64, SI
+ CMPQ reserved2+64(FP), SI
+ JNE loop0
+
+done_hash:
+ RET
+
+// Constants table
+DATA constants<>+0x0(SB)/8, $0x71374491428a2f98
+DATA constants<>+0x8(SB)/8, $0xe9b5dba5b5c0fbcf
+DATA constants<>+0x10(SB)/8, $0x59f111f13956c25b
+DATA constants<>+0x18(SB)/8, $0xab1c5ed5923f82a4
+DATA constants<>+0x20(SB)/8, $0x12835b01d807aa98
+DATA constants<>+0x28(SB)/8, $0x550c7dc3243185be
+DATA constants<>+0x30(SB)/8, $0x80deb1fe72be5d74
+DATA constants<>+0x38(SB)/8, $0xc19bf1749bdc06a7
+DATA constants<>+0x40(SB)/8, $0xefbe4786e49b69c1
+DATA constants<>+0x48(SB)/8, $0x240ca1cc0fc19dc6
+DATA constants<>+0x50(SB)/8, $0x4a7484aa2de92c6f
+DATA constants<>+0x58(SB)/8, $0x76f988da5cb0a9dc
+DATA constants<>+0x60(SB)/8, $0xa831c66d983e5152
+DATA constants<>+0x68(SB)/8, $0xbf597fc7b00327c8
+DATA constants<>+0x70(SB)/8, $0xd5a79147c6e00bf3
+DATA constants<>+0x78(SB)/8, $0x1429296706ca6351
+DATA constants<>+0x80(SB)/8, $0x2e1b213827b70a85
+DATA constants<>+0x88(SB)/8, $0x53380d134d2c6dfc
+DATA constants<>+0x90(SB)/8, $0x766a0abb650a7354
+DATA constants<>+0x98(SB)/8, $0x92722c8581c2c92e
+DATA constants<>+0xa0(SB)/8, $0xa81a664ba2bfe8a1
+DATA constants<>+0xa8(SB)/8, $0xc76c51a3c24b8b70
+DATA constants<>+0xb0(SB)/8, $0xd6990624d192e819
+DATA constants<>+0xb8(SB)/8, $0x106aa070f40e3585
+DATA constants<>+0xc0(SB)/8, $0x1e376c0819a4c116
+DATA constants<>+0xc8(SB)/8, $0x34b0bcb52748774c
+DATA constants<>+0xd0(SB)/8, $0x4ed8aa4a391c0cb3
+DATA constants<>+0xd8(SB)/8, $0x682e6ff35b9cca4f
+DATA constants<>+0xe0(SB)/8, $0x78a5636f748f82ee
+DATA constants<>+0xe8(SB)/8, $0x8cc7020884c87814
+DATA constants<>+0xf0(SB)/8, $0xa4506ceb90befffa
+DATA constants<>+0xf8(SB)/8, $0xc67178f2bef9a3f7
+
+DATA bflipMask<>+0x00(SB)/8, $0x0405060700010203
+DATA bflipMask<>+0x08(SB)/8, $0x0c0d0e0f08090a0b
+
+DATA shuf00BA<>+0x00(SB)/8, $0x0b0a090803020100
+DATA shuf00BA<>+0x08(SB)/8, $0xFFFFFFFFFFFFFFFF
+
+DATA shufDC00<>+0x00(SB)/8, $0xFFFFFFFFFFFFFFFF
+DATA shufDC00<>+0x08(SB)/8, $0x0b0a090803020100
+
+GLOBL constants<>(SB), 8, $256
+GLOBL bflipMask<>(SB), (NOPTR+RODATA), $16
+GLOBL shuf00BA<>(SB), (NOPTR+RODATA), $16
+GLOBL shufDC00<>(SB), (NOPTR+RODATA), $16
diff --git a/vendor/github.com/minio/sha256-simd/sha256block_amd64.go b/vendor/github.com/minio/sha256-simd/sha256block_amd64.go
new file mode 100644
index 0000000000..1c4d97f0c8
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256block_amd64.go
@@ -0,0 +1,53 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+func blockArmGo(dig *digest, p []byte) {}
+
+func blockAvxGo(dig *digest, p []byte) {
+
+ h := []uint32{dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]}
+
+ blockAvx(h[:], p[:], 0, 0, 0, 0)
+
+ dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7]
+}
+
+func blockAvx2Go(dig *digest, p []byte) {
+
+ h := []uint32{dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]}
+
+ blockAvx2(h[:], p[:])
+
+ dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7]
+}
+
+func blockSsseGo(dig *digest, p []byte) {
+
+ h := []uint32{dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]}
+
+ blockSsse(h[:], p[:], 0, 0, 0, 0)
+
+ dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h[0], h[1], h[2], h[3], h[4], h[5], h[6], h[7]
+}
+
+func blockShaGo(dig *digest, p []byte) {
+
+ blockSha(&dig.h, p)
+}
diff --git a/vendor/github.com/minio/sha256-simd/sha256block_arm64.go b/vendor/github.com/minio/sha256-simd/sha256block_arm64.go
new file mode 100644
index 0000000000..0979c20ae6
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256block_arm64.go
@@ -0,0 +1,37 @@
+//+build !noasm,!appengine
+
+/*
+ * Minio Cloud Storage, (C) 2016 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+func blockAvx2Go(dig *digest, p []byte) {}
+func blockAvxGo(dig *digest, p []byte) {}
+func blockSsseGo(dig *digest, p []byte) {}
+func blockShaGo(dig *digest, p []byte) {}
+
+//go:noescape
+func blockArm(h []uint32, message []uint8)
+
+func blockArmGo(dig *digest, p []byte) {
+
+ h := []uint32{dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7]}
+
+ blockArm(h[:], p[:])
+
+ dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h[0], h[1], h[2], h[3], h[4],
+ h[5], h[6], h[7]
+}
diff --git a/vendor/github.com/minio/sha256-simd/sha256block_arm64.s b/vendor/github.com/minio/sha256-simd/sha256block_arm64.s
new file mode 100644
index 0000000000..c6ddb37179
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256block_arm64.s
@@ -0,0 +1,192 @@
+//+build !noasm,!appengine
+
+// ARM64 version of SHA256
+
+//
+// Minio Cloud Storage, (C) 2016 Minio, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// Based on implementation as found in https://github.com/jocover/sha256-armv8
+//
+// Use github.com/minio/asm2plan9s on this file to assemble ARM instructions to
+// their Plan9 equivalents
+//
+
+TEXT ·blockArm(SB), 7, $0
+ MOVD h+0(FP), R0
+ MOVD message+24(FP), R1
+ MOVD message_len+32(FP), R2 // length of message
+ SUBS $64, R2
+ BMI complete
+
+ // Load constants table pointer
+ MOVD $·constants(SB), R3
+
+ // Cache constants table in registers v16 - v31
+ WORD $0x4cdf2870 // ld1 {v16.4s-v19.4s}, [x3], #64
+ WORD $0x4cdf7800 // ld1 {v0.4s}, [x0], #16
+ WORD $0x4cdf2874 // ld1 {v20.4s-v23.4s}, [x3], #64
+
+ WORD $0x4c407801 // ld1 {v1.4s}, [x0]
+ WORD $0x4cdf2878 // ld1 {v24.4s-v27.4s}, [x3], #64
+ WORD $0xd1004000 // sub x0, x0, #0x10
+ WORD $0x4cdf287c // ld1 {v28.4s-v31.4s}, [x3], #64
+
+loop:
+ // Main loop
+ WORD $0x4cdf2025 // ld1 {v5.16b-v8.16b}, [x1], #64
+ WORD $0x4ea01c02 // mov v2.16b, v0.16b
+ WORD $0x4ea11c23 // mov v3.16b, v1.16b
+ WORD $0x6e2008a5 // rev32 v5.16b, v5.16b
+ WORD $0x6e2008c6 // rev32 v6.16b, v6.16b
+ WORD $0x4eb084a9 // add v9.4s, v5.4s, v16.4s
+ WORD $0x6e2008e7 // rev32 v7.16b, v7.16b
+ WORD $0x4eb184ca // add v10.4s, v6.4s, v17.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e2828c5 // sha256su0 v5.4s, v6.4s
+ WORD $0x6e200908 // rev32 v8.16b, v8.16b
+ WORD $0x4eb284e9 // add v9.4s, v7.4s, v18.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828e6 // sha256su0 v6.4s, v7.4s
+ WORD $0x5e0860e5 // sha256su1 v5.4s, v7.4s, v8.4s
+ WORD $0x4eb3850a // add v10.4s, v8.4s, v19.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e282907 // sha256su0 v7.4s, v8.4s
+ WORD $0x5e056106 // sha256su1 v6.4s, v8.4s, v5.4s
+ WORD $0x4eb484a9 // add v9.4s, v5.4s, v20.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828a8 // sha256su0 v8.4s, v5.4s
+ WORD $0x5e0660a7 // sha256su1 v7.4s, v5.4s, v6.4s
+ WORD $0x4eb584ca // add v10.4s, v6.4s, v21.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e2828c5 // sha256su0 v5.4s, v6.4s
+ WORD $0x5e0760c8 // sha256su1 v8.4s, v6.4s, v7.4s
+ WORD $0x4eb684e9 // add v9.4s, v7.4s, v22.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828e6 // sha256su0 v6.4s, v7.4s
+ WORD $0x5e0860e5 // sha256su1 v5.4s, v7.4s, v8.4s
+ WORD $0x4eb7850a // add v10.4s, v8.4s, v23.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e282907 // sha256su0 v7.4s, v8.4s
+ WORD $0x5e056106 // sha256su1 v6.4s, v8.4s, v5.4s
+ WORD $0x4eb884a9 // add v9.4s, v5.4s, v24.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828a8 // sha256su0 v8.4s, v5.4s
+ WORD $0x5e0660a7 // sha256su1 v7.4s, v5.4s, v6.4s
+ WORD $0x4eb984ca // add v10.4s, v6.4s, v25.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e2828c5 // sha256su0 v5.4s, v6.4s
+ WORD $0x5e0760c8 // sha256su1 v8.4s, v6.4s, v7.4s
+ WORD $0x4eba84e9 // add v9.4s, v7.4s, v26.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828e6 // sha256su0 v6.4s, v7.4s
+ WORD $0x5e0860e5 // sha256su1 v5.4s, v7.4s, v8.4s
+ WORD $0x4ebb850a // add v10.4s, v8.4s, v27.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e282907 // sha256su0 v7.4s, v8.4s
+ WORD $0x5e056106 // sha256su1 v6.4s, v8.4s, v5.4s
+ WORD $0x4ebc84a9 // add v9.4s, v5.4s, v28.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x5e2828a8 // sha256su0 v8.4s, v5.4s
+ WORD $0x5e0660a7 // sha256su1 v7.4s, v5.4s, v6.4s
+ WORD $0x4ebd84ca // add v10.4s, v6.4s, v29.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x5e0760c8 // sha256su1 v8.4s, v6.4s, v7.4s
+ WORD $0x4ebe84e9 // add v9.4s, v7.4s, v30.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x4ebf850a // add v10.4s, v8.4s, v31.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e094062 // sha256h q2, q3, v9.4s
+ WORD $0x5e095083 // sha256h2 q3, q4, v9.4s
+ WORD $0x4ea21c44 // mov v4.16b, v2.16b
+ WORD $0x5e0a4062 // sha256h q2, q3, v10.4s
+ WORD $0x5e0a5083 // sha256h2 q3, q4, v10.4s
+ WORD $0x4ea38421 // add v1.4s, v1.4s, v3.4s
+ WORD $0x4ea28400 // add v0.4s, v0.4s, v2.4s
+
+ SUBS $64, R2
+ BPL loop
+
+ // Store result
+ WORD $0x4c00a800 // st1 {v0.4s, v1.4s}, [x0]
+
+complete:
+ RET
+
+// Constants table
+DATA ·constants+0x0(SB)/8, $0x71374491428a2f98
+DATA ·constants+0x8(SB)/8, $0xe9b5dba5b5c0fbcf
+DATA ·constants+0x10(SB)/8, $0x59f111f13956c25b
+DATA ·constants+0x18(SB)/8, $0xab1c5ed5923f82a4
+DATA ·constants+0x20(SB)/8, $0x12835b01d807aa98
+DATA ·constants+0x28(SB)/8, $0x550c7dc3243185be
+DATA ·constants+0x30(SB)/8, $0x80deb1fe72be5d74
+DATA ·constants+0x38(SB)/8, $0xc19bf1749bdc06a7
+DATA ·constants+0x40(SB)/8, $0xefbe4786e49b69c1
+DATA ·constants+0x48(SB)/8, $0x240ca1cc0fc19dc6
+DATA ·constants+0x50(SB)/8, $0x4a7484aa2de92c6f
+DATA ·constants+0x58(SB)/8, $0x76f988da5cb0a9dc
+DATA ·constants+0x60(SB)/8, $0xa831c66d983e5152
+DATA ·constants+0x68(SB)/8, $0xbf597fc7b00327c8
+DATA ·constants+0x70(SB)/8, $0xd5a79147c6e00bf3
+DATA ·constants+0x78(SB)/8, $0x1429296706ca6351
+DATA ·constants+0x80(SB)/8, $0x2e1b213827b70a85
+DATA ·constants+0x88(SB)/8, $0x53380d134d2c6dfc
+DATA ·constants+0x90(SB)/8, $0x766a0abb650a7354
+DATA ·constants+0x98(SB)/8, $0x92722c8581c2c92e
+DATA ·constants+0xa0(SB)/8, $0xa81a664ba2bfe8a1
+DATA ·constants+0xa8(SB)/8, $0xc76c51a3c24b8b70
+DATA ·constants+0xb0(SB)/8, $0xd6990624d192e819
+DATA ·constants+0xb8(SB)/8, $0x106aa070f40e3585
+DATA ·constants+0xc0(SB)/8, $0x1e376c0819a4c116
+DATA ·constants+0xc8(SB)/8, $0x34b0bcb52748774c
+DATA ·constants+0xd0(SB)/8, $0x4ed8aa4a391c0cb3
+DATA ·constants+0xd8(SB)/8, $0x682e6ff35b9cca4f
+DATA ·constants+0xe0(SB)/8, $0x78a5636f748f82ee
+DATA ·constants+0xe8(SB)/8, $0x8cc7020884c87814
+DATA ·constants+0xf0(SB)/8, $0xa4506ceb90befffa
+DATA ·constants+0xf8(SB)/8, $0xc67178f2bef9a3f7
+
+GLOBL ·constants(SB), 8, $256
+
diff --git a/vendor/github.com/minio/sha256-simd/sha256block_other.go b/vendor/github.com/minio/sha256-simd/sha256block_other.go
new file mode 100644
index 0000000000..0187c950a8
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/sha256block_other.go
@@ -0,0 +1,25 @@
+//+build appengine noasm !amd64,!arm64
+
+/*
+ * Minio Cloud Storage, (C) 2019 Minio, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package sha256
+
+func blockAvx2Go(dig *digest, p []byte) {}
+func blockAvxGo(dig *digest, p []byte) {}
+func blockSsseGo(dig *digest, p []byte) {}
+func blockShaGo(dig *digest, p []byte) {}
+func blockArmGo(dig *digest, p []byte) {}
diff --git a/vendor/github.com/minio/sha256-simd/test-architectures.sh b/vendor/github.com/minio/sha256-simd/test-architectures.sh
new file mode 100644
index 0000000000..50150eaabe
--- /dev/null
+++ b/vendor/github.com/minio/sha256-simd/test-architectures.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+go tool dist list | while IFS=/ read os arch; do
+ echo "Checking $os/$arch..."
+ echo " normal"
+ GOARCH=$arch GOOS=$os go build -o /dev/null ./...
+ echo " noasm"
+ GOARCH=$arch GOOS=$os go build -tags noasm -o /dev/null ./...
+ echo " appengine"
+ GOARCH=$arch GOOS=$os go build -tags appengine -o /dev/null ./...
+ echo " noasm,appengine"
+ GOARCH=$arch GOOS=$os go build -tags 'appengine noasm' -o /dev/null ./...
+done
diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go
index 8e473d0fe9..0327865eee 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_create.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_create.go
@@ -14,9 +14,10 @@
package expfmt
import (
- "bytes"
+ "bufio"
"fmt"
"io"
+ "io/ioutil"
"math"
"strconv"
"strings"
@@ -27,7 +28,7 @@ import (
dto "github.com/prometheus/client_model/go"
)
-// enhancedWriter has all the enhanced write functions needed here. bytes.Buffer
+// enhancedWriter has all the enhanced write functions needed here. bufio.Writer
// implements it.
type enhancedWriter interface {
io.Writer
@@ -37,14 +38,13 @@ type enhancedWriter interface {
}
const (
- initialBufSize = 512
initialNumBufSize = 24
)
var (
bufPool = sync.Pool{
New: func() interface{} {
- return bytes.NewBuffer(make([]byte, 0, initialBufSize))
+ return bufio.NewWriter(ioutil.Discard)
},
}
numBufPool = sync.Pool{
@@ -75,16 +75,14 @@ func MetricFamilyToText(out io.Writer, in *dto.MetricFamily) (written int, err e
}
// Try the interface upgrade. If it doesn't work, we'll use a
- // bytes.Buffer from the sync.Pool and write out its content to out in a
- // single go in the end.
+ // bufio.Writer from the sync.Pool.
w, ok := out.(enhancedWriter)
if !ok {
- b := bufPool.Get().(*bytes.Buffer)
- b.Reset()
+ b := bufPool.Get().(*bufio.Writer)
+ b.Reset(out)
w = b
defer func() {
- bWritten, bErr := out.Write(b.Bytes())
- written = bWritten
+ bErr := b.Flush()
if err == nil {
err = bErr
}
diff --git a/vendor/github.com/prometheus/common/expfmt/text_parse.go b/vendor/github.com/prometheus/common/expfmt/text_parse.go
index ec3d86ba7c..342e5940d0 100644
--- a/vendor/github.com/prometheus/common/expfmt/text_parse.go
+++ b/vendor/github.com/prometheus/common/expfmt/text_parse.go
@@ -325,7 +325,7 @@ func (p *TextParser) startLabelValue() stateFn {
// - Other labels have to be added to currentLabels for signature calculation.
if p.currentMF.GetType() == dto.MetricType_SUMMARY {
if p.currentLabelPair.GetName() == model.QuantileLabel {
- if p.currentQuantile, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil {
+ if p.currentQuantile, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil {
// Create a more helpful error message.
p.parseError(fmt.Sprintf("expected float as value for 'quantile' label, got %q", p.currentLabelPair.GetValue()))
return nil
@@ -337,7 +337,7 @@ func (p *TextParser) startLabelValue() stateFn {
// Similar special treatment of histograms.
if p.currentMF.GetType() == dto.MetricType_HISTOGRAM {
if p.currentLabelPair.GetName() == model.BucketLabel {
- if p.currentBucket, p.err = strconv.ParseFloat(p.currentLabelPair.GetValue(), 64); p.err != nil {
+ if p.currentBucket, p.err = parseFloat(p.currentLabelPair.GetValue()); p.err != nil {
// Create a more helpful error message.
p.parseError(fmt.Sprintf("expected float as value for 'le' label, got %q", p.currentLabelPair.GetValue()))
return nil
@@ -392,7 +392,7 @@ func (p *TextParser) readingValue() stateFn {
if p.readTokenUntilWhitespace(); p.err != nil {
return nil // Unexpected end of input.
}
- value, err := strconv.ParseFloat(p.currentToken.String(), 64)
+ value, err := parseFloat(p.currentToken.String())
if err != nil {
// Create a more helpful error message.
p.parseError(fmt.Sprintf("expected float as value, got %q", p.currentToken.String()))
@@ -755,3 +755,10 @@ func histogramMetricName(name string) string {
return name
}
}
+
+func parseFloat(s string) (float64, error) {
+ if strings.ContainsAny(s, "pP_") {
+ return 0, fmt.Errorf("unsupported character in float")
+ }
+ return strconv.ParseFloat(s, 64)
+}
diff --git a/vendor/github.com/prometheus/procfs/arp.go b/vendor/github.com/prometheus/procfs/arp.go
new file mode 100644
index 0000000000..916c9182a8
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/arp.go
@@ -0,0 +1,85 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "fmt"
+ "io/ioutil"
+ "net"
+ "strings"
+)
+
+// ARPEntry contains a single row of the columnar data represented in
+// /proc/net/arp.
+type ARPEntry struct {
+ // IP address
+ IPAddr net.IP
+ // MAC address
+ HWAddr net.HardwareAddr
+ // Name of the device
+ Device string
+}
+
+// GatherARPEntries retrieves all the ARP entries, parse the relevant columns,
+// and then return a slice of ARPEntry's.
+func (fs FS) GatherARPEntries() ([]ARPEntry, error) {
+ data, err := ioutil.ReadFile(fs.proc.Path("net/arp"))
+ if err != nil {
+ return nil, fmt.Errorf("error reading arp %s: %s", fs.proc.Path("net/arp"), err)
+ }
+
+ return parseARPEntries(data)
+}
+
+func parseARPEntries(data []byte) ([]ARPEntry, error) {
+ lines := strings.Split(string(data), "\n")
+ entries := make([]ARPEntry, 0)
+ var err error
+ const (
+ expectedDataWidth = 6
+ expectedHeaderWidth = 9
+ )
+ for _, line := range lines {
+ columns := strings.Fields(line)
+ width := len(columns)
+
+ if width == expectedHeaderWidth || width == 0 {
+ continue
+ } else if width == expectedDataWidth {
+ entry, err := parseARPEntry(columns)
+ if err != nil {
+ return []ARPEntry{}, fmt.Errorf("failed to parse ARP entry: %s", err)
+ }
+ entries = append(entries, entry)
+ } else {
+ return []ARPEntry{}, fmt.Errorf("%d columns were detected, but %d were expected", width, expectedDataWidth)
+ }
+
+ }
+
+ return entries, err
+}
+
+func parseARPEntry(columns []string) (ARPEntry, error) {
+ ip := net.ParseIP(columns[0])
+ mac := net.HardwareAddr(columns[3])
+
+ entry := ARPEntry{
+ IPAddr: ip,
+ HWAddr: mac,
+ Device: columns[5],
+ }
+
+ return entry, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/buddyinfo.go b/vendor/github.com/prometheus/procfs/buddyinfo.go
index 63d4229a45..10bd067a0a 100644
--- a/vendor/github.com/prometheus/procfs/buddyinfo.go
+++ b/vendor/github.com/prometheus/procfs/buddyinfo.go
@@ -31,7 +31,7 @@ type BuddyInfo struct {
Sizes []float64
}
-// NewBuddyInfo reads the buddyinfo statistics from the specified `proc` filesystem.
+// BuddyInfo reads the buddyinfo statistics from the specified `proc` filesystem.
func (fs FS) BuddyInfo() ([]BuddyInfo, error) {
file, err := os.Open(fs.proc.Path("buddyinfo"))
if err != nil {
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
new file mode 100644
index 0000000000..16491d6abb
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
@@ -0,0 +1,166 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "bufio"
+ "bytes"
+ "io/ioutil"
+ "strconv"
+ "strings"
+)
+
+// CPUInfo contains general information about a system CPU found in /proc/cpuinfo
+type CPUInfo struct {
+ Processor uint
+ VendorID string
+ CPUFamily string
+ Model string
+ ModelName string
+ Stepping string
+ Microcode string
+ CPUMHz float64
+ CacheSize string
+ PhysicalID string
+ Siblings uint
+ CoreID string
+ CPUCores uint
+ APICID string
+ InitialAPICID string
+ FPU string
+ FPUException string
+ CPUIDLevel uint
+ WP string
+ Flags []string
+ Bugs []string
+ BogoMips float64
+ CLFlushSize uint
+ CacheAlignment uint
+ AddressSizes string
+ PowerManagement string
+}
+
+// CPUInfo returns information about current system CPUs.
+// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
+func (fs FS) CPUInfo() ([]CPUInfo, error) {
+ data, err := ioutil.ReadFile(fs.proc.Path("cpuinfo"))
+ if err != nil {
+ return nil, err
+ }
+ return parseCPUInfo(data)
+}
+
+// parseCPUInfo parses data from /proc/cpuinfo
+func parseCPUInfo(info []byte) ([]CPUInfo, error) {
+ cpuinfo := []CPUInfo{}
+ i := -1
+ scanner := bufio.NewScanner(bytes.NewReader(info))
+ for scanner.Scan() {
+ line := scanner.Text()
+ if strings.TrimSpace(line) == "" {
+ continue
+ }
+ field := strings.SplitN(line, ": ", 2)
+ switch strings.TrimSpace(field[0]) {
+ case "processor":
+ cpuinfo = append(cpuinfo, CPUInfo{}) // start of the next processor
+ i++
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].Processor = uint(v)
+ case "vendor_id":
+ cpuinfo[i].VendorID = field[1]
+ case "cpu family":
+ cpuinfo[i].CPUFamily = field[1]
+ case "model":
+ cpuinfo[i].Model = field[1]
+ case "model name":
+ cpuinfo[i].ModelName = field[1]
+ case "stepping":
+ cpuinfo[i].Stepping = field[1]
+ case "microcode":
+ cpuinfo[i].Microcode = field[1]
+ case "cpu MHz":
+ v, err := strconv.ParseFloat(field[1], 64)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].CPUMHz = v
+ case "cache size":
+ cpuinfo[i].CacheSize = field[1]
+ case "physical id":
+ cpuinfo[i].PhysicalID = field[1]
+ case "siblings":
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].Siblings = uint(v)
+ case "core id":
+ cpuinfo[i].CoreID = field[1]
+ case "cpu cores":
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].CPUCores = uint(v)
+ case "apicid":
+ cpuinfo[i].APICID = field[1]
+ case "initial apicid":
+ cpuinfo[i].InitialAPICID = field[1]
+ case "fpu":
+ cpuinfo[i].FPU = field[1]
+ case "fpu_exception":
+ cpuinfo[i].FPUException = field[1]
+ case "cpuid level":
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].CPUIDLevel = uint(v)
+ case "wp":
+ cpuinfo[i].WP = field[1]
+ case "flags":
+ cpuinfo[i].Flags = strings.Fields(field[1])
+ case "bugs":
+ cpuinfo[i].Bugs = strings.Fields(field[1])
+ case "bogomips":
+ v, err := strconv.ParseFloat(field[1], 64)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].BogoMips = v
+ case "clflush size":
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].CLFlushSize = uint(v)
+ case "cache_alignment":
+ v, err := strconv.ParseUint(field[1], 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ cpuinfo[i].CacheAlignment = uint(v)
+ case "address sizes":
+ cpuinfo[i].AddressSizes = field[1]
+ case "power management":
+ cpuinfo[i].PowerManagement = field[1]
+ }
+ }
+ return cpuinfo, nil
+
+}
diff --git a/vendor/github.com/prometheus/procfs/crypto.go b/vendor/github.com/prometheus/procfs/crypto.go
new file mode 100644
index 0000000000..19d4041b29
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/crypto.go
@@ -0,0 +1,131 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "strconv"
+ "strings"
+
+ "github.com/prometheus/procfs/internal/util"
+)
+
+// Crypto holds info parsed from /proc/crypto.
+type Crypto struct {
+ Alignmask *uint64
+ Async bool
+ Blocksize *uint64
+ Chunksize *uint64
+ Ctxsize *uint64
+ Digestsize *uint64
+ Driver string
+ Geniv string
+ Internal string
+ Ivsize *uint64
+ Maxauthsize *uint64
+ MaxKeysize *uint64
+ MinKeysize *uint64
+ Module string
+ Name string
+ Priority *int64
+ Refcnt *int64
+ Seedsize *uint64
+ Selftest string
+ Type string
+ Walksize *uint64
+}
+
+// Crypto parses an crypto-file (/proc/crypto) and returns a slice of
+// structs containing the relevant info. More information available here:
+// https://kernel.readthedocs.io/en/sphinx-samples/crypto-API.html
+func (fs FS) Crypto() ([]Crypto, error) {
+ data, err := ioutil.ReadFile(fs.proc.Path("crypto"))
+ if err != nil {
+ return nil, fmt.Errorf("error parsing crypto %s: %s", fs.proc.Path("crypto"), err)
+ }
+ crypto, err := parseCrypto(data)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing crypto %s: %s", fs.proc.Path("crypto"), err)
+ }
+ return crypto, nil
+}
+
+func parseCrypto(cryptoData []byte) ([]Crypto, error) {
+ crypto := []Crypto{}
+
+ cryptoBlocks := bytes.Split(cryptoData, []byte("\n\n"))
+
+ for _, block := range cryptoBlocks {
+ var newCryptoElem Crypto
+
+ lines := strings.Split(string(block), "\n")
+ for _, line := range lines {
+ if strings.TrimSpace(line) == "" || line[0] == ' ' {
+ continue
+ }
+ fields := strings.Split(line, ":")
+ key := strings.TrimSpace(fields[0])
+ value := strings.TrimSpace(fields[1])
+ vp := util.NewValueParser(value)
+
+ switch strings.TrimSpace(key) {
+ case "async":
+ b, err := strconv.ParseBool(value)
+ if err == nil {
+ newCryptoElem.Async = b
+ }
+ case "blocksize":
+ newCryptoElem.Blocksize = vp.PUInt64()
+ case "chunksize":
+ newCryptoElem.Chunksize = vp.PUInt64()
+ case "digestsize":
+ newCryptoElem.Digestsize = vp.PUInt64()
+ case "driver":
+ newCryptoElem.Driver = value
+ case "geniv":
+ newCryptoElem.Geniv = value
+ case "internal":
+ newCryptoElem.Internal = value
+ case "ivsize":
+ newCryptoElem.Ivsize = vp.PUInt64()
+ case "maxauthsize":
+ newCryptoElem.Maxauthsize = vp.PUInt64()
+ case "max keysize":
+ newCryptoElem.MaxKeysize = vp.PUInt64()
+ case "min keysize":
+ newCryptoElem.MinKeysize = vp.PUInt64()
+ case "module":
+ newCryptoElem.Module = value
+ case "name":
+ newCryptoElem.Name = value
+ case "priority":
+ newCryptoElem.Priority = vp.PInt64()
+ case "refcnt":
+ newCryptoElem.Refcnt = vp.PInt64()
+ case "seedsize":
+ newCryptoElem.Seedsize = vp.PUInt64()
+ case "selftest":
+ newCryptoElem.Selftest = value
+ case "type":
+ newCryptoElem.Type = value
+ case "walksize":
+ newCryptoElem.Walksize = vp.PUInt64()
+ }
+ }
+ crypto = append(crypto, newCryptoElem)
+ }
+ return crypto, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar
index 6b42e7ba14..0b29055447 100644
--- a/vendor/github.com/prometheus/procfs/fixtures.ttar
+++ b/vendor/github.com/prometheus/procfs/fixtures.ttar
@@ -47,6 +47,48 @@ SymlinkTo: ../../symlinktargets/ghi
Path: fixtures/proc/26231/fd/3
SymlinkTo: ../../symlinktargets/uvw
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/proc/26231/fdinfo
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/fdinfo/0
+Lines: 6
+pos: 0
+flags: 02004000
+mnt_id: 13
+inotify wd:3 ino:1 sdev:34 mask:fce ignored_mask:0 fhandle-bytes:c fhandle-type:81 f_handle:000000000100000000000000
+inotify wd:2 ino:1300016 sdev:fd00002 mask:fce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:16003001ed3f022a
+inotify wd:1 ino:2e0001 sdev:fd00000 mask:fce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:01002e00138e7c65
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/fdinfo/1
+Lines: 4
+pos: 0
+flags: 02004002
+mnt_id: 13
+eventfd-count: 0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/fdinfo/10
+Lines: 3
+pos: 0
+flags: 02004002
+mnt_id: 9
+Mode: 400
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/fdinfo/2
+Lines: 3
+pos: 0
+flags: 02004002
+mnt_id: 9
+Mode: 400
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/fdinfo/3
+Lines: 3
+pos: 0
+flags: 02004002
+mnt_id: 9
+Mode: 400
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/26231/io
Lines: 7
rchar: 750339
@@ -126,6 +168,11 @@ SymlinkTo: net:[4026531993]
Path: fixtures/proc/26231/root
SymlinkTo: /
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26231/schedstat
+Lines: 1
+411605849 93680043 79
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/26231/stat
Lines: 1
26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0
@@ -137,10 +184,10 @@ Lines: 53
Name: prometheus
Umask: 0022
State: S (sleeping)
-Tgid: 1
+Tgid: 26231
Ngid: 0
-Pid: 1
-PPid: 0
+Pid: 26231
+PPid: 1
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
@@ -258,6 +305,18 @@ Lines: 1
com.github.uiautomatorNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEEOF
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/26233/schedstat
+Lines: 8
+ ____________________________________
+< this is a malformed schedstat file >
+ ------------------------------------
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/proc/584
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -274,6 +333,1201 @@ Node 0, zone DMA32 759 572 791 475 194 45 12 0
Node 0, zone Normal 4381 1093 185 1530 567 102 4 0 0 0 0
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/cpuinfo
+Lines: 216
+processor : 0
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 799.998
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 0
+cpu cores : 4
+apicid : 0
+initial apicid : 0
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 1
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.037
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 1
+cpu cores : 4
+apicid : 2
+initial apicid : 2
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 2
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.010
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 2
+cpu cores : 4
+apicid : 4
+initial apicid : 4
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 3
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.028
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 3
+cpu cores : 4
+apicid : 6
+initial apicid : 6
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 4
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 799.989
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 0
+cpu cores : 4
+apicid : 1
+initial apicid : 1
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 5
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.083
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 1
+cpu cores : 4
+apicid : 3
+initial apicid : 3
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 6
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.017
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 2
+cpu cores : 4
+apicid : 5
+initial apicid : 5
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+processor : 7
+vendor_id : GenuineIntel
+cpu family : 6
+model : 142
+model name : Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
+stepping : 10
+microcode : 0xb4
+cpu MHz : 800.030
+cache size : 8192 KB
+physical id : 0
+siblings : 8
+core id : 3
+cpu cores : 4
+apicid : 7
+initial apicid : 7
+fpu : yes
+fpu_exception : yes
+cpuid level : 22
+wp : yes
+flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
+bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
+bogomips : 4224.00
+clflush size : 64
+cache_alignment : 64
+address sizes : 39 bits physical, 48 bits virtual
+power management:
+
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/crypto
+Lines: 971
+name : ccm(aes)
+driver : ccm_base(ctr(aes-aesni),cbcmac(aes-aesni))
+module : ccm
+priority : 300
+refcnt : 4
+selftest : passed
+internal : no
+type : aead
+async : no
+blocksize : 1
+ivsize : 16
+maxauthsize : 16
+geniv :
+
+name : cbcmac(aes)
+driver : cbcmac(aes-aesni)
+module : ccm
+priority : 300
+refcnt : 7
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 16
+
+name : ecdh
+driver : ecdh-generic
+module : ecdh_generic
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : kpp
+
+name : ecb(arc4)
+driver : ecb(arc4)-generic
+module : arc4
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : no
+blocksize : 1
+min keysize : 1
+max keysize : 256
+ivsize : 0
+chunksize : 1
+walksize : 1
+
+name : arc4
+driver : arc4-generic
+module : arc4
+priority : 0
+refcnt : 3
+selftest : passed
+internal : no
+type : cipher
+blocksize : 1
+min keysize : 1
+max keysize : 256
+
+name : crct10dif
+driver : crct10dif-pclmul
+module : crct10dif_pclmul
+priority : 200
+refcnt : 2
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 2
+
+name : crc32
+driver : crc32-pclmul
+module : crc32_pclmul
+priority : 200
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 4
+
+name : __ghash
+driver : cryptd(__ghash-pclmulqdqni)
+module : kernel
+priority : 50
+refcnt : 1
+selftest : passed
+internal : yes
+type : ahash
+async : yes
+blocksize : 16
+digestsize : 16
+
+name : ghash
+driver : ghash-clmulni
+module : ghash_clmulni_intel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : ahash
+async : yes
+blocksize : 16
+digestsize : 16
+
+name : __ghash
+driver : __ghash-pclmulqdqni
+module : ghash_clmulni_intel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : yes
+type : shash
+blocksize : 16
+digestsize : 16
+
+name : crc32c
+driver : crc32c-intel
+module : crc32c_intel
+priority : 200
+refcnt : 5
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 4
+
+name : cbc(aes)
+driver : cbc(aes-aesni)
+module : kernel
+priority : 300
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : no
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : ctr(aes)
+driver : ctr(aes-aesni)
+module : kernel
+priority : 300
+refcnt : 5
+selftest : passed
+internal : no
+type : skcipher
+async : no
+blocksize : 1
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : pkcs1pad(rsa,sha256)
+driver : pkcs1pad(rsa-generic,sha256)
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : akcipher
+
+name : __xts(aes)
+driver : cryptd(__xts-aes-aesni)
+module : kernel
+priority : 451
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 32
+max keysize : 64
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : xts(aes)
+driver : xts-aes-aesni
+module : kernel
+priority : 401
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 32
+max keysize : 64
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __ctr(aes)
+driver : cryptd(__ctr-aes-aesni)
+module : kernel
+priority : 450
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : yes
+blocksize : 1
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : ctr(aes)
+driver : ctr-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : yes
+blocksize : 1
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __cbc(aes)
+driver : cryptd(__cbc-aes-aesni)
+module : kernel
+priority : 450
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : cbc(aes)
+driver : cbc-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __ecb(aes)
+driver : cryptd(__ecb-aes-aesni)
+module : kernel
+priority : 450
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 0
+chunksize : 16
+walksize : 16
+
+name : ecb(aes)
+driver : ecb-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : yes
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 0
+chunksize : 16
+walksize : 16
+
+name : __generic-gcm-aes-aesni
+driver : cryptd(__driver-generic-gcm-aes-aesni)
+module : kernel
+priority : 50
+refcnt : 1
+selftest : passed
+internal : yes
+type : aead
+async : yes
+blocksize : 1
+ivsize : 12
+maxauthsize : 16
+geniv :
+
+name : gcm(aes)
+driver : generic-gcm-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : aead
+async : yes
+blocksize : 1
+ivsize : 12
+maxauthsize : 16
+geniv :
+
+name : __generic-gcm-aes-aesni
+driver : __driver-generic-gcm-aes-aesni
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : yes
+type : aead
+async : no
+blocksize : 1
+ivsize : 12
+maxauthsize : 16
+geniv :
+
+name : __gcm-aes-aesni
+driver : cryptd(__driver-gcm-aes-aesni)
+module : kernel
+priority : 50
+refcnt : 1
+selftest : passed
+internal : yes
+type : aead
+async : yes
+blocksize : 1
+ivsize : 8
+maxauthsize : 16
+geniv :
+
+name : rfc4106(gcm(aes))
+driver : rfc4106-gcm-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : no
+type : aead
+async : yes
+blocksize : 1
+ivsize : 8
+maxauthsize : 16
+geniv :
+
+name : __gcm-aes-aesni
+driver : __driver-gcm-aes-aesni
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : yes
+type : aead
+async : no
+blocksize : 1
+ivsize : 8
+maxauthsize : 16
+geniv :
+
+name : __xts(aes)
+driver : __xts-aes-aesni
+module : kernel
+priority : 401
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : no
+blocksize : 16
+min keysize : 32
+max keysize : 64
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __ctr(aes)
+driver : __ctr-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : no
+blocksize : 1
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __cbc(aes)
+driver : __cbc-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : no
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 16
+chunksize : 16
+walksize : 16
+
+name : __ecb(aes)
+driver : __ecb-aes-aesni
+module : kernel
+priority : 400
+refcnt : 1
+selftest : passed
+internal : yes
+type : skcipher
+async : no
+blocksize : 16
+min keysize : 16
+max keysize : 32
+ivsize : 0
+chunksize : 16
+walksize : 16
+
+name : __aes
+driver : __aes-aesni
+module : kernel
+priority : 300
+refcnt : 1
+selftest : passed
+internal : yes
+type : cipher
+blocksize : 16
+min keysize : 16
+max keysize : 32
+
+name : aes
+driver : aes-aesni
+module : kernel
+priority : 300
+refcnt : 8
+selftest : passed
+internal : no
+type : cipher
+blocksize : 16
+min keysize : 16
+max keysize : 32
+
+name : hmac(sha1)
+driver : hmac(sha1-generic)
+module : kernel
+priority : 100
+refcnt : 9
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 20
+
+name : ghash
+driver : ghash-generic
+module : kernel
+priority : 100
+refcnt : 3
+selftest : passed
+internal : no
+type : shash
+blocksize : 16
+digestsize : 16
+
+name : jitterentropy_rng
+driver : jitterentropy_rng
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_hmac_sha256
+module : kernel
+priority : 221
+refcnt : 2
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_hmac_sha512
+module : kernel
+priority : 220
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_hmac_sha384
+module : kernel
+priority : 219
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_hmac_sha1
+module : kernel
+priority : 218
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_sha256
+module : kernel
+priority : 217
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_sha512
+module : kernel
+priority : 216
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_sha384
+module : kernel
+priority : 215
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_sha1
+module : kernel
+priority : 214
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_ctr_aes256
+module : kernel
+priority : 213
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_ctr_aes192
+module : kernel
+priority : 212
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_nopr_ctr_aes128
+module : kernel
+priority : 211
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : hmac(sha256)
+driver : hmac(sha256-generic)
+module : kernel
+priority : 100
+refcnt : 10
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 32
+
+name : stdrng
+driver : drbg_pr_hmac_sha256
+module : kernel
+priority : 210
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_hmac_sha512
+module : kernel
+priority : 209
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_hmac_sha384
+module : kernel
+priority : 208
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_hmac_sha1
+module : kernel
+priority : 207
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_sha256
+module : kernel
+priority : 206
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_sha512
+module : kernel
+priority : 205
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_sha384
+module : kernel
+priority : 204
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_sha1
+module : kernel
+priority : 203
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_ctr_aes256
+module : kernel
+priority : 202
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_ctr_aes192
+module : kernel
+priority : 201
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : stdrng
+driver : drbg_pr_ctr_aes128
+module : kernel
+priority : 200
+refcnt : 1
+selftest : passed
+internal : no
+type : rng
+seedsize : 0
+
+name : 842
+driver : 842-scomp
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : scomp
+
+name : 842
+driver : 842-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : compression
+
+name : lzo-rle
+driver : lzo-rle-scomp
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : scomp
+
+name : lzo-rle
+driver : lzo-rle-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : compression
+
+name : lzo
+driver : lzo-scomp
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : scomp
+
+name : lzo
+driver : lzo-generic
+module : kernel
+priority : 0
+refcnt : 9
+selftest : passed
+internal : no
+type : compression
+
+name : crct10dif
+driver : crct10dif-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 2
+
+name : crc32c
+driver : crc32c-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 4
+
+name : zlib-deflate
+driver : zlib-deflate-scomp
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : scomp
+
+name : deflate
+driver : deflate-scomp
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : scomp
+
+name : deflate
+driver : deflate-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : compression
+
+name : aes
+driver : aes-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : cipher
+blocksize : 16
+min keysize : 16
+max keysize : 32
+
+name : sha224
+driver : sha224-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 28
+
+name : sha256
+driver : sha256-generic
+module : kernel
+priority : 100
+refcnt : 11
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 32
+
+name : sha1
+driver : sha1-generic
+module : kernel
+priority : 100
+refcnt : 11
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 20
+
+name : md5
+driver : md5-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 64
+digestsize : 16
+
+name : ecb(cipher_null)
+driver : ecb-cipher_null
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : skcipher
+async : no
+blocksize : 1
+min keysize : 0
+max keysize : 0
+ivsize : 0
+chunksize : 1
+walksize : 1
+
+name : digest_null
+driver : digest_null-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : shash
+blocksize : 1
+digestsize : 0
+
+name : compress_null
+driver : compress_null-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : compression
+
+name : cipher_null
+driver : cipher_null-generic
+module : kernel
+priority : 0
+refcnt : 1
+selftest : passed
+internal : no
+type : cipher
+blocksize : 1
+min keysize : 0
+max keysize : 0
+
+name : rsa
+driver : rsa-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : akcipher
+
+name : dh
+driver : dh-generic
+module : kernel
+priority : 100
+refcnt : 1
+selftest : passed
+internal : no
+type : kpp
+
+name : aes
+driver : aes-asm
+module : kernel
+priority : 200
+refcnt : 1
+selftest : passed
+internal : no
+type : cipher
+blocksize : 16
+min keysize : 16
+max keysize : 32
+
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/diskstats
Lines: 49
1 0 ram0 0 0 0 0 0 0 0 0 0 0 0
@@ -423,6 +1677,12 @@ Mode: 644
Directory: fixtures/proc/net
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/net/arp
+Lines: 2
+IP address HW type Flags HW address Mask Device
+192.168.224.1 0x1 0x2 00:50:56:c0:00:08 * ens33
+Mode: 664
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/net/dev
Lines: 6
Inter-| Receive | Transmit
@@ -495,6 +1755,11 @@ proc4 2 2 10853
proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/net/softnet_stat
+Lines: 1
+00015c73 00020e76 F0000769 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/net/unix
Lines: 6
Num RefCount Protocol Flags Type St Inode Path
@@ -567,6 +1832,16 @@ some avg10=0.10 avg60=2.00 avg300=3.85 total=15
full avg10=0.20 avg60=3.00 avg300=4.95 total=25
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/schedstat
+Lines: 6
+version 15
+timestamp 15819019232
+cpu0 498494191 0 3533438552 2553969831 3853684107 2465731542 2045936778163039 343796328169361 4767485306
+domain0 00000000,00000003 212499247 210112015 1861015 1860405436 536440 369895 32599 210079416 25368550 24241256 384652 927363878 807233 6366 1647 24239609 2122447165 1886868564 121112060 2848625533 125678146 241025 1032026 1885836538 2545 12 2533 0 0 0 0 0 0 1387952561 21076581 0
+cpu1 518377256 0 4155211005 2778589869 10466382 2867629021 1904686152592476 364107263788241 5145567945
+domain0 00000000,00000003 217653037 215526982 1577949 1580427380 557469 393576 28538 215498444 28721913 27662819 371153 870843407 745912 5523 1639 27661180 2331056874 2107732788 111442342 652402556 123615235 196159 1045245 2106687543 2400 3 2397 0 0 0 0 0 0 1437804657 26220076 0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/proc/self
SymlinkTo: 26231
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -619,6 +1894,493 @@ Path: fixtures/proc/symlinktargets/xyz
Lines: 0
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/proc/sys
+Mode: 775
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/proc/sys/vm
+Mode: 775
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/admin_reserve_kbytes
+Lines: 1
+8192
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/block_dump
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/compact_unevictable_allowed
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_background_bytes
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_background_ratio
+Lines: 1
+10
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_bytes
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_expire_centisecs
+Lines: 1
+3000
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_ratio
+Lines: 1
+20
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirty_writeback_centisecs
+Lines: 1
+500
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/dirtytime_expire_seconds
+Lines: 1
+43200
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/drop_caches
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/extfrag_threshold
+Lines: 1
+500
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/hugetlb_shm_group
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/laptop_mode
+Lines: 1
+5
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/legacy_va_layout
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/lowmem_reserve_ratio
+Lines: 1
+256 256 32 0 0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/max_map_count
+Lines: 1
+65530
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/memory_failure_early_kill
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/memory_failure_recovery
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/min_free_kbytes
+Lines: 1
+67584
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/min_slab_ratio
+Lines: 1
+5
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/min_unmapped_ratio
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/mmap_min_addr
+Lines: 1
+65536
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/nr_hugepages
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/nr_hugepages_mempolicy
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/nr_overcommit_hugepages
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/numa_stat
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/numa_zonelist_order
+Lines: 1
+Node
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/oom_dump_tasks
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/oom_kill_allocating_task
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/overcommit_kbytes
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/overcommit_memory
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/overcommit_ratio
+Lines: 1
+50
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/page-cluster
+Lines: 1
+3
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/panic_on_oom
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/percpu_pagelist_fraction
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/stat_interval
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/swappiness
+Lines: 1
+60
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/user_reserve_kbytes
+Lines: 1
+131072
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/vfs_cache_pressure
+Lines: 1
+100
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/watermark_boost_factor
+Lines: 1
+15000
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/watermark_scale_factor
+Lines: 1
+10
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/sys/vm/zone_reclaim_mode
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/proc/zoneinfo
+Lines: 262
+Node 0, zone DMA
+ per-node stats
+ nr_inactive_anon 230981
+ nr_active_anon 547580
+ nr_inactive_file 316904
+ nr_active_file 346282
+ nr_unevictable 115467
+ nr_slab_reclaimable 131220
+ nr_slab_unreclaimable 47320
+ nr_isolated_anon 0
+ nr_isolated_file 0
+ workingset_nodes 11627
+ workingset_refault 466886
+ workingset_activate 276925
+ workingset_restore 84055
+ workingset_nodereclaim 487
+ nr_anon_pages 795576
+ nr_mapped 215483
+ nr_file_pages 761874
+ nr_dirty 908
+ nr_writeback 0
+ nr_writeback_temp 0
+ nr_shmem 224925
+ nr_shmem_hugepages 0
+ nr_shmem_pmdmapped 0
+ nr_anon_transparent_hugepages 0
+ nr_unstable 0
+ nr_vmscan_write 12950
+ nr_vmscan_immediate_reclaim 3033
+ nr_dirtied 8007423
+ nr_written 7752121
+ nr_kernel_misc_reclaimable 0
+ pages free 3952
+ min 33
+ low 41
+ high 49
+ spanned 4095
+ present 3975
+ managed 3956
+ protection: (0, 2877, 7826, 7826, 7826)
+ nr_free_pages 3952
+ nr_zone_inactive_anon 0
+ nr_zone_active_anon 0
+ nr_zone_inactive_file 0
+ nr_zone_active_file 0
+ nr_zone_unevictable 0
+ nr_zone_write_pending 0
+ nr_mlock 0
+ nr_page_table_pages 0
+ nr_kernel_stack 0
+ nr_bounce 0
+ nr_zspages 0
+ nr_free_cma 0
+ numa_hit 1
+ numa_miss 0
+ numa_foreign 0
+ numa_interleave 0
+ numa_local 1
+ numa_other 0
+ pagesets
+ cpu: 0
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 1
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 2
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 3
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 4
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 5
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 6
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ cpu: 7
+ count: 0
+ high: 0
+ batch: 1
+ vm stats threshold: 8
+ node_unreclaimable: 0
+ start_pfn: 1
+Node 0, zone DMA32
+ pages free 204252
+ min 19510
+ low 21059
+ high 22608
+ spanned 1044480
+ present 759231
+ managed 742806
+ protection: (0, 0, 4949, 4949, 4949)
+ nr_free_pages 204252
+ nr_zone_inactive_anon 118558
+ nr_zone_active_anon 106598
+ nr_zone_inactive_file 75475
+ nr_zone_active_file 70293
+ nr_zone_unevictable 66195
+ nr_zone_write_pending 64
+ nr_mlock 4
+ nr_page_table_pages 1756
+ nr_kernel_stack 2208
+ nr_bounce 0
+ nr_zspages 0
+ nr_free_cma 0
+ numa_hit 113952967
+ numa_miss 0
+ numa_foreign 0
+ numa_interleave 0
+ numa_local 113952967
+ numa_other 0
+ pagesets
+ cpu: 0
+ count: 345
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 1
+ count: 356
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 2
+ count: 325
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 3
+ count: 346
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 4
+ count: 321
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 5
+ count: 316
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 6
+ count: 373
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ cpu: 7
+ count: 339
+ high: 378
+ batch: 63
+ vm stats threshold: 48
+ node_unreclaimable: 0
+ start_pfn: 4096
+Node 0, zone Normal
+ pages free 18553
+ min 11176
+ low 13842
+ high 16508
+ spanned 1308160
+ present 1308160
+ managed 1268711
+ protection: (0, 0, 0, 0, 0)
+ nr_free_pages 18553
+ nr_zone_inactive_anon 112423
+ nr_zone_active_anon 440982
+ nr_zone_inactive_file 241429
+ nr_zone_active_file 275989
+ nr_zone_unevictable 49272
+ nr_zone_write_pending 844
+ nr_mlock 154
+ nr_page_table_pages 9750
+ nr_kernel_stack 15136
+ nr_bounce 0
+ nr_zspages 0
+ nr_free_cma 0
+ numa_hit 162718019
+ numa_miss 0
+ numa_foreign 0
+ numa_interleave 26812
+ numa_local 162718019
+ numa_other 0
+ pagesets
+ cpu: 0
+ count: 316
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 1
+ count: 366
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 2
+ count: 60
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 3
+ count: 256
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 4
+ count: 253
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 5
+ count: 159
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 6
+ count: 311
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ cpu: 7
+ count: 264
+ high: 378
+ batch: 63
+ vm stats threshold: 56
+ node_unreclaimable: 0
+ start_pfn: 1048576
+Node 0, zone Movable
+ pages free 0
+ min 0
+ low 0
+ high 0
+ spanned 0
+ present 0
+ managed 0
+ protection: (0, 0, 0, 0, 0)
+Node 0, zone Device
+ pages free 0
+ min 0
+ low 0
+ high 0
+ spanned 0
+ present 0
+ managed 0
+ protection: (0, 0, 0, 0, 0)
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -921,6 +2683,9 @@ Lines: 1
0x20
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/net/eth0/device
+SymlinkTo: ../../../devices/pci0000:00/0000:00:1f.6/
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path: fixtures/sys/class/net/eth0/dormant
Lines: 1
1
@@ -1005,146 +2770,51 @@ Mode: 644
Directory: fixtures/sys/class/power_supply
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Directory: fixtures/sys/class/power_supply/AC
-Mode: 755
+Path: fixtures/sys/class/power_supply/AC
+SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/AC/online
-Lines: 1
-0
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/AC/type
-Lines: 1
-Mains
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/AC/uevent
-Lines: 2
-POWER_SUPPLY_NAME=AC
-POWER_SUPPLY_ONLINE=0
-Mode: 644
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Directory: fixtures/sys/class/power_supply/BAT0
-Mode: 755
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/alarm
-Lines: 1
-2503000
-Mode: 644
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/capacity
-Lines: 1
-98
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/capacity_level
-Lines: 1
-Normal
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/charge_start_threshold
-Lines: 1
-95
-Mode: 644
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/charge_stop_threshold
-Lines: 1
-100
-Mode: 644
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/cycle_count
-Lines: 1
-0
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/energy_full
-Lines: 1
-50060000
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/energy_full_design
-Lines: 1
-47520000
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/energy_now
-Lines: 1
-49450000
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/manufacturer
-Lines: 1
-LGC
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/model_name
-Lines: 1
-LNV-45N1
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/power_now
-Lines: 1
-4830000
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/present
-Lines: 1
-1
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/serial_number
-Lines: 1
-38109
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/status
-Lines: 1
-Discharging
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/technology
-Lines: 1
-Li-ion
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/type
-Lines: 1
-Battery
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/uevent
-Lines: 16
-POWER_SUPPLY_NAME=BAT0
-POWER_SUPPLY_STATUS=Discharging
-POWER_SUPPLY_PRESENT=1
-POWER_SUPPLY_TECHNOLOGY=Li-ion
-POWER_SUPPLY_CYCLE_COUNT=0
-POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000
-POWER_SUPPLY_VOLTAGE_NOW=12229000
-POWER_SUPPLY_POWER_NOW=4830000
-POWER_SUPPLY_ENERGY_FULL_DESIGN=47520000
-POWER_SUPPLY_ENERGY_FULL=50060000
-POWER_SUPPLY_ENERGY_NOW=49450000
-POWER_SUPPLY_CAPACITY=98
-POWER_SUPPLY_CAPACITY_LEVEL=Normal
-POWER_SUPPLY_MODEL_NAME=LNV-45N1
-POWER_SUPPLY_MANUFACTURER=LGC
-POWER_SUPPLY_SERIAL_NUMBER=38109
-Mode: 644
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/voltage_min_design
-Lines: 1
-10800000
-Mode: 444
-# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Path: fixtures/sys/class/power_supply/BAT0/voltage_now
-Lines: 1
-12229000
-Mode: 444
+Path: fixtures/sys/class/power_supply/BAT0
+SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/class/thermal
Mode: 775
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/class/thermal/cooling_device0
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device0/cur_state
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device0/max_state
+Lines: 1
+50
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device0/type
+Lines: 1
+Processor
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/class/thermal/cooling_device1
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device1/cur_state
+Lines: 1
+-1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device1/max_state
+Lines: 1
+27
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/class/thermal/cooling_device1/type
+Lines: 1
+intel_powerclamp
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/class/thermal/thermal_zone0
Mode: 775
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1194,6 +2864,326 @@ Mode: 664
Directory: fixtures/sys/devices
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/device
+SymlinkTo: ../../../ACPI0003:00
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/online
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/async
+Lines: 1
+disabled
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/autosuspend_delay_ms
+Lines: 0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/control
+Lines: 1
+auto
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_kids
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_time
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_enabled
+Lines: 1
+disabled
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_status
+Lines: 1
+unsupported
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_suspended_time
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_usage
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup
+Lines: 1
+enabled
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_abort_count
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active_count
+Lines: 1
+1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_count
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_expire_count
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_last_time_ms
+Lines: 1
+10598
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_max_time_ms
+Lines: 1
+1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_prevent_sleep_time_ms
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_total_time_ms
+Lines: 1
+1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/subsystem
+SymlinkTo: ../../../../../../../../../class/power_supply
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/type
+Lines: 1
+Mains
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/uevent
+Lines: 2
+POWER_SUPPLY_NAME=AC
+POWER_SUPPLY_ONLINE=0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/alarm
+Lines: 1
+2369000
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity
+Lines: 1
+98
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity_level
+Lines: 1
+Normal
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_start_threshold
+Lines: 1
+95
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_stop_threshold
+Lines: 1
+100
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/cycle_count
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/device
+SymlinkTo: ../../../PNP0C0A:00
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full
+Lines: 1
+50060000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full_design
+Lines: 1
+47520000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_now
+Lines: 1
+49450000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/manufacturer
+Lines: 1
+LGC
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/model_name
+Lines: 1
+LNV-45N1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/async
+Lines: 1
+disabled
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/autosuspend_delay_ms
+Lines: 0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/control
+Lines: 1
+auto
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_kids
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_time
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_enabled
+Lines: 1
+disabled
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_status
+Lines: 1
+unsupported
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_suspended_time
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_usage
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power_now
+Lines: 1
+4830000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/present
+Lines: 1
+1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/serial_number
+Lines: 1
+38109
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/status
+Lines: 1
+Discharging
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/subsystem
+SymlinkTo: ../../../../../../../../../class/power_supply
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/technology
+Lines: 1
+Li-ion
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/type
+Lines: 1
+Battery
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/uevent
+Lines: 16
+POWER_SUPPLY_NAME=BAT0
+POWER_SUPPLY_STATUS=Discharging
+POWER_SUPPLY_PRESENT=1
+POWER_SUPPLY_TECHNOLOGY=Li-ion
+POWER_SUPPLY_CYCLE_COUNT=0
+POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000
+POWER_SUPPLY_VOLTAGE_NOW=11750000
+POWER_SUPPLY_POWER_NOW=5064000
+POWER_SUPPLY_ENERGY_FULL_DESIGN=47520000
+POWER_SUPPLY_ENERGY_FULL=47390000
+POWER_SUPPLY_ENERGY_NOW=40730000
+POWER_SUPPLY_CAPACITY=85
+POWER_SUPPLY_CAPACITY_LEVEL=Normal
+POWER_SUPPLY_MODEL_NAME=LNV-45N1
+POWER_SUPPLY_MANUFACTURER=LGC
+POWER_SUPPLY_SERIAL_NUMBER=38109
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_min_design
+Lines: 1
+10800000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_now
+Lines: 1
+12229000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/devices/pci0000:00
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1443,6 +3433,131 @@ Lines: 1
0
Mode: 644
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/pci0000:00/0000:00:1f.6
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/ari_enabled
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/broken_parity_status
+Lines: 1
+0
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/class
+Lines: 1
+0x020000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/consistent_dma_mask_bits
+Lines: 1
+64
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/d3cold_allowed
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/device
+Lines: 1
+0x15d7
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/dma_mask_bits
+Lines: 1
+64
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/driver_override
+Lines: 1
+(null)
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/enable
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/irq
+Lines: 1
+140
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/local_cpulist
+Lines: 1
+0-7
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/local_cpus
+Lines: 1
+ff
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/modalias
+Lines: 1
+pci:v00008086d000015D7sv000017AAsd0000225Abc02sc00i00
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/msi_bus
+Lines: 1
+1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/numa_node
+Lines: 1
+-1
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/resource
+Lines: 13
+0x00000000ec200000 0x00000000ec21ffff 0x0000000000040200
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+0x0000000000000000 0x0000000000000000 0x0000000000000000
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/revision
+Lines: 1
+0x21
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/subsystem_device
+Lines: 1
+0x225a
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/subsystem_vendor
+Lines: 1
+0x17aa
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/uevent
+Lines: 6
+DRIVER=e1000e
+PCI_CLASS=20000
+PCI_ID=8086:15D7
+PCI_SUBSYS_ID=17AA:225A
+PCI_SLOT_NAME=0000:00:1f.6
+MODALIAS=pci:v00008086d000015D7sv000017AAsd0000225Abc02sc00i00
+Mode: 644
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/pci0000:00/0000:00:1f.6/vendor
+Lines: 1
+0x8086
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/devices/rbd
Mode: 755
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1500,6 +3615,52 @@ Mode: 775
Path: fixtures/sys/devices/system/cpu/cpu0/cpufreq
SymlinkTo: ../cpufreq/policy0
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count
+Lines: 1
+10084
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/thermal_throttle/package_throttle_count
+Lines: 1
+34818
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/system/cpu/cpu0/topology
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_id
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_siblings
+Lines: 1
+ff
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/core_siblings_list
+Lines: 1
+0-7
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/physical_package_id
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/thread_siblings
+Lines: 1
+11
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu0/topology/thread_siblings_list
+Lines: 1
+0,4
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/devices/system/cpu/cpu1
Mode: 775
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1561,6 +3722,52 @@ Lines: 1
Mode: 664
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle/core_throttle_count
+Lines: 1
+523
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/thermal_throttle/package_throttle_count
+Lines: 1
+34818
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Directory: fixtures/sys/devices/system/cpu/cpu1/topology
+Mode: 755
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_id
+Lines: 1
+1
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_siblings
+Lines: 1
+ff
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/core_siblings_list
+Lines: 1
+0-7
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/physical_package_id
+Lines: 1
+0
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/thread_siblings
+Lines: 1
+22
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Path: fixtures/sys/devices/system/cpu/cpu1/topology/thread_siblings_list
+Lines: 1
+1,5
+Mode: 444
+# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Directory: fixtures/sys/devices/system/cpu/cpufreq
Mode: 775
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/vendor/github.com/prometheus/procfs/internal/util/parse.go b/vendor/github.com/prometheus/procfs/internal/util/parse.go
new file mode 100644
index 0000000000..755591d9a5
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/internal/util/parse.go
@@ -0,0 +1,88 @@
+// Copyright 2018 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package util
+
+import (
+ "io/ioutil"
+ "strconv"
+ "strings"
+)
+
+// ParseUint32s parses a slice of strings into a slice of uint32s.
+func ParseUint32s(ss []string) ([]uint32, error) {
+ us := make([]uint32, 0, len(ss))
+ for _, s := range ss {
+ u, err := strconv.ParseUint(s, 10, 32)
+ if err != nil {
+ return nil, err
+ }
+
+ us = append(us, uint32(u))
+ }
+
+ return us, nil
+}
+
+// ParseUint64s parses a slice of strings into a slice of uint64s.
+func ParseUint64s(ss []string) ([]uint64, error) {
+ us := make([]uint64, 0, len(ss))
+ for _, s := range ss {
+ u, err := strconv.ParseUint(s, 10, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ us = append(us, u)
+ }
+
+ return us, nil
+}
+
+// ParsePInt64s parses a slice of strings into a slice of int64 pointers.
+func ParsePInt64s(ss []string) ([]*int64, error) {
+ us := make([]*int64, 0, len(ss))
+ for _, s := range ss {
+ u, err := strconv.ParseInt(s, 10, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ us = append(us, &u)
+ }
+
+ return us, nil
+}
+
+// ReadUintFromFile reads a file and attempts to parse a uint64 from it.
+func ReadUintFromFile(path string) (uint64, error) {
+ data, err := ioutil.ReadFile(path)
+ if err != nil {
+ return 0, err
+ }
+ return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
+}
+
+// ParseBool parses a string into a boolean pointer.
+func ParseBool(b string) *bool {
+ var truth bool
+ switch b {
+ case "enabled":
+ truth = true
+ case "disabled":
+ truth = false
+ default:
+ return nil
+ }
+ return &truth
+}
diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go
new file mode 100644
index 0000000000..68b37c4b3c
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go
@@ -0,0 +1,45 @@
+// Copyright 2018 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// +build linux,!appengine
+
+package util
+
+import (
+ "bytes"
+ "os"
+ "syscall"
+)
+
+// SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly.
+// https://github.com/prometheus/node_exporter/pull/728/files
+func SysReadFile(file string) (string, error) {
+ f, err := os.Open(file)
+ if err != nil {
+ return "", err
+ }
+ defer f.Close()
+
+ // On some machines, hwmon drivers are broken and return EAGAIN. This causes
+ // Go's ioutil.ReadFile implementation to poll forever.
+ //
+ // Since we either want to read data or bail immediately, do the simplest
+ // possible read using syscall directly.
+ b := make([]byte, 128)
+ n, err := syscall.Read(int(f.Fd()), b)
+ if err != nil {
+ return "", err
+ }
+
+ return string(bytes.TrimSpace(b[:n])), nil
+}
diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go
new file mode 100644
index 0000000000..bd55b45377
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go
@@ -0,0 +1,26 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// +build linux,appengine !linux
+
+package util
+
+import (
+ "fmt"
+)
+
+// SysReadFile is here implemented as a noop for builds that do not support
+// the read syscall. For example Windows, or Linux on Google App Engine.
+func SysReadFile(file string) (string, error) {
+ return "", fmt.Errorf("not supported on this platform")
+}
diff --git a/vendor/github.com/prometheus/procfs/internal/util/valueparser.go b/vendor/github.com/prometheus/procfs/internal/util/valueparser.go
new file mode 100644
index 0000000000..ac93cb42d2
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/internal/util/valueparser.go
@@ -0,0 +1,77 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package util
+
+import (
+ "strconv"
+)
+
+// TODO(mdlayher): util packages are an anti-pattern and this should be moved
+// somewhere else that is more focused in the future.
+
+// A ValueParser enables parsing a single string into a variety of data types
+// in a concise and safe way. The Err method must be invoked after invoking
+// any other methods to ensure a value was successfully parsed.
+type ValueParser struct {
+ v string
+ err error
+}
+
+// NewValueParser creates a ValueParser using the input string.
+func NewValueParser(v string) *ValueParser {
+ return &ValueParser{v: v}
+}
+
+// PInt64 interprets the underlying value as an int64 and returns a pointer to
+// that value.
+func (vp *ValueParser) PInt64() *int64 {
+ if vp.err != nil {
+ return nil
+ }
+
+ // A base value of zero makes ParseInt infer the correct base using the
+ // string's prefix, if any.
+ const base = 0
+ v, err := strconv.ParseInt(vp.v, base, 64)
+ if err != nil {
+ vp.err = err
+ return nil
+ }
+
+ return &v
+}
+
+// PUInt64 interprets the underlying value as an uint64 and returns a pointer to
+// that value.
+func (vp *ValueParser) PUInt64() *uint64 {
+ if vp.err != nil {
+ return nil
+ }
+
+ // A base value of zero makes ParseInt infer the correct base using the
+ // string's prefix, if any.
+ const base = 0
+ v, err := strconv.ParseUint(vp.v, base, 64)
+ if err != nil {
+ vp.err = err
+ return nil
+ }
+
+ return &v
+}
+
+// Err returns the last error, if any, encountered by the ValueParser.
+func (vp *ValueParser) Err() error {
+ return vp.err
+}
diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go
new file mode 100644
index 0000000000..6fcad20afc
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/net_softnet.go
@@ -0,0 +1,91 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "fmt"
+ "io/ioutil"
+ "strconv"
+ "strings"
+)
+
+// For the proc file format details,
+// see https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162
+// and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810.
+
+// SoftnetEntry contains a single row of data from /proc/net/softnet_stat
+type SoftnetEntry struct {
+ // Number of processed packets
+ Processed uint
+ // Number of dropped packets
+ Dropped uint
+ // Number of times processing packets ran out of quota
+ TimeSqueezed uint
+}
+
+// GatherSoftnetStats reads /proc/net/softnet_stat, parse the relevant columns,
+// and then return a slice of SoftnetEntry's.
+func (fs FS) GatherSoftnetStats() ([]SoftnetEntry, error) {
+ data, err := ioutil.ReadFile(fs.proc.Path("net/softnet_stat"))
+ if err != nil {
+ return nil, fmt.Errorf("error reading softnet %s: %s", fs.proc.Path("net/softnet_stat"), err)
+ }
+
+ return parseSoftnetEntries(data)
+}
+
+func parseSoftnetEntries(data []byte) ([]SoftnetEntry, error) {
+ lines := strings.Split(string(data), "\n")
+ entries := make([]SoftnetEntry, 0)
+ var err error
+ const (
+ expectedColumns = 11
+ )
+ for _, line := range lines {
+ columns := strings.Fields(line)
+ width := len(columns)
+ if width == 0 {
+ continue
+ }
+ if width != expectedColumns {
+ return []SoftnetEntry{}, fmt.Errorf("%d columns were detected, but %d were expected", width, expectedColumns)
+ }
+ var entry SoftnetEntry
+ if entry, err = parseSoftnetEntry(columns); err != nil {
+ return []SoftnetEntry{}, err
+ }
+ entries = append(entries, entry)
+ }
+
+ return entries, nil
+}
+
+func parseSoftnetEntry(columns []string) (SoftnetEntry, error) {
+ var err error
+ var processed, dropped, timeSqueezed uint64
+ if processed, err = strconv.ParseUint(columns[0], 16, 32); err != nil {
+ return SoftnetEntry{}, fmt.Errorf("Unable to parse column 0: %s", err)
+ }
+ if dropped, err = strconv.ParseUint(columns[1], 16, 32); err != nil {
+ return SoftnetEntry{}, fmt.Errorf("Unable to parse column 1: %s", err)
+ }
+ if timeSqueezed, err = strconv.ParseUint(columns[2], 16, 32); err != nil {
+ return SoftnetEntry{}, fmt.Errorf("Unable to parse column 2: %s", err)
+ }
+ return SoftnetEntry{
+ Processed: uint(processed),
+ Dropped: uint(dropped),
+ TimeSqueezed: uint(timeSqueezed),
+ }, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go
index 41c148d066..b7c79cf77b 100644
--- a/vendor/github.com/prometheus/procfs/proc.go
+++ b/vendor/github.com/prometheus/procfs/proc.go
@@ -279,3 +279,33 @@ func (p Proc) fileDescriptors() ([]string, error) {
func (p Proc) path(pa ...string) string {
return p.fs.Path(append([]string{strconv.Itoa(p.PID)}, pa...)...)
}
+
+// FileDescriptorsInfo retrieves information about all file descriptors of
+// the process.
+func (p Proc) FileDescriptorsInfo() (ProcFDInfos, error) {
+ names, err := p.fileDescriptors()
+ if err != nil {
+ return nil, err
+ }
+
+ var fdinfos ProcFDInfos
+
+ for _, n := range names {
+ fdinfo, err := p.FDInfo(n)
+ if err != nil {
+ continue
+ }
+ fdinfos = append(fdinfos, *fdinfo)
+ }
+
+ return fdinfos, nil
+}
+
+// Schedstat returns task scheduling information for the process.
+func (p Proc) Schedstat() (ProcSchedstat, error) {
+ contents, err := ioutil.ReadFile(p.path("schedstat"))
+ if err != nil {
+ return ProcSchedstat{}, err
+ }
+ return parseProcSchedstat(string(contents))
+}
diff --git a/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
new file mode 100644
index 0000000000..83b67d1bde
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
@@ -0,0 +1,132 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "bufio"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "regexp"
+ "strings"
+)
+
+// Regexp variables
+var (
+ rPos = regexp.MustCompile(`^pos:\s+(\d+)$`)
+ rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`)
+ rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`)
+ rInotify = regexp.MustCompile(`^inotify`)
+)
+
+// ProcFDInfo contains represents file descriptor information.
+type ProcFDInfo struct {
+ // File descriptor
+ FD string
+ // File offset
+ Pos string
+ // File access mode and status flags
+ Flags string
+ // Mount point ID
+ MntID string
+ // List of inotify lines (structed) in the fdinfo file (kernel 3.8+ only)
+ InotifyInfos []InotifyInfo
+}
+
+// FDInfo constructor. On kernels older than 3.8, InotifyInfos will always be empty.
+func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
+ f, err := os.Open(p.path("fdinfo", fd))
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+
+ fdinfo, err := ioutil.ReadAll(f)
+ if err != nil {
+ return nil, fmt.Errorf("could not read %s: %s", f.Name(), err)
+ }
+
+ var text, pos, flags, mntid string
+ var inotify []InotifyInfo
+
+ scanner := bufio.NewScanner(strings.NewReader(string(fdinfo)))
+ for scanner.Scan() {
+ text = scanner.Text()
+ if rPos.MatchString(text) {
+ pos = rPos.FindStringSubmatch(text)[1]
+ } else if rFlags.MatchString(text) {
+ flags = rFlags.FindStringSubmatch(text)[1]
+ } else if rMntID.MatchString(text) {
+ mntid = rMntID.FindStringSubmatch(text)[1]
+ } else if rInotify.MatchString(text) {
+ newInotify, err := parseInotifyInfo(text)
+ if err != nil {
+ return nil, err
+ }
+ inotify = append(inotify, *newInotify)
+ }
+ }
+
+ i := &ProcFDInfo{
+ FD: fd,
+ Pos: pos,
+ Flags: flags,
+ MntID: mntid,
+ InotifyInfos: inotify,
+ }
+
+ return i, nil
+}
+
+// InotifyInfo represents a single inotify line in the fdinfo file.
+type InotifyInfo struct {
+ // Watch descriptor number
+ WD string
+ // Inode number
+ Ino string
+ // Device ID
+ Sdev string
+ // Mask of events being monitored
+ Mask string
+}
+
+// InotifyInfo constructor. Only available on kernel 3.8+.
+func parseInotifyInfo(line string) (*InotifyInfo, error) {
+ r := regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)\s+mask:([0-9a-f]+)`)
+ m := r.FindStringSubmatch(line)
+ i := &InotifyInfo{
+ WD: m[1],
+ Ino: m[2],
+ Sdev: m[3],
+ Mask: m[4],
+ }
+ return i, nil
+}
+
+// ProcFDInfos represents a list of ProcFDInfo structs.
+type ProcFDInfos []ProcFDInfo
+
+func (p ProcFDInfos) Len() int { return len(p) }
+func (p ProcFDInfos) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
+func (p ProcFDInfos) Less(i, j int) bool { return p[i].FD < p[j].FD }
+
+// InotifyWatchLen returns the total number of inotify watches
+func (p ProcFDInfos) InotifyWatchLen() (int, error) {
+ length := 0
+ for _, f := range p {
+ length += len(f.InotifyInfos)
+ }
+
+ return length, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go
index 6b4b61f71c..ad290fae7d 100644
--- a/vendor/github.com/prometheus/procfs/proc_status.go
+++ b/vendor/github.com/prometheus/procfs/proc_status.go
@@ -21,7 +21,7 @@ import (
"strings"
)
-// ProcStat provides status information about the process,
+// ProcStatus provides status information about the process,
// read from /proc/[pid]/stat.
type ProcStatus struct {
// The process ID.
@@ -29,6 +29,9 @@ type ProcStatus struct {
// The process name.
Name string
+ // Thread group ID.
+ TGID int
+
// Peak virtual memory size.
VmPeak uint64
// Virtual memory size.
@@ -113,6 +116,8 @@ func (p Proc) NewStatus() (ProcStatus, error) {
func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintBytes uint64) {
switch k {
+ case "Tgid":
+ s.TGID = int(vUint)
case "Name":
s.Name = vString
case "VmPeak":
diff --git a/vendor/github.com/prometheus/procfs/schedstat.go b/vendor/github.com/prometheus/procfs/schedstat.go
new file mode 100644
index 0000000000..a4c4089ac5
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/schedstat.go
@@ -0,0 +1,118 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package procfs
+
+import (
+ "bufio"
+ "errors"
+ "os"
+ "regexp"
+ "strconv"
+)
+
+var (
+ cpuLineRE = regexp.MustCompile(`cpu(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+)`)
+ procLineRE = regexp.MustCompile(`(\d+) (\d+) (\d+)`)
+)
+
+// Schedstat contains scheduler statistics from /proc/schedstat
+//
+// See
+// https://www.kernel.org/doc/Documentation/scheduler/sched-stats.txt
+// for a detailed description of what these numbers mean.
+//
+// Note the current kernel documentation claims some of the time units are in
+// jiffies when they are actually in nanoseconds since 2.6.23 with the
+// introduction of CFS. A fix to the documentation is pending. See
+// https://lore.kernel.org/patchwork/project/lkml/list/?series=403473
+type Schedstat struct {
+ CPUs []*SchedstatCPU
+}
+
+// SchedstatCPU contains the values from one "cpu" line
+type SchedstatCPU struct {
+ CPUNum string
+
+ RunningNanoseconds uint64
+ WaitingNanoseconds uint64
+ RunTimeslices uint64
+}
+
+// ProcSchedstat contains the values from /proc//schedstat
+type ProcSchedstat struct {
+ RunningNanoseconds uint64
+ WaitingNanoseconds uint64
+ RunTimeslices uint64
+}
+
+// Schedstat reads data from /proc/schedstat
+func (fs FS) Schedstat() (*Schedstat, error) {
+ file, err := os.Open(fs.proc.Path("schedstat"))
+ if err != nil {
+ return nil, err
+ }
+ defer file.Close()
+
+ stats := &Schedstat{}
+ scanner := bufio.NewScanner(file)
+
+ for scanner.Scan() {
+ match := cpuLineRE.FindStringSubmatch(scanner.Text())
+ if match != nil {
+ cpu := &SchedstatCPU{}
+ cpu.CPUNum = match[1]
+
+ cpu.RunningNanoseconds, err = strconv.ParseUint(match[8], 10, 64)
+ if err != nil {
+ continue
+ }
+
+ cpu.WaitingNanoseconds, err = strconv.ParseUint(match[9], 10, 64)
+ if err != nil {
+ continue
+ }
+
+ cpu.RunTimeslices, err = strconv.ParseUint(match[10], 10, 64)
+ if err != nil {
+ continue
+ }
+
+ stats.CPUs = append(stats.CPUs, cpu)
+ }
+ }
+
+ return stats, nil
+}
+
+func parseProcSchedstat(contents string) (stats ProcSchedstat, err error) {
+ match := procLineRE.FindStringSubmatch(contents)
+
+ if match != nil {
+ stats.RunningNanoseconds, err = strconv.ParseUint(match[1], 10, 64)
+ if err != nil {
+ return
+ }
+
+ stats.WaitingNanoseconds, err = strconv.ParseUint(match[2], 10, 64)
+ if err != nil {
+ return
+ }
+
+ stats.RunTimeslices, err = strconv.ParseUint(match[3], 10, 64)
+ return
+ }
+
+ err = errors.New("could not parse schedstat")
+ return
+}
diff --git a/vendor/github.com/prometheus/procfs/vm.go b/vendor/github.com/prometheus/procfs/vm.go
new file mode 100644
index 0000000000..cb13891414
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/vm.go
@@ -0,0 +1,210 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// +build !windows
+
+package procfs
+
+import (
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/prometheus/procfs/internal/util"
+)
+
+// The VM interface is described at
+// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
+// Each setting is exposed as a single file.
+// Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array
+// and numa_zonelist_order (deprecated) which is a string
+type VM struct {
+ AdminReserveKbytes *int64 // /proc/sys/vm/admin_reserve_kbytes
+ BlockDump *int64 // /proc/sys/vm/block_dump
+ CompactUnevictableAllowed *int64 // /proc/sys/vm/compact_unevictable_allowed
+ DirtyBackgroundBytes *int64 // /proc/sys/vm/dirty_background_bytes
+ DirtyBackgroundRatio *int64 // /proc/sys/vm/dirty_background_ratio
+ DirtyBytes *int64 // /proc/sys/vm/dirty_bytes
+ DirtyExpireCentisecs *int64 // /proc/sys/vm/dirty_expire_centisecs
+ DirtyRatio *int64 // /proc/sys/vm/dirty_ratio
+ DirtytimeExpireSeconds *int64 // /proc/sys/vm/dirtytime_expire_seconds
+ DirtyWritebackCentisecs *int64 // /proc/sys/vm/dirty_writeback_centisecs
+ DropCaches *int64 // /proc/sys/vm/drop_caches
+ ExtfragThreshold *int64 // /proc/sys/vm/extfrag_threshold
+ HugetlbShmGroup *int64 // /proc/sys/vm/hugetlb_shm_group
+ LaptopMode *int64 // /proc/sys/vm/laptop_mode
+ LegacyVaLayout *int64 // /proc/sys/vm/legacy_va_layout
+ LowmemReserveRatio []*int64 // /proc/sys/vm/lowmem_reserve_ratio
+ MaxMapCount *int64 // /proc/sys/vm/max_map_count
+ MemoryFailureEarlyKill *int64 // /proc/sys/vm/memory_failure_early_kill
+ MemoryFailureRecovery *int64 // /proc/sys/vm/memory_failure_recovery
+ MinFreeKbytes *int64 // /proc/sys/vm/min_free_kbytes
+ MinSlabRatio *int64 // /proc/sys/vm/min_slab_ratio
+ MinUnmappedRatio *int64 // /proc/sys/vm/min_unmapped_ratio
+ MmapMinAddr *int64 // /proc/sys/vm/mmap_min_addr
+ NrHugepages *int64 // /proc/sys/vm/nr_hugepages
+ NrHugepagesMempolicy *int64 // /proc/sys/vm/nr_hugepages_mempolicy
+ NrOvercommitHugepages *int64 // /proc/sys/vm/nr_overcommit_hugepages
+ NumaStat *int64 // /proc/sys/vm/numa_stat
+ NumaZonelistOrder string // /proc/sys/vm/numa_zonelist_order
+ OomDumpTasks *int64 // /proc/sys/vm/oom_dump_tasks
+ OomKillAllocatingTask *int64 // /proc/sys/vm/oom_kill_allocating_task
+ OvercommitKbytes *int64 // /proc/sys/vm/overcommit_kbytes
+ OvercommitMemory *int64 // /proc/sys/vm/overcommit_memory
+ OvercommitRatio *int64 // /proc/sys/vm/overcommit_ratio
+ PageCluster *int64 // /proc/sys/vm/page-cluster
+ PanicOnOom *int64 // /proc/sys/vm/panic_on_oom
+ PercpuPagelistFraction *int64 // /proc/sys/vm/percpu_pagelist_fraction
+ StatInterval *int64 // /proc/sys/vm/stat_interval
+ Swappiness *int64 // /proc/sys/vm/swappiness
+ UserReserveKbytes *int64 // /proc/sys/vm/user_reserve_kbytes
+ VfsCachePressure *int64 // /proc/sys/vm/vfs_cache_pressure
+ WatermarkBoostFactor *int64 // /proc/sys/vm/watermark_boost_factor
+ WatermarkScaleFactor *int64 // /proc/sys/vm/watermark_scale_factor
+ ZoneReclaimMode *int64 // /proc/sys/vm/zone_reclaim_mode
+}
+
+// VM reads the VM statistics from the specified `proc` filesystem.
+func (fs FS) VM() (*VM, error) {
+ path := fs.proc.Path("sys/vm")
+ file, err := os.Stat(path)
+ if err != nil {
+ return nil, err
+ }
+ if !file.Mode().IsDir() {
+ return nil, fmt.Errorf("%s is not a directory", path)
+ }
+
+ files, err := ioutil.ReadDir(path)
+ if err != nil {
+ return nil, err
+ }
+
+ var vm VM
+ for _, f := range files {
+ if f.IsDir() {
+ continue
+ }
+
+ name := filepath.Join(path, f.Name())
+ // ignore errors on read, as there are some write only
+ // in /proc/sys/vm
+ value, err := util.SysReadFile(name)
+ if err != nil {
+ continue
+ }
+ vp := util.NewValueParser(value)
+
+ switch f.Name() {
+ case "admin_reserve_kbytes":
+ vm.AdminReserveKbytes = vp.PInt64()
+ case "block_dump":
+ vm.BlockDump = vp.PInt64()
+ case "compact_unevictable_allowed":
+ vm.CompactUnevictableAllowed = vp.PInt64()
+ case "dirty_background_bytes":
+ vm.DirtyBackgroundBytes = vp.PInt64()
+ case "dirty_background_ratio":
+ vm.DirtyBackgroundRatio = vp.PInt64()
+ case "dirty_bytes":
+ vm.DirtyBytes = vp.PInt64()
+ case "dirty_expire_centisecs":
+ vm.DirtyExpireCentisecs = vp.PInt64()
+ case "dirty_ratio":
+ vm.DirtyRatio = vp.PInt64()
+ case "dirtytime_expire_seconds":
+ vm.DirtytimeExpireSeconds = vp.PInt64()
+ case "dirty_writeback_centisecs":
+ vm.DirtyWritebackCentisecs = vp.PInt64()
+ case "drop_caches":
+ vm.DropCaches = vp.PInt64()
+ case "extfrag_threshold":
+ vm.ExtfragThreshold = vp.PInt64()
+ case "hugetlb_shm_group":
+ vm.HugetlbShmGroup = vp.PInt64()
+ case "laptop_mode":
+ vm.LaptopMode = vp.PInt64()
+ case "legacy_va_layout":
+ vm.LegacyVaLayout = vp.PInt64()
+ case "lowmem_reserve_ratio":
+ stringSlice := strings.Fields(value)
+ pint64Slice := make([]*int64, 0, len(stringSlice))
+ for _, value := range stringSlice {
+ vp := util.NewValueParser(value)
+ pint64Slice = append(pint64Slice, vp.PInt64())
+ }
+ vm.LowmemReserveRatio = pint64Slice
+ case "max_map_count":
+ vm.MaxMapCount = vp.PInt64()
+ case "memory_failure_early_kill":
+ vm.MemoryFailureEarlyKill = vp.PInt64()
+ case "memory_failure_recovery":
+ vm.MemoryFailureRecovery = vp.PInt64()
+ case "min_free_kbytes":
+ vm.MinFreeKbytes = vp.PInt64()
+ case "min_slab_ratio":
+ vm.MinSlabRatio = vp.PInt64()
+ case "min_unmapped_ratio":
+ vm.MinUnmappedRatio = vp.PInt64()
+ case "mmap_min_addr":
+ vm.MmapMinAddr = vp.PInt64()
+ case "nr_hugepages":
+ vm.NrHugepages = vp.PInt64()
+ case "nr_hugepages_mempolicy":
+ vm.NrHugepagesMempolicy = vp.PInt64()
+ case "nr_overcommit_hugepages":
+ vm.NrOvercommitHugepages = vp.PInt64()
+ case "numa_stat":
+ vm.NumaStat = vp.PInt64()
+ case "numa_zonelist_order":
+ vm.NumaZonelistOrder = value
+ case "oom_dump_tasks":
+ vm.OomDumpTasks = vp.PInt64()
+ case "oom_kill_allocating_task":
+ vm.OomKillAllocatingTask = vp.PInt64()
+ case "overcommit_kbytes":
+ vm.OvercommitKbytes = vp.PInt64()
+ case "overcommit_memory":
+ vm.OvercommitMemory = vp.PInt64()
+ case "overcommit_ratio":
+ vm.OvercommitRatio = vp.PInt64()
+ case "page-cluster":
+ vm.PageCluster = vp.PInt64()
+ case "panic_on_oom":
+ vm.PanicOnOom = vp.PInt64()
+ case "percpu_pagelist_fraction":
+ vm.PercpuPagelistFraction = vp.PInt64()
+ case "stat_interval":
+ vm.StatInterval = vp.PInt64()
+ case "swappiness":
+ vm.Swappiness = vp.PInt64()
+ case "user_reserve_kbytes":
+ vm.UserReserveKbytes = vp.PInt64()
+ case "vfs_cache_pressure":
+ vm.VfsCachePressure = vp.PInt64()
+ case "watermark_boost_factor":
+ vm.WatermarkBoostFactor = vp.PInt64()
+ case "watermark_scale_factor":
+ vm.WatermarkScaleFactor = vp.PInt64()
+ case "zone_reclaim_mode":
+ vm.ZoneReclaimMode = vp.PInt64()
+ }
+ if err := vp.Err(); err != nil {
+ return nil, err
+ }
+ }
+
+ return &vm, nil
+}
diff --git a/vendor/github.com/prometheus/procfs/zoneinfo.go b/vendor/github.com/prometheus/procfs/zoneinfo.go
new file mode 100644
index 0000000000..e941503d5c
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/zoneinfo.go
@@ -0,0 +1,196 @@
+// Copyright 2019 The Prometheus Authors
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// +build !windows
+
+package procfs
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "regexp"
+ "strings"
+
+ "github.com/prometheus/procfs/internal/util"
+)
+
+// Zoneinfo holds info parsed from /proc/zoneinfo.
+type Zoneinfo struct {
+ Node string
+ Zone string
+ NrFreePages *int64
+ Min *int64
+ Low *int64
+ High *int64
+ Scanned *int64
+ Spanned *int64
+ Present *int64
+ Managed *int64
+ NrActiveAnon *int64
+ NrInactiveAnon *int64
+ NrIsolatedAnon *int64
+ NrAnonPages *int64
+ NrAnonTransparentHugepages *int64
+ NrActiveFile *int64
+ NrInactiveFile *int64
+ NrIsolatedFile *int64
+ NrFilePages *int64
+ NrSlabReclaimable *int64
+ NrSlabUnreclaimable *int64
+ NrMlockStack *int64
+ NrKernelStack *int64
+ NrMapped *int64
+ NrDirty *int64
+ NrWriteback *int64
+ NrUnevictable *int64
+ NrShmem *int64
+ NrDirtied *int64
+ NrWritten *int64
+ NumaHit *int64
+ NumaMiss *int64
+ NumaForeign *int64
+ NumaInterleave *int64
+ NumaLocal *int64
+ NumaOther *int64
+ Protection []*int64
+}
+
+var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`)
+
+// Zoneinfo parses an zoneinfo-file (/proc/zoneinfo) and returns a slice of
+// structs containing the relevant info. More information available here:
+// https://www.kernel.org/doc/Documentation/sysctl/vm.txt
+func (fs FS) Zoneinfo() ([]Zoneinfo, error) {
+ data, err := ioutil.ReadFile(fs.proc.Path("zoneinfo"))
+ if err != nil {
+ return nil, fmt.Errorf("error reading zoneinfo %s: %s", fs.proc.Path("zoneinfo"), err)
+ }
+ zoneinfo, err := parseZoneinfo(data)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing zoneinfo %s: %s", fs.proc.Path("zoneinfo"), err)
+ }
+ return zoneinfo, nil
+}
+
+func parseZoneinfo(zoneinfoData []byte) ([]Zoneinfo, error) {
+
+ zoneinfo := []Zoneinfo{}
+
+ zoneinfoBlocks := bytes.Split(zoneinfoData, []byte("\nNode"))
+ for _, block := range zoneinfoBlocks {
+ var zoneinfoElement Zoneinfo
+ lines := strings.Split(string(block), "\n")
+ for _, line := range lines {
+
+ if nodeZone := nodeZoneRE.FindStringSubmatch(line); nodeZone != nil {
+ zoneinfoElement.Node = nodeZone[1]
+ zoneinfoElement.Zone = nodeZone[2]
+ continue
+ }
+ if strings.HasPrefix(strings.TrimSpace(line), "per-node stats") {
+ zoneinfoElement.Zone = ""
+ continue
+ }
+ parts := strings.Fields(strings.TrimSpace(line))
+ if len(parts) < 2 {
+ continue
+ }
+ vp := util.NewValueParser(parts[1])
+ switch parts[0] {
+ case "nr_free_pages":
+ zoneinfoElement.NrFreePages = vp.PInt64()
+ case "min":
+ zoneinfoElement.Min = vp.PInt64()
+ case "low":
+ zoneinfoElement.Low = vp.PInt64()
+ case "high":
+ zoneinfoElement.High = vp.PInt64()
+ case "scanned":
+ zoneinfoElement.Scanned = vp.PInt64()
+ case "spanned":
+ zoneinfoElement.Spanned = vp.PInt64()
+ case "present":
+ zoneinfoElement.Present = vp.PInt64()
+ case "managed":
+ zoneinfoElement.Managed = vp.PInt64()
+ case "nr_active_anon":
+ zoneinfoElement.NrActiveAnon = vp.PInt64()
+ case "nr_inactive_anon":
+ zoneinfoElement.NrInactiveAnon = vp.PInt64()
+ case "nr_isolated_anon":
+ zoneinfoElement.NrIsolatedAnon = vp.PInt64()
+ case "nr_anon_pages":
+ zoneinfoElement.NrAnonPages = vp.PInt64()
+ case "nr_anon_transparent_hugepages":
+ zoneinfoElement.NrAnonTransparentHugepages = vp.PInt64()
+ case "nr_active_file":
+ zoneinfoElement.NrActiveFile = vp.PInt64()
+ case "nr_inactive_file":
+ zoneinfoElement.NrInactiveFile = vp.PInt64()
+ case "nr_isolated_file":
+ zoneinfoElement.NrIsolatedFile = vp.PInt64()
+ case "nr_file_pages":
+ zoneinfoElement.NrFilePages = vp.PInt64()
+ case "nr_slab_reclaimable":
+ zoneinfoElement.NrSlabReclaimable = vp.PInt64()
+ case "nr_slab_unreclaimable":
+ zoneinfoElement.NrSlabUnreclaimable = vp.PInt64()
+ case "nr_mlock_stack":
+ zoneinfoElement.NrMlockStack = vp.PInt64()
+ case "nr_kernel_stack":
+ zoneinfoElement.NrKernelStack = vp.PInt64()
+ case "nr_mapped":
+ zoneinfoElement.NrMapped = vp.PInt64()
+ case "nr_dirty":
+ zoneinfoElement.NrDirty = vp.PInt64()
+ case "nr_writeback":
+ zoneinfoElement.NrWriteback = vp.PInt64()
+ case "nr_unevictable":
+ zoneinfoElement.NrUnevictable = vp.PInt64()
+ case "nr_shmem":
+ zoneinfoElement.NrShmem = vp.PInt64()
+ case "nr_dirtied":
+ zoneinfoElement.NrDirtied = vp.PInt64()
+ case "nr_written":
+ zoneinfoElement.NrWritten = vp.PInt64()
+ case "numa_hit":
+ zoneinfoElement.NumaHit = vp.PInt64()
+ case "numa_miss":
+ zoneinfoElement.NumaMiss = vp.PInt64()
+ case "numa_foreign":
+ zoneinfoElement.NumaForeign = vp.PInt64()
+ case "numa_interleave":
+ zoneinfoElement.NumaInterleave = vp.PInt64()
+ case "numa_local":
+ zoneinfoElement.NumaLocal = vp.PInt64()
+ case "numa_other":
+ zoneinfoElement.NumaOther = vp.PInt64()
+ case "protection:":
+ protectionParts := strings.Split(line, ":")
+ protectionValues := strings.Replace(protectionParts[1], "(", "", 1)
+ protectionValues = strings.Replace(protectionValues, ")", "", 1)
+ protectionValues = strings.TrimSpace(protectionValues)
+ protectionStringMap := strings.Split(protectionValues, ", ")
+ val, err := util.ParsePInt64s(protectionStringMap)
+ if err == nil {
+ zoneinfoElement.Protection = val
+ }
+ }
+
+ }
+
+ zoneinfo = append(zoneinfo, zoneinfoElement)
+ }
+ return zoneinfo, nil
+}
diff --git a/vendor/github.com/rs/cors/.travis.yml b/vendor/github.com/rs/cors/.travis.yml
index 17e5e50d52..9a68b56762 100644
--- a/vendor/github.com/rs/cors/.travis.yml
+++ b/vendor/github.com/rs/cors/.travis.yml
@@ -1,7 +1,8 @@
language: go
go:
-- 1.9
- "1.10"
+- "1.11"
+- "1.12"
- tip
matrix:
allow_failures:
diff --git a/vendor/github.com/rs/cors/cors.go b/vendor/github.com/rs/cors/cors.go
index d301ca724e..2730934630 100644
--- a/vendor/github.com/rs/cors/cors.go
+++ b/vendor/github.com/rs/cors/cors.go
@@ -5,8 +5,8 @@ as defined by http://www.w3.org/TR/cors/
You can configure it by passing an option struct to cors.New:
c := cors.New(cors.Options{
- AllowedOrigins: []string{"foo.com"},
- AllowedMethods: []string{"GET", "POST", "DELETE"},
+ AllowedOrigins: []string{"foo.com"},
+ AllowedMethods: []string{http.MethodGet, http.MethodPost, http.MethodDelete},
AllowCredentials: true,
})
@@ -69,10 +69,15 @@ type Options struct {
Debug bool
}
+// Logger generic interface for logger
+type Logger interface {
+ Printf(string, ...interface{})
+}
+
// Cors http handler
type Cors struct {
// Debug logger
- Log *log.Logger
+ Log Logger
// Normalized list of plain allowed origins
allowedOrigins []string
// List of allowed origins containing wildcards
@@ -106,7 +111,7 @@ func New(options Options) *Cors {
maxAge: options.MaxAge,
optionPassthrough: options.OptionsPassthrough,
}
- if options.Debug {
+ if options.Debug && c.Log == nil {
c.Log = log.New(os.Stdout, "[cors] ", log.LstdFlags)
}
@@ -161,7 +166,7 @@ func New(options Options) *Cors {
// Allowed Methods
if len(options.AllowedMethods) == 0 {
// Default is spec's "simple" methods
- c.allowedMethods = []string{"GET", "POST", "HEAD"}
+ c.allowedMethods = []string{http.MethodGet, http.MethodPost, http.MethodHead}
} else {
c.allowedMethods = convert(options.AllowedMethods, strings.ToUpper)
}
@@ -178,8 +183,15 @@ func Default() *Cors {
// origins with all standard methods with any header and credentials.
func AllowAll() *Cors {
return New(Options{
- AllowedOrigins: []string{"*"},
- AllowedMethods: []string{"HEAD", "GET", "POST", "PUT", "PATCH", "DELETE"},
+ AllowedOrigins: []string{"*"},
+ AllowedMethods: []string{
+ http.MethodHead,
+ http.MethodGet,
+ http.MethodPost,
+ http.MethodPut,
+ http.MethodPatch,
+ http.MethodDelete,
+ },
AllowedHeaders: []string{"*"},
AllowCredentials: false,
})
@@ -304,10 +316,6 @@ func (c *Cors) handleActualRequest(w http.ResponseWriter, r *http.Request) {
headers := w.Header()
origin := r.Header.Get("Origin")
- if r.Method == http.MethodOptions {
- c.logf(" Actual request no headers added: method == %s", r.Method)
- return
- }
// Always set Vary, see https://github.com/rs/cors/issues/10
headers.Add("Vary", "Origin")
if origin == "" {
@@ -342,7 +350,7 @@ func (c *Cors) handleActualRequest(w http.ResponseWriter, r *http.Request) {
c.logf(" Actual response added headers: %v", headers)
}
-// convenience method. checks if debugging is turned on before printing
+// convenience method. checks if a logger is set.
func (c *Cors) logf(format string, a ...interface{}) {
if c.Log != nil {
c.Log.Printf(format, a...)
diff --git a/vendor/github.com/rs/cors/utils.go b/vendor/github.com/rs/cors/utils.go
index 53ad9e9db3..db83ac3ea9 100644
--- a/vendor/github.com/rs/cors/utils.go
+++ b/vendor/github.com/rs/cors/utils.go
@@ -12,7 +12,7 @@ type wildcard struct {
}
func (w wildcard) match(s string) bool {
- return len(s) >= len(w.prefix+w.suffix) && strings.HasPrefix(s, w.prefix) && strings.HasSuffix(s, w.suffix)
+ return len(s) >= len(w.prefix)+len(w.suffix) && strings.HasPrefix(s, w.prefix) && strings.HasSuffix(s, w.suffix)
}
// convert converts a list of string using the passed converter function
diff --git a/vendor/github.com/rwcarlsen/goexif/exif/regen_regress.go b/vendor/github.com/rwcarlsen/goexif/exif/regen_regress.go
deleted file mode 100644
index 9be729ad78..0000000000
--- a/vendor/github.com/rwcarlsen/goexif/exif/regen_regress.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// +build ignore
-
-package main
-
-import (
- "flag"
- "fmt"
- "io"
- "log"
- "os"
- "path/filepath"
- "sort"
- "strings"
-
- "github.com/rwcarlsen/goexif/exif"
- "github.com/rwcarlsen/goexif/tiff"
-)
-
-func main() {
- flag.Parse()
- fname := flag.Arg(0)
-
- dst, err := os.Create(fname)
- if err != nil {
- log.Fatal(err)
- }
- defer dst.Close()
-
- dir, err := os.Open("samples")
- if err != nil {
- log.Fatal(err)
- }
- defer dir.Close()
-
- names, err := dir.Readdirnames(0)
- if err != nil {
- log.Fatal(err)
- }
- sort.Strings(names)
- for i, name := range names {
- names[i] = filepath.Join("samples", name)
- }
- makeExpected(names, dst)
-}
-
-func makeExpected(files []string, w io.Writer) {
- fmt.Fprintf(w, "package exif\n\n")
- fmt.Fprintf(w, "var regressExpected = map[string]map[FieldName]string{\n")
-
- for _, name := range files {
- if !strings.HasSuffix(name, ".jpg") {
- continue
- }
-
- f, err := os.Open(name)
- if err != nil {
- continue
- }
-
- x, err := exif.Decode(f)
- if err != nil {
- f.Close()
- continue
- }
-
- var items []string
- x.Walk(walkFunc(func(name exif.FieldName, tag *tiff.Tag) error {
- if strings.HasPrefix(string(name), exif.UnknownPrefix) {
- items = append(items, fmt.Sprintf("\"%v\": `%v`,\n", name, tag.String()))
- } else {
- items = append(items, fmt.Sprintf("%v: `%v`,\n", name, tag.String()))
- }
- return nil
- }))
- sort.Strings(items)
-
- fmt.Fprintf(w, "\"%v\": map[FieldName]string{\n", filepath.Base(name))
- for _, item := range items {
- fmt.Fprint(w, item)
- }
- fmt.Fprintf(w, "},\n")
- f.Close()
- }
- fmt.Fprintf(w, "}")
-}
-
-type walkFunc func(exif.FieldName, *tiff.Tag) error
-
-func (f walkFunc) Walk(name exif.FieldName, tag *tiff.Tag) error {
- return f(name, tag)
-}
diff --git a/vendor/github.com/segmentio/analytics-go/History.md b/vendor/github.com/segmentio/analytics-go/History.md
index 42bc0f654b..d01214e65c 100644
--- a/vendor/github.com/segmentio/analytics-go/History.md
+++ b/vendor/github.com/segmentio/analytics-go/History.md
@@ -1,3 +1,13 @@
+
+v3.1.0 / 2019-09-20
+===================
+
+ * add consistent panic error message
+ * Expose the Message interface Validate method
+ * return error if a custom type is enqueued
+ * Handle pointer types in Enqueue()
+ * message: update maxMessageBytes to 32KB
+
v3.0.1 / 2018-10-02
===================
diff --git a/vendor/github.com/segmentio/analytics-go/Makefile b/vendor/github.com/segmentio/analytics-go/Makefile
index c9debaaf43..9de0d1ba74 100644
--- a/vendor/github.com/segmentio/analytics-go/Makefile
+++ b/vendor/github.com/segmentio/analytics-go/Makefile
@@ -24,7 +24,7 @@ e2e:
@if [ "$(RUN_E2E_TESTS)" != "true" ]; then \
echo "Skipping end to end tests."; else \
go get github.com/segmentio/library-e2e-tester/cmd/tester; \
- tester -segment-write-key=$(SEGMENT_WRITE_KEY) -webhook-auth-username=$(WEBHOOK_AUTH_USERNAME) -webhook-bucket=$(WEBHOOK_BUCKET) -path='cli'; fi
+ tester -segment-write-key=$(SEGMENT_WRITE_KEY) -webhook-auth-username=$(WEBHOOK_AUTH_USERNAME) -webhook-bucket=$(WEBHOOK_BUCKET) -path='cli' -concurrency=2 -skip='advance|alias'; fi
ci: dependencies test e2e
diff --git a/vendor/github.com/segmentio/analytics-go/alias.go b/vendor/github.com/segmentio/analytics-go/alias.go
index 0084d20b4d..e9dbe85aa0 100644
--- a/vendor/github.com/segmentio/analytics-go/alias.go
+++ b/vendor/github.com/segmentio/analytics-go/alias.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Alias)(nil)
+
// This type represents object sent in a alias call as described in
// https://segment.com/docs/libraries/http/#alias
type Alias struct {
@@ -17,7 +19,11 @@ type Alias struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Alias) validate() error {
+func (msg Alias) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Alias) Validate() error {
if len(msg.UserId) == 0 {
return FieldError{
Type: "analytics.Alias",
diff --git a/vendor/github.com/segmentio/analytics-go/analytics.go b/vendor/github.com/segmentio/analytics-go/analytics.go
index 793df10b88..d0f089fb6c 100644
--- a/vendor/github.com/segmentio/analytics-go/analytics.go
+++ b/vendor/github.com/segmentio/analytics-go/analytics.go
@@ -14,6 +14,7 @@ import (
// Version of the client.
const Version = "3.0.0"
+const unimplementedError = "not implemented"
// This interface is the main API exposed by the analytics package.
// Values that satsify this interface are returned by the client constructors
@@ -104,8 +105,46 @@ func makeHttpClient(transport http.RoundTripper) http.Client {
return httpClient
}
+func dereferenceMessage(msg Message) Message {
+ switch m := msg.(type) {
+ case *Alias:
+ if m == nil {
+ return nil
+ }
+ return *m
+ case *Group:
+ if m == nil {
+ return nil
+ }
+ return *m
+ case *Identify:
+ if m == nil {
+ return nil
+ }
+ return *m
+ case *Page:
+ if m == nil {
+ return nil
+ }
+ return *m
+ case *Screen:
+ if m == nil {
+ return nil
+ }
+ return *m
+ case *Track:
+ if m == nil {
+ return nil
+ }
+ return *m
+ }
+
+ return msg
+}
+
func (c *client) Enqueue(msg Message) (err error) {
- if err = msg.validate(); err != nil {
+ msg = dereferenceMessage(msg)
+ if err = msg.Validate(); err != nil {
return
}
@@ -148,6 +187,10 @@ func (c *client) Enqueue(msg Message) (err error) {
m.MessageId = makeMessageId(m.MessageId, id)
m.Timestamp = makeTimestamp(m.Timestamp, ts)
msg = m
+
+ default:
+ err = fmt.Errorf("messages with custom types cannot be enqueued: %T", msg)
+ return
}
defer func() {
diff --git a/vendor/github.com/segmentio/analytics-go/group.go b/vendor/github.com/segmentio/analytics-go/group.go
index e8b7af6b8f..1da00faaa9 100644
--- a/vendor/github.com/segmentio/analytics-go/group.go
+++ b/vendor/github.com/segmentio/analytics-go/group.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Group)(nil)
+
// This type represents object sent in a group call as described in
// https://segment.com/docs/libraries/http/#group
type Group struct {
@@ -19,7 +21,11 @@ type Group struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Group) validate() error {
+func (msg Group) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Group) Validate() error {
if len(msg.GroupId) == 0 {
return FieldError{
Type: "analytics.Group",
diff --git a/vendor/github.com/segmentio/analytics-go/identify.go b/vendor/github.com/segmentio/analytics-go/identify.go
index 96cbda0ec7..ab078aa088 100644
--- a/vendor/github.com/segmentio/analytics-go/identify.go
+++ b/vendor/github.com/segmentio/analytics-go/identify.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Identify)(nil)
+
// This type represents object sent in an identify call as described in
// https://segment.com/docs/libraries/http/#identify
type Identify struct {
@@ -18,7 +20,11 @@ type Identify struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Identify) validate() error {
+func (msg Identify) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Identify) Validate() error {
if len(msg.UserId) == 0 && len(msg.AnonymousId) == 0 {
return FieldError{
Type: "analytics.Identify",
diff --git a/vendor/github.com/segmentio/analytics-go/message.go b/vendor/github.com/segmentio/analytics-go/message.go
index 2e7b2c96a4..a4999c6458 100644
--- a/vendor/github.com/segmentio/analytics-go/message.go
+++ b/vendor/github.com/segmentio/analytics-go/message.go
@@ -33,9 +33,12 @@ type Callback interface {
// and therefore can be passed to the analytics.Client.Send method.
type Message interface {
- // Validates the internal structure of the message, the method must return
+ // Validate validates the internal structure of the message, the method must return
// nil if the message is valid, or an error describing what went wrong.
- validate() error
+ Validate() error
+
+ // internal is an unexposed interface function to ensure only types defined within this package can satisfy the Message interface. Invoking this method will panic.
+ internal()
}
// Takes a message id as first argument and returns it, unless it's the zero-
@@ -124,5 +127,5 @@ func (q *messageQueue) flush() (msgs []message) {
const (
maxBatchBytes = 500000
- maxMessageBytes = 15000
+ maxMessageBytes = 32000
)
diff --git a/vendor/github.com/segmentio/analytics-go/page.go b/vendor/github.com/segmentio/analytics-go/page.go
index f7c64a2a3a..5a3b231f54 100644
--- a/vendor/github.com/segmentio/analytics-go/page.go
+++ b/vendor/github.com/segmentio/analytics-go/page.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Page)(nil)
+
// This type represents object sent in a page call as described in
// https://segment.com/docs/libraries/http/#page
type Page struct {
@@ -19,7 +21,11 @@ type Page struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Page) validate() error {
+func (msg Page) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Page) Validate() error {
if len(msg.UserId) == 0 && len(msg.AnonymousId) == 0 {
return FieldError{
Type: "analytics.Page",
diff --git a/vendor/github.com/segmentio/analytics-go/screen.go b/vendor/github.com/segmentio/analytics-go/screen.go
index 9e9849eb00..e810e79daa 100644
--- a/vendor/github.com/segmentio/analytics-go/screen.go
+++ b/vendor/github.com/segmentio/analytics-go/screen.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Screen)(nil)
+
// This type represents object sent in a screen call as described in
// https://segment.com/docs/libraries/http/#screen
type Screen struct {
@@ -19,7 +21,11 @@ type Screen struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Screen) validate() error {
+func (msg Screen) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Screen) Validate() error {
if len(msg.UserId) == 0 && len(msg.AnonymousId) == 0 {
return FieldError{
Type: "analytics.Screen",
diff --git a/vendor/github.com/segmentio/analytics-go/track.go b/vendor/github.com/segmentio/analytics-go/track.go
index 7d6e40bb1f..9c92a809a5 100644
--- a/vendor/github.com/segmentio/analytics-go/track.go
+++ b/vendor/github.com/segmentio/analytics-go/track.go
@@ -2,6 +2,8 @@ package analytics
import "time"
+var _ Message = (*Track)(nil)
+
// This type represents object sent in a track call as described in
// https://segment.com/docs/libraries/http/#track
type Track struct {
@@ -19,7 +21,11 @@ type Track struct {
Integrations Integrations `json:"integrations,omitempty"`
}
-func (msg Track) validate() error {
+func (msg Track) internal() {
+ panic(unimplementedError)
+}
+
+func (msg Track) Validate() error {
if len(msg.Event) == 0 {
return FieldError{
Type: "analytics.Track",
diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml
index f8a63b308b..00d04cb9b0 100644
--- a/vendor/github.com/spf13/pflag/.travis.yml
+++ b/vendor/github.com/spf13/pflag/.travis.yml
@@ -3,8 +3,9 @@ sudo: false
language: go
go:
- - 1.7.3
- - 1.8.1
+ - 1.9.x
+ - 1.10.x
+ - 1.11.x
- tip
matrix:
@@ -12,7 +13,7 @@ matrix:
- go: tip
install:
- - go get github.com/golang/lint/golint
+ - go get golang.org/x/lint/golint
- export PATH=$GOPATH/bin:$PATH
- go install ./...
diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md
index b052414d12..7eacc5bdbe 100644
--- a/vendor/github.com/spf13/pflag/README.md
+++ b/vendor/github.com/spf13/pflag/README.md
@@ -86,8 +86,8 @@ fmt.Println("ip has value ", *ip)
fmt.Println("flagvar has value ", flagvar)
```
-There are helpers function to get values later if you have the FlagSet but
-it was difficult to keep up with all of the flag pointers in your code.
+There are helper functions available to get the value stored in a Flag if you have a FlagSet but find
+it difficult to keep up with all of the pointers in your code.
If you have a pflag.FlagSet with a flag called 'flagname' of type int you
can use GetInt() to get the int value. But notice that 'flagname' must exist
and it must be an int. GetString("flagname") will fail.
diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go
index 5af02f1a75..3731370d6a 100644
--- a/vendor/github.com/spf13/pflag/bool_slice.go
+++ b/vendor/github.com/spf13/pflag/bool_slice.go
@@ -71,6 +71,44 @@ func (s *boolSliceValue) String() string {
return "[" + out + "]"
}
+func (s *boolSliceValue) fromString(val string) (bool, error) {
+ return strconv.ParseBool(val)
+}
+
+func (s *boolSliceValue) toString(val bool) string {
+ return strconv.FormatBool(val)
+}
+
+func (s *boolSliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *boolSliceValue) Replace(val []string) error {
+ out := make([]bool, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *boolSliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
func boolSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry
diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go
index aa126e44d1..a0b2679f71 100644
--- a/vendor/github.com/spf13/pflag/count.go
+++ b/vendor/github.com/spf13/pflag/count.go
@@ -46,7 +46,7 @@ func (f *FlagSet) GetCount(name string) (int, error) {
// CountVar defines a count flag with specified name, default value, and usage string.
// The argument p points to an int variable in which to store the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
+// A count flag will add 1 to its value every time it is found on the command line
func (f *FlagSet) CountVar(p *int, name string, usage string) {
f.CountVarP(p, name, "", usage)
}
@@ -69,7 +69,7 @@ func CountVarP(p *int, name, shorthand string, usage string) {
// Count defines a count flag with specified name, default value, and usage string.
// The return value is the address of an int variable that stores the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
+// A count flag will add 1 to its value every time it is found on the command line
func (f *FlagSet) Count(name string, usage string) *int {
p := new(int)
f.CountVarP(p, name, "", usage)
diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go
index 52c6b6dc10..badadda53f 100644
--- a/vendor/github.com/spf13/pflag/duration_slice.go
+++ b/vendor/github.com/spf13/pflag/duration_slice.go
@@ -51,6 +51,44 @@ func (s *durationSliceValue) String() string {
return "[" + strings.Join(out, ",") + "]"
}
+func (s *durationSliceValue) fromString(val string) (time.Duration, error) {
+ return time.ParseDuration(val)
+}
+
+func (s *durationSliceValue) toString(val time.Duration) string {
+ return fmt.Sprintf("%s", val)
+}
+
+func (s *durationSliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *durationSliceValue) Replace(val []string) error {
+ out := make([]time.Duration, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *durationSliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
func durationSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
index 9beeda8ecc..24a5036e95 100644
--- a/vendor/github.com/spf13/pflag/flag.go
+++ b/vendor/github.com/spf13/pflag/flag.go
@@ -57,9 +57,9 @@ that give one-letter shorthands for flags. You can use these by appending
var ip = flag.IntP("flagname", "f", 1234, "help message")
var flagvar bool
func init() {
- flag.BoolVarP("boolname", "b", true, "help message")
+ flag.BoolVarP(&flagvar, "boolname", "b", true, "help message")
}
- flag.VarP(&flagVar, "varname", "v", 1234, "help message")
+ flag.VarP(&flagval, "varname", "v", "help message")
Shorthand letters can be used with single dashes on the command line.
Boolean shorthand flags can be combined with other shorthand flags.
@@ -190,6 +190,18 @@ type Value interface {
Type() string
}
+// SliceValue is a secondary interface to all flags which hold a list
+// of values. This allows full control over the value of list flags,
+// and avoids complicated marshalling and unmarshalling to csv.
+type SliceValue interface {
+ // Append adds the specified value to the end of the flag value list.
+ Append(string) error
+ // Replace will fully overwrite any data currently in the flag value list.
+ Replace([]string) error
+ // GetSlice returns the flag value list as an array of strings.
+ GetSlice() []string
+}
+
// sortFlags returns the flags as a slice in lexicographical sorted order.
func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
list := make(sort.StringSlice, len(flags))
diff --git a/vendor/github.com/spf13/pflag/float32_slice.go b/vendor/github.com/spf13/pflag/float32_slice.go
new file mode 100644
index 0000000000..caa352741a
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/float32_slice.go
@@ -0,0 +1,174 @@
+package pflag
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- float32Slice Value
+type float32SliceValue struct {
+ value *[]float32
+ changed bool
+}
+
+func newFloat32SliceValue(val []float32, p *[]float32) *float32SliceValue {
+ isv := new(float32SliceValue)
+ isv.value = p
+ *isv.value = val
+ return isv
+}
+
+func (s *float32SliceValue) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make([]float32, len(ss))
+ for i, d := range ss {
+ var err error
+ var temp64 float64
+ temp64, err = strconv.ParseFloat(d, 32)
+ if err != nil {
+ return err
+ }
+ out[i] = float32(temp64)
+
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *float32SliceValue) Type() string {
+ return "float32Slice"
+}
+
+func (s *float32SliceValue) String() string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = fmt.Sprintf("%f", d)
+ }
+ return "[" + strings.Join(out, ",") + "]"
+}
+
+func (s *float32SliceValue) fromString(val string) (float32, error) {
+ t64, err := strconv.ParseFloat(val, 32)
+ if err != nil {
+ return 0, err
+ }
+ return float32(t64), nil
+}
+
+func (s *float32SliceValue) toString(val float32) string {
+ return fmt.Sprintf("%f", val)
+}
+
+func (s *float32SliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *float32SliceValue) Replace(val []string) error {
+ out := make([]float32, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *float32SliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
+func float32SliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []float32{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]float32, len(ss))
+ for i, d := range ss {
+ var err error
+ var temp64 float64
+ temp64, err = strconv.ParseFloat(d, 32)
+ if err != nil {
+ return nil, err
+ }
+ out[i] = float32(temp64)
+
+ }
+ return out, nil
+}
+
+// GetFloat32Slice return the []float32 value of a flag with the given name
+func (f *FlagSet) GetFloat32Slice(name string) ([]float32, error) {
+ val, err := f.getFlagType(name, "float32Slice", float32SliceConv)
+ if err != nil {
+ return []float32{}, err
+ }
+ return val.([]float32), nil
+}
+
+// Float32SliceVar defines a float32Slice flag with specified name, default value, and usage string.
+// The argument p points to a []float32 variable in which to store the value of the flag.
+func (f *FlagSet) Float32SliceVar(p *[]float32, name string, value []float32, usage string) {
+ f.VarP(newFloat32SliceValue(value, p), name, "", usage)
+}
+
+// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) {
+ f.VarP(newFloat32SliceValue(value, p), name, shorthand, usage)
+}
+
+// Float32SliceVar defines a float32[] flag with specified name, default value, and usage string.
+// The argument p points to a float32[] variable in which to store the value of the flag.
+func Float32SliceVar(p *[]float32, name string, value []float32, usage string) {
+ CommandLine.VarP(newFloat32SliceValue(value, p), name, "", usage)
+}
+
+// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) {
+ CommandLine.VarP(newFloat32SliceValue(value, p), name, shorthand, usage)
+}
+
+// Float32Slice defines a []float32 flag with specified name, default value, and usage string.
+// The return value is the address of a []float32 variable that stores the value of the flag.
+func (f *FlagSet) Float32Slice(name string, value []float32, usage string) *[]float32 {
+ p := []float32{}
+ f.Float32SliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 {
+ p := []float32{}
+ f.Float32SliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// Float32Slice defines a []float32 flag with specified name, default value, and usage string.
+// The return value is the address of a []float32 variable that stores the value of the flag.
+func Float32Slice(name string, value []float32, usage string) *[]float32 {
+ return CommandLine.Float32SliceP(name, "", value, usage)
+}
+
+// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash.
+func Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 {
+ return CommandLine.Float32SliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/float64_slice.go b/vendor/github.com/spf13/pflag/float64_slice.go
new file mode 100644
index 0000000000..85bf3073d5
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/float64_slice.go
@@ -0,0 +1,166 @@
+package pflag
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- float64Slice Value
+type float64SliceValue struct {
+ value *[]float64
+ changed bool
+}
+
+func newFloat64SliceValue(val []float64, p *[]float64) *float64SliceValue {
+ isv := new(float64SliceValue)
+ isv.value = p
+ *isv.value = val
+ return isv
+}
+
+func (s *float64SliceValue) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make([]float64, len(ss))
+ for i, d := range ss {
+ var err error
+ out[i], err = strconv.ParseFloat(d, 64)
+ if err != nil {
+ return err
+ }
+
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *float64SliceValue) Type() string {
+ return "float64Slice"
+}
+
+func (s *float64SliceValue) String() string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = fmt.Sprintf("%f", d)
+ }
+ return "[" + strings.Join(out, ",") + "]"
+}
+
+func (s *float64SliceValue) fromString(val string) (float64, error) {
+ return strconv.ParseFloat(val, 64)
+}
+
+func (s *float64SliceValue) toString(val float64) string {
+ return fmt.Sprintf("%f", val)
+}
+
+func (s *float64SliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *float64SliceValue) Replace(val []string) error {
+ out := make([]float64, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *float64SliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
+func float64SliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []float64{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]float64, len(ss))
+ for i, d := range ss {
+ var err error
+ out[i], err = strconv.ParseFloat(d, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ }
+ return out, nil
+}
+
+// GetFloat64Slice return the []float64 value of a flag with the given name
+func (f *FlagSet) GetFloat64Slice(name string) ([]float64, error) {
+ val, err := f.getFlagType(name, "float64Slice", float64SliceConv)
+ if err != nil {
+ return []float64{}, err
+ }
+ return val.([]float64), nil
+}
+
+// Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string.
+// The argument p points to a []float64 variable in which to store the value of the flag.
+func (f *FlagSet) Float64SliceVar(p *[]float64, name string, value []float64, usage string) {
+ f.VarP(newFloat64SliceValue(value, p), name, "", usage)
+}
+
+// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) {
+ f.VarP(newFloat64SliceValue(value, p), name, shorthand, usage)
+}
+
+// Float64SliceVar defines a float64[] flag with specified name, default value, and usage string.
+// The argument p points to a float64[] variable in which to store the value of the flag.
+func Float64SliceVar(p *[]float64, name string, value []float64, usage string) {
+ CommandLine.VarP(newFloat64SliceValue(value, p), name, "", usage)
+}
+
+// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) {
+ CommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage)
+}
+
+// Float64Slice defines a []float64 flag with specified name, default value, and usage string.
+// The return value is the address of a []float64 variable that stores the value of the flag.
+func (f *FlagSet) Float64Slice(name string, value []float64, usage string) *[]float64 {
+ p := []float64{}
+ f.Float64SliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 {
+ p := []float64{}
+ f.Float64SliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// Float64Slice defines a []float64 flag with specified name, default value, and usage string.
+// The return value is the address of a []float64 variable that stores the value of the flag.
+func Float64Slice(name string, value []float64, usage string) *[]float64 {
+ return CommandLine.Float64SliceP(name, "", value, usage)
+}
+
+// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash.
+func Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 {
+ return CommandLine.Float64SliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/go.mod b/vendor/github.com/spf13/pflag/go.mod
new file mode 100644
index 0000000000..b2287eec13
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/go.mod
@@ -0,0 +1,3 @@
+module github.com/spf13/pflag
+
+go 1.12
diff --git a/vendor/github.com/spf13/pflag/go.sum b/vendor/github.com/spf13/pflag/go.sum
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/vendor/github.com/spf13/pflag/int32_slice.go b/vendor/github.com/spf13/pflag/int32_slice.go
new file mode 100644
index 0000000000..ff128ff06d
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/int32_slice.go
@@ -0,0 +1,174 @@
+package pflag
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- int32Slice Value
+type int32SliceValue struct {
+ value *[]int32
+ changed bool
+}
+
+func newInt32SliceValue(val []int32, p *[]int32) *int32SliceValue {
+ isv := new(int32SliceValue)
+ isv.value = p
+ *isv.value = val
+ return isv
+}
+
+func (s *int32SliceValue) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make([]int32, len(ss))
+ for i, d := range ss {
+ var err error
+ var temp64 int64
+ temp64, err = strconv.ParseInt(d, 0, 32)
+ if err != nil {
+ return err
+ }
+ out[i] = int32(temp64)
+
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *int32SliceValue) Type() string {
+ return "int32Slice"
+}
+
+func (s *int32SliceValue) String() string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = fmt.Sprintf("%d", d)
+ }
+ return "[" + strings.Join(out, ",") + "]"
+}
+
+func (s *int32SliceValue) fromString(val string) (int32, error) {
+ t64, err := strconv.ParseInt(val, 0, 32)
+ if err != nil {
+ return 0, err
+ }
+ return int32(t64), nil
+}
+
+func (s *int32SliceValue) toString(val int32) string {
+ return fmt.Sprintf("%d", val)
+}
+
+func (s *int32SliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *int32SliceValue) Replace(val []string) error {
+ out := make([]int32, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *int32SliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
+func int32SliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []int32{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]int32, len(ss))
+ for i, d := range ss {
+ var err error
+ var temp64 int64
+ temp64, err = strconv.ParseInt(d, 0, 32)
+ if err != nil {
+ return nil, err
+ }
+ out[i] = int32(temp64)
+
+ }
+ return out, nil
+}
+
+// GetInt32Slice return the []int32 value of a flag with the given name
+func (f *FlagSet) GetInt32Slice(name string) ([]int32, error) {
+ val, err := f.getFlagType(name, "int32Slice", int32SliceConv)
+ if err != nil {
+ return []int32{}, err
+ }
+ return val.([]int32), nil
+}
+
+// Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string.
+// The argument p points to a []int32 variable in which to store the value of the flag.
+func (f *FlagSet) Int32SliceVar(p *[]int32, name string, value []int32, usage string) {
+ f.VarP(newInt32SliceValue(value, p), name, "", usage)
+}
+
+// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) {
+ f.VarP(newInt32SliceValue(value, p), name, shorthand, usage)
+}
+
+// Int32SliceVar defines a int32[] flag with specified name, default value, and usage string.
+// The argument p points to a int32[] variable in which to store the value of the flag.
+func Int32SliceVar(p *[]int32, name string, value []int32, usage string) {
+ CommandLine.VarP(newInt32SliceValue(value, p), name, "", usage)
+}
+
+// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) {
+ CommandLine.VarP(newInt32SliceValue(value, p), name, shorthand, usage)
+}
+
+// Int32Slice defines a []int32 flag with specified name, default value, and usage string.
+// The return value is the address of a []int32 variable that stores the value of the flag.
+func (f *FlagSet) Int32Slice(name string, value []int32, usage string) *[]int32 {
+ p := []int32{}
+ f.Int32SliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 {
+ p := []int32{}
+ f.Int32SliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// Int32Slice defines a []int32 flag with specified name, default value, and usage string.
+// The return value is the address of a []int32 variable that stores the value of the flag.
+func Int32Slice(name string, value []int32, usage string) *[]int32 {
+ return CommandLine.Int32SliceP(name, "", value, usage)
+}
+
+// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash.
+func Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 {
+ return CommandLine.Int32SliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/int64_slice.go b/vendor/github.com/spf13/pflag/int64_slice.go
new file mode 100644
index 0000000000..25464638f3
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/int64_slice.go
@@ -0,0 +1,166 @@
+package pflag
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- int64Slice Value
+type int64SliceValue struct {
+ value *[]int64
+ changed bool
+}
+
+func newInt64SliceValue(val []int64, p *[]int64) *int64SliceValue {
+ isv := new(int64SliceValue)
+ isv.value = p
+ *isv.value = val
+ return isv
+}
+
+func (s *int64SliceValue) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make([]int64, len(ss))
+ for i, d := range ss {
+ var err error
+ out[i], err = strconv.ParseInt(d, 0, 64)
+ if err != nil {
+ return err
+ }
+
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ *s.value = append(*s.value, out...)
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *int64SliceValue) Type() string {
+ return "int64Slice"
+}
+
+func (s *int64SliceValue) String() string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = fmt.Sprintf("%d", d)
+ }
+ return "[" + strings.Join(out, ",") + "]"
+}
+
+func (s *int64SliceValue) fromString(val string) (int64, error) {
+ return strconv.ParseInt(val, 0, 64)
+}
+
+func (s *int64SliceValue) toString(val int64) string {
+ return fmt.Sprintf("%d", val)
+}
+
+func (s *int64SliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *int64SliceValue) Replace(val []string) error {
+ out := make([]int64, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *int64SliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
+func int64SliceConv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // Empty string would cause a slice with one (empty) entry
+ if len(val) == 0 {
+ return []int64{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make([]int64, len(ss))
+ for i, d := range ss {
+ var err error
+ out[i], err = strconv.ParseInt(d, 0, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ }
+ return out, nil
+}
+
+// GetInt64Slice return the []int64 value of a flag with the given name
+func (f *FlagSet) GetInt64Slice(name string) ([]int64, error) {
+ val, err := f.getFlagType(name, "int64Slice", int64SliceConv)
+ if err != nil {
+ return []int64{}, err
+ }
+ return val.([]int64), nil
+}
+
+// Int64SliceVar defines a int64Slice flag with specified name, default value, and usage string.
+// The argument p points to a []int64 variable in which to store the value of the flag.
+func (f *FlagSet) Int64SliceVar(p *[]int64, name string, value []int64, usage string) {
+ f.VarP(newInt64SliceValue(value, p), name, "", usage)
+}
+
+// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) {
+ f.VarP(newInt64SliceValue(value, p), name, shorthand, usage)
+}
+
+// Int64SliceVar defines a int64[] flag with specified name, default value, and usage string.
+// The argument p points to a int64[] variable in which to store the value of the flag.
+func Int64SliceVar(p *[]int64, name string, value []int64, usage string) {
+ CommandLine.VarP(newInt64SliceValue(value, p), name, "", usage)
+}
+
+// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash.
+func Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) {
+ CommandLine.VarP(newInt64SliceValue(value, p), name, shorthand, usage)
+}
+
+// Int64Slice defines a []int64 flag with specified name, default value, and usage string.
+// The return value is the address of a []int64 variable that stores the value of the flag.
+func (f *FlagSet) Int64Slice(name string, value []int64, usage string) *[]int64 {
+ p := []int64{}
+ f.Int64SliceVarP(&p, name, "", value, usage)
+ return &p
+}
+
+// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 {
+ p := []int64{}
+ f.Int64SliceVarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// Int64Slice defines a []int64 flag with specified name, default value, and usage string.
+// The return value is the address of a []int64 variable that stores the value of the flag.
+func Int64Slice(name string, value []int64, usage string) *[]int64 {
+ return CommandLine.Int64SliceP(name, "", value, usage)
+}
+
+// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash.
+func Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 {
+ return CommandLine.Int64SliceP(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go
index 1e7c9edde9..e71c39d91a 100644
--- a/vendor/github.com/spf13/pflag/int_slice.go
+++ b/vendor/github.com/spf13/pflag/int_slice.go
@@ -51,6 +51,36 @@ func (s *intSliceValue) String() string {
return "[" + strings.Join(out, ",") + "]"
}
+func (s *intSliceValue) Append(val string) error {
+ i, err := strconv.Atoi(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *intSliceValue) Replace(val []string) error {
+ out := make([]int, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = strconv.Atoi(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *intSliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = strconv.Itoa(d)
+ }
+ return out
+}
+
func intSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry
diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go
index 7dd196fe3f..775faae4fd 100644
--- a/vendor/github.com/spf13/pflag/ip_slice.go
+++ b/vendor/github.com/spf13/pflag/ip_slice.go
@@ -72,9 +72,47 @@ func (s *ipSliceValue) String() string {
return "[" + out + "]"
}
+func (s *ipSliceValue) fromString(val string) (net.IP, error) {
+ return net.ParseIP(strings.TrimSpace(val)), nil
+}
+
+func (s *ipSliceValue) toString(val net.IP) string {
+ return val.String()
+}
+
+func (s *ipSliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *ipSliceValue) Replace(val []string) error {
+ out := make([]net.IP, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *ipSliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
func ipSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
- // Emtpy string would cause a slice with one (empty) entry
+ // Empty string would cause a slice with one (empty) entry
if len(val) == 0 {
return []net.IP{}, nil
}
diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go
index fa7bc60187..4894af8180 100644
--- a/vendor/github.com/spf13/pflag/string_array.go
+++ b/vendor/github.com/spf13/pflag/string_array.go
@@ -23,6 +23,32 @@ func (s *stringArrayValue) Set(val string) error {
return nil
}
+func (s *stringArrayValue) Append(val string) error {
+ *s.value = append(*s.value, val)
+ return nil
+}
+
+func (s *stringArrayValue) Replace(val []string) error {
+ out := make([]string, len(val))
+ for i, d := range val {
+ var err error
+ out[i] = d
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *stringArrayValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = d
+ }
+ return out
+}
+
func (s *stringArrayValue) Type() string {
return "stringArray"
}
diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go
index 0cd3ccc083..3cb2e69dba 100644
--- a/vendor/github.com/spf13/pflag/string_slice.go
+++ b/vendor/github.com/spf13/pflag/string_slice.go
@@ -62,6 +62,20 @@ func (s *stringSliceValue) String() string {
return "[" + str + "]"
}
+func (s *stringSliceValue) Append(val string) error {
+ *s.value = append(*s.value, val)
+ return nil
+}
+
+func (s *stringSliceValue) Replace(val []string) error {
+ *s.value = val
+ return nil
+}
+
+func (s *stringSliceValue) GetSlice() []string {
+ return *s.value
+}
+
func stringSliceConv(sval string) (interface{}, error) {
sval = sval[1 : len(sval)-1]
// An empty string would cause a slice with one (empty) string
@@ -84,7 +98,7 @@ func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
// The argument p points to a []string variable in which to store the value of the flag.
// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
// For example:
-// --ss="v1,v2" -ss="v3"
+// --ss="v1,v2" --ss="v3"
// will result in
// []string{"v1", "v2", "v3"}
func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
@@ -100,7 +114,7 @@ func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []s
// The argument p points to a []string variable in which to store the value of the flag.
// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
// For example:
-// --ss="v1,v2" -ss="v3"
+// --ss="v1,v2" --ss="v3"
// will result in
// []string{"v1", "v2", "v3"}
func StringSliceVar(p *[]string, name string, value []string, usage string) {
@@ -116,7 +130,7 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage
// The return value is the address of a []string variable that stores the value of the flag.
// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
// For example:
-// --ss="v1,v2" -ss="v3"
+// --ss="v1,v2" --ss="v3"
// will result in
// []string{"v1", "v2", "v3"}
func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
@@ -136,7 +150,7 @@ func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage str
// The return value is the address of a []string variable that stores the value of the flag.
// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
// For example:
-// --ss="v1,v2" -ss="v3"
+// --ss="v1,v2" --ss="v3"
// will result in
// []string{"v1", "v2", "v3"}
func StringSlice(name string, value []string, usage string) *[]string {
diff --git a/vendor/github.com/spf13/pflag/string_to_int64.go b/vendor/github.com/spf13/pflag/string_to_int64.go
new file mode 100644
index 0000000000..a807a04a0b
--- /dev/null
+++ b/vendor/github.com/spf13/pflag/string_to_int64.go
@@ -0,0 +1,149 @@
+package pflag
+
+import (
+ "bytes"
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// -- stringToInt64 Value
+type stringToInt64Value struct {
+ value *map[string]int64
+ changed bool
+}
+
+func newStringToInt64Value(val map[string]int64, p *map[string]int64) *stringToInt64Value {
+ ssv := new(stringToInt64Value)
+ ssv.value = p
+ *ssv.value = val
+ return ssv
+}
+
+// Format: a=1,b=2
+func (s *stringToInt64Value) Set(val string) error {
+ ss := strings.Split(val, ",")
+ out := make(map[string]int64, len(ss))
+ for _, pair := range ss {
+ kv := strings.SplitN(pair, "=", 2)
+ if len(kv) != 2 {
+ return fmt.Errorf("%s must be formatted as key=value", pair)
+ }
+ var err error
+ out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64)
+ if err != nil {
+ return err
+ }
+ }
+ if !s.changed {
+ *s.value = out
+ } else {
+ for k, v := range out {
+ (*s.value)[k] = v
+ }
+ }
+ s.changed = true
+ return nil
+}
+
+func (s *stringToInt64Value) Type() string {
+ return "stringToInt64"
+}
+
+func (s *stringToInt64Value) String() string {
+ var buf bytes.Buffer
+ i := 0
+ for k, v := range *s.value {
+ if i > 0 {
+ buf.WriteRune(',')
+ }
+ buf.WriteString(k)
+ buf.WriteRune('=')
+ buf.WriteString(strconv.FormatInt(v, 10))
+ i++
+ }
+ return "[" + buf.String() + "]"
+}
+
+func stringToInt64Conv(val string) (interface{}, error) {
+ val = strings.Trim(val, "[]")
+ // An empty string would cause an empty map
+ if len(val) == 0 {
+ return map[string]int64{}, nil
+ }
+ ss := strings.Split(val, ",")
+ out := make(map[string]int64, len(ss))
+ for _, pair := range ss {
+ kv := strings.SplitN(pair, "=", 2)
+ if len(kv) != 2 {
+ return nil, fmt.Errorf("%s must be formatted as key=value", pair)
+ }
+ var err error
+ out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return out, nil
+}
+
+// GetStringToInt64 return the map[string]int64 value of a flag with the given name
+func (f *FlagSet) GetStringToInt64(name string) (map[string]int64, error) {
+ val, err := f.getFlagType(name, "stringToInt64", stringToInt64Conv)
+ if err != nil {
+ return map[string]int64{}, err
+ }
+ return val.(map[string]int64), nil
+}
+
+// StringToInt64Var defines a string flag with specified name, default value, and usage string.
+// The argument p point64s to a map[string]int64 variable in which to store the values of the multiple flags.
+// The value of each argument will not try to be separated by comma
+func (f *FlagSet) StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) {
+ f.VarP(newStringToInt64Value(value, p), name, "", usage)
+}
+
+// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) {
+ f.VarP(newStringToInt64Value(value, p), name, shorthand, usage)
+}
+
+// StringToInt64Var defines a string flag with specified name, default value, and usage string.
+// The argument p point64s to a map[string]int64 variable in which to store the value of the flag.
+// The value of each argument will not try to be separated by comma
+func StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) {
+ CommandLine.VarP(newStringToInt64Value(value, p), name, "", usage)
+}
+
+// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash.
+func StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) {
+ CommandLine.VarP(newStringToInt64Value(value, p), name, shorthand, usage)
+}
+
+// StringToInt64 defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a map[string]int64 variable that stores the value of the flag.
+// The value of each argument will not try to be separated by comma
+func (f *FlagSet) StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 {
+ p := map[string]int64{}
+ f.StringToInt64VarP(&p, name, "", value, usage)
+ return &p
+}
+
+// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash.
+func (f *FlagSet) StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 {
+ p := map[string]int64{}
+ f.StringToInt64VarP(&p, name, shorthand, value, usage)
+ return &p
+}
+
+// StringToInt64 defines a string flag with specified name, default value, and usage string.
+// The return value is the address of a map[string]int64 variable that stores the value of the flag.
+// The value of each argument will not try to be separated by comma
+func StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 {
+ return CommandLine.StringToInt64P(name, "", value, usage)
+}
+
+// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash.
+func StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 {
+ return CommandLine.StringToInt64P(name, shorthand, value, usage)
+}
diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go
index edd94c600a..5fa924835e 100644
--- a/vendor/github.com/spf13/pflag/uint_slice.go
+++ b/vendor/github.com/spf13/pflag/uint_slice.go
@@ -50,6 +50,48 @@ func (s *uintSliceValue) String() string {
return "[" + strings.Join(out, ",") + "]"
}
+func (s *uintSliceValue) fromString(val string) (uint, error) {
+ t, err := strconv.ParseUint(val, 10, 0)
+ if err != nil {
+ return 0, err
+ }
+ return uint(t), nil
+}
+
+func (s *uintSliceValue) toString(val uint) string {
+ return fmt.Sprintf("%d", val)
+}
+
+func (s *uintSliceValue) Append(val string) error {
+ i, err := s.fromString(val)
+ if err != nil {
+ return err
+ }
+ *s.value = append(*s.value, i)
+ return nil
+}
+
+func (s *uintSliceValue) Replace(val []string) error {
+ out := make([]uint, len(val))
+ for i, d := range val {
+ var err error
+ out[i], err = s.fromString(d)
+ if err != nil {
+ return err
+ }
+ }
+ *s.value = out
+ return nil
+}
+
+func (s *uintSliceValue) GetSlice() []string {
+ out := make([]string, len(*s.value))
+ for i, d := range *s.value {
+ out[i] = s.toString(d)
+ }
+ return out
+}
+
func uintSliceConv(val string) (interface{}, error) {
val = strings.Trim(val, "[]")
// Empty string would cause a slice with one (empty) entry
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go
index aa1c2b95cd..e0364e9e7f 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_format.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go
@@ -113,6 +113,17 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool {
return Error(t, err, append([]interface{}{msg}, args...)...)
}
+// Eventuallyf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Eventually(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...)
+}
+
// Exactlyf asserts that two objects are equal in value and type.
//
// assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123))
@@ -157,6 +168,31 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool
return FileExists(t, path, append([]interface{}{msg}, args...)...)
}
+// Greaterf asserts that the first element is greater than the second
+//
+// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
+// assert.Greaterf(t, float64(2, "error message %s", "formatted"), float64(1))
+// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
+func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Greater(t, e1, e2, append([]interface{}{msg}, args...)...)
+}
+
+// GreaterOrEqualf asserts that the first element is greater than or equal to the second
+//
+// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
+func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return GreaterOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...)
+}
+
// HTTPBodyContainsf asserts that a specified handler returns a
// body that contains a string.
//
@@ -289,6 +325,14 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int
return JSONEq(t, expected, actual, append([]interface{}{msg}, args...)...)
}
+// YAMLEqf asserts that two YAML strings are equivalent.
+func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return YAMLEq(t, expected, actual, append([]interface{}{msg}, args...)...)
+}
+
// Lenf asserts that the specified object has specific length.
// Lenf also fails if the object has a type that len() not accept.
//
@@ -300,6 +344,31 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf
return Len(t, object, length, append([]interface{}{msg}, args...)...)
}
+// Lessf asserts that the first element is less than the second
+//
+// assert.Lessf(t, 1, 2, "error message %s", "formatted")
+// assert.Lessf(t, float64(1, "error message %s", "formatted"), float64(2))
+// assert.Lessf(t, "a", "b", "error message %s", "formatted")
+func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Less(t, e1, e2, append([]interface{}{msg}, args...)...)
+}
+
+// LessOrEqualf asserts that the first element is less than or equal to the second
+//
+// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
+func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...)
+}
+
// Nilf asserts that the specified object is nil.
//
// assert.Nilf(t, err, "error message %s", "formatted")
@@ -444,6 +513,19 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in
return Regexp(t, rx, str, append([]interface{}{msg}, args...)...)
}
+// Samef asserts that two pointers reference the same object.
+//
+// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func Samef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return Same(t, expected, actual, append([]interface{}{msg}, args...)...)
+}
+
// Subsetf asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
index de39f794e7..26830403a9 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
@@ -215,6 +215,28 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool {
return Errorf(a.t, err, msg, args...)
}
+// Eventually asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
+func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Eventually(a.t, condition, waitFor, tick, msgAndArgs...)
+}
+
+// Eventuallyf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Eventuallyf(a.t, condition, waitFor, tick, msg, args...)
+}
+
// Exactly asserts that two objects are equal in value and type.
//
// a.Exactly(int32(123), int64(123))
@@ -303,6 +325,56 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) b
return FileExistsf(a.t, path, msg, args...)
}
+// Greater asserts that the first element is greater than the second
+//
+// a.Greater(2, 1)
+// a.Greater(float64(2), float64(1))
+// a.Greater("b", "a")
+func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Greater(a.t, e1, e2, msgAndArgs...)
+}
+
+// GreaterOrEqual asserts that the first element is greater than or equal to the second
+//
+// a.GreaterOrEqual(2, 1)
+// a.GreaterOrEqual(2, 2)
+// a.GreaterOrEqual("b", "a")
+// a.GreaterOrEqual("b", "b")
+func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return GreaterOrEqual(a.t, e1, e2, msgAndArgs...)
+}
+
+// GreaterOrEqualf asserts that the first element is greater than or equal to the second
+//
+// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
+func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return GreaterOrEqualf(a.t, e1, e2, msg, args...)
+}
+
+// Greaterf asserts that the first element is greater than the second
+//
+// a.Greaterf(2, 1, "error message %s", "formatted")
+// a.Greaterf(float64(2, "error message %s", "formatted"), float64(1))
+// a.Greaterf("b", "a", "error message %s", "formatted")
+func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Greaterf(a.t, e1, e2, msg, args...)
+}
+
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
@@ -567,6 +639,22 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ..
return JSONEqf(a.t, expected, actual, msg, args...)
}
+// YAMLEq asserts that two YAML strings are equivalent.
+func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return YAMLEq(a.t, expected, actual, msgAndArgs...)
+}
+
+// YAMLEqf asserts that two YAML strings are equivalent.
+func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return YAMLEqf(a.t, expected, actual, msg, args...)
+}
+
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
@@ -589,6 +677,56 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in
return Lenf(a.t, object, length, msg, args...)
}
+// Less asserts that the first element is less than the second
+//
+// a.Less(1, 2)
+// a.Less(float64(1), float64(2))
+// a.Less("a", "b")
+func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Less(a.t, e1, e2, msgAndArgs...)
+}
+
+// LessOrEqual asserts that the first element is less than or equal to the second
+//
+// a.LessOrEqual(1, 2)
+// a.LessOrEqual(2, 2)
+// a.LessOrEqual("a", "b")
+// a.LessOrEqual("b", "b")
+func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return LessOrEqual(a.t, e1, e2, msgAndArgs...)
+}
+
+// LessOrEqualf asserts that the first element is less than or equal to the second
+//
+// a.LessOrEqualf(1, 2, "error message %s", "formatted")
+// a.LessOrEqualf(2, 2, "error message %s", "formatted")
+// a.LessOrEqualf("a", "b", "error message %s", "formatted")
+// a.LessOrEqualf("b", "b", "error message %s", "formatted")
+func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return LessOrEqualf(a.t, e1, e2, msg, args...)
+}
+
+// Lessf asserts that the first element is less than the second
+//
+// a.Lessf(1, 2, "error message %s", "formatted")
+// a.Lessf(float64(1, "error message %s", "formatted"), float64(2))
+// a.Lessf("a", "b", "error message %s", "formatted")
+func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Lessf(a.t, e1, e2, msg, args...)
+}
+
// Nil asserts that the specified object is nil.
//
// a.Nil(err)
@@ -877,6 +1015,32 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args .
return Regexpf(a.t, rx, str, msg, args...)
}
+// Same asserts that two pointers reference the same object.
+//
+// a.Same(ptr1, ptr2)
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Same(a.t, expected, actual, msgAndArgs...)
+}
+
+// Samef asserts that two pointers reference the same object.
+//
+// a.Samef(ptr1, ptr2, "error message %s", "formatted")
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return Samef(a.t, expected, actual, msg, args...)
+}
+
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go
new file mode 100644
index 0000000000..15a486ca6e
--- /dev/null
+++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go
@@ -0,0 +1,309 @@
+package assert
+
+import (
+ "fmt"
+ "reflect"
+)
+
+func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) {
+ switch kind {
+ case reflect.Int:
+ {
+ intobj1 := obj1.(int)
+ intobj2 := obj2.(int)
+ if intobj1 > intobj2 {
+ return -1, true
+ }
+ if intobj1 == intobj2 {
+ return 0, true
+ }
+ if intobj1 < intobj2 {
+ return 1, true
+ }
+ }
+ case reflect.Int8:
+ {
+ int8obj1 := obj1.(int8)
+ int8obj2 := obj2.(int8)
+ if int8obj1 > int8obj2 {
+ return -1, true
+ }
+ if int8obj1 == int8obj2 {
+ return 0, true
+ }
+ if int8obj1 < int8obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Int16:
+ {
+ int16obj1 := obj1.(int16)
+ int16obj2 := obj2.(int16)
+ if int16obj1 > int16obj2 {
+ return -1, true
+ }
+ if int16obj1 == int16obj2 {
+ return 0, true
+ }
+ if int16obj1 < int16obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Int32:
+ {
+ int32obj1 := obj1.(int32)
+ int32obj2 := obj2.(int32)
+ if int32obj1 > int32obj2 {
+ return -1, true
+ }
+ if int32obj1 == int32obj2 {
+ return 0, true
+ }
+ if int32obj1 < int32obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Int64:
+ {
+ int64obj1 := obj1.(int64)
+ int64obj2 := obj2.(int64)
+ if int64obj1 > int64obj2 {
+ return -1, true
+ }
+ if int64obj1 == int64obj2 {
+ return 0, true
+ }
+ if int64obj1 < int64obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Uint:
+ {
+ uintobj1 := obj1.(uint)
+ uintobj2 := obj2.(uint)
+ if uintobj1 > uintobj2 {
+ return -1, true
+ }
+ if uintobj1 == uintobj2 {
+ return 0, true
+ }
+ if uintobj1 < uintobj2 {
+ return 1, true
+ }
+ }
+ case reflect.Uint8:
+ {
+ uint8obj1 := obj1.(uint8)
+ uint8obj2 := obj2.(uint8)
+ if uint8obj1 > uint8obj2 {
+ return -1, true
+ }
+ if uint8obj1 == uint8obj2 {
+ return 0, true
+ }
+ if uint8obj1 < uint8obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Uint16:
+ {
+ uint16obj1 := obj1.(uint16)
+ uint16obj2 := obj2.(uint16)
+ if uint16obj1 > uint16obj2 {
+ return -1, true
+ }
+ if uint16obj1 == uint16obj2 {
+ return 0, true
+ }
+ if uint16obj1 < uint16obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Uint32:
+ {
+ uint32obj1 := obj1.(uint32)
+ uint32obj2 := obj2.(uint32)
+ if uint32obj1 > uint32obj2 {
+ return -1, true
+ }
+ if uint32obj1 == uint32obj2 {
+ return 0, true
+ }
+ if uint32obj1 < uint32obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Uint64:
+ {
+ uint64obj1 := obj1.(uint64)
+ uint64obj2 := obj2.(uint64)
+ if uint64obj1 > uint64obj2 {
+ return -1, true
+ }
+ if uint64obj1 == uint64obj2 {
+ return 0, true
+ }
+ if uint64obj1 < uint64obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Float32:
+ {
+ float32obj1 := obj1.(float32)
+ float32obj2 := obj2.(float32)
+ if float32obj1 > float32obj2 {
+ return -1, true
+ }
+ if float32obj1 == float32obj2 {
+ return 0, true
+ }
+ if float32obj1 < float32obj2 {
+ return 1, true
+ }
+ }
+ case reflect.Float64:
+ {
+ float64obj1 := obj1.(float64)
+ float64obj2 := obj2.(float64)
+ if float64obj1 > float64obj2 {
+ return -1, true
+ }
+ if float64obj1 == float64obj2 {
+ return 0, true
+ }
+ if float64obj1 < float64obj2 {
+ return 1, true
+ }
+ }
+ case reflect.String:
+ {
+ stringobj1 := obj1.(string)
+ stringobj2 := obj2.(string)
+ if stringobj1 > stringobj2 {
+ return -1, true
+ }
+ if stringobj1 == stringobj2 {
+ return 0, true
+ }
+ if stringobj1 < stringobj2 {
+ return 1, true
+ }
+ }
+ }
+
+ return 0, false
+}
+
+// Greater asserts that the first element is greater than the second
+//
+// assert.Greater(t, 2, 1)
+// assert.Greater(t, float64(2), float64(1))
+// assert.Greater(t, "b", "a")
+func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ e1Kind := reflect.ValueOf(e1).Kind()
+ e2Kind := reflect.ValueOf(e2).Kind()
+ if e1Kind != e2Kind {
+ return Fail(t, "Elements should be the same type", msgAndArgs...)
+ }
+
+ res, isComparable := compare(e1, e2, e1Kind)
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
+ }
+
+ if res != -1 {
+ return Fail(t, fmt.Sprintf("\"%v\" is not greater than \"%v\"", e1, e2), msgAndArgs...)
+ }
+
+ return true
+}
+
+// GreaterOrEqual asserts that the first element is greater than or equal to the second
+//
+// assert.GreaterOrEqual(t, 2, 1)
+// assert.GreaterOrEqual(t, 2, 2)
+// assert.GreaterOrEqual(t, "b", "a")
+// assert.GreaterOrEqual(t, "b", "b")
+func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ e1Kind := reflect.ValueOf(e1).Kind()
+ e2Kind := reflect.ValueOf(e2).Kind()
+ if e1Kind != e2Kind {
+ return Fail(t, "Elements should be the same type", msgAndArgs...)
+ }
+
+ res, isComparable := compare(e1, e2, e1Kind)
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
+ }
+
+ if res != -1 && res != 0 {
+ return Fail(t, fmt.Sprintf("\"%v\" is not greater than or equal to \"%v\"", e1, e2), msgAndArgs...)
+ }
+
+ return true
+}
+
+// Less asserts that the first element is less than the second
+//
+// assert.Less(t, 1, 2)
+// assert.Less(t, float64(1), float64(2))
+// assert.Less(t, "a", "b")
+func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ e1Kind := reflect.ValueOf(e1).Kind()
+ e2Kind := reflect.ValueOf(e2).Kind()
+ if e1Kind != e2Kind {
+ return Fail(t, "Elements should be the same type", msgAndArgs...)
+ }
+
+ res, isComparable := compare(e1, e2, e1Kind)
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
+ }
+
+ if res != 1 {
+ return Fail(t, fmt.Sprintf("\"%v\" is not less than \"%v\"", e1, e2), msgAndArgs...)
+ }
+
+ return true
+}
+
+// LessOrEqual asserts that the first element is less than or equal to the second
+//
+// assert.LessOrEqual(t, 1, 2)
+// assert.LessOrEqual(t, 2, 2)
+// assert.LessOrEqual(t, "a", "b")
+// assert.LessOrEqual(t, "b", "b")
+func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ e1Kind := reflect.ValueOf(e1).Kind()
+ e2Kind := reflect.ValueOf(e2).Kind()
+ if e1Kind != e2Kind {
+ return Fail(t, "Elements should be the same type", msgAndArgs...)
+ }
+
+ res, isComparable := compare(e1, e2, e1Kind)
+ if !isComparable {
+ return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...)
+ }
+
+ if res != 1 && res != 0 {
+ return Fail(t, fmt.Sprintf("\"%v\" is not less than or equal to \"%v\"", e1, e2), msgAndArgs...)
+ }
+
+ return true
+}
diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go
index 9bd4a80e48..044da8b01f 100644
--- a/vendor/github.com/stretchr/testify/assert/assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/assertions.go
@@ -18,6 +18,7 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/pmezard/go-difflib/difflib"
+ yaml "gopkg.in/yaml.v2"
)
//go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_format.go.tmpl
@@ -350,6 +351,37 @@ func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{})
}
+// Same asserts that two pointers reference the same object.
+//
+// assert.Same(t, ptr1, ptr2)
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ expectedPtr, actualPtr := reflect.ValueOf(expected), reflect.ValueOf(actual)
+ if expectedPtr.Kind() != reflect.Ptr || actualPtr.Kind() != reflect.Ptr {
+ return Fail(t, "Invalid operation: both arguments must be pointers", msgAndArgs...)
+ }
+
+ expectedType, actualType := reflect.TypeOf(expected), reflect.TypeOf(actual)
+ if expectedType != actualType {
+ return Fail(t, fmt.Sprintf("Pointer expected to be of type %v, but was %v",
+ expectedType, actualType), msgAndArgs...)
+ }
+
+ if expected != actual {
+ return Fail(t, fmt.Sprintf("Not same: \n"+
+ "expected: %p %#v\n"+
+ "actual : %p %#v", expected, expected, actual, actual), msgAndArgs...)
+ }
+
+ return true
+}
+
// formatUnequalValues takes two values of arbitrary types and returns string
// representations appropriate to be presented to the user.
//
@@ -479,14 +511,14 @@ func isEmpty(object interface{}) bool {
// collection types are empty when they have no element
case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
return objValue.Len() == 0
- // pointers are empty if nil or if the value they point to is empty
+ // pointers are empty if nil or if the value they point to is empty
case reflect.Ptr:
if objValue.IsNil() {
return true
}
deref := objValue.Elem().Interface()
return isEmpty(deref)
- // for all other types, compare against the zero value
+ // for all other types, compare against the zero value
default:
zero := reflect.Zero(objValue.Type())
return reflect.DeepEqual(object, zero.Interface())
@@ -629,7 +661,7 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{
func includeElement(list interface{}, element interface{}) (ok, found bool) {
listValue := reflect.ValueOf(list)
- elementValue := reflect.ValueOf(element)
+ listKind := reflect.TypeOf(list).Kind()
defer func() {
if e := recover(); e != nil {
ok = false
@@ -637,11 +669,12 @@ func includeElement(list interface{}, element interface{}) (ok, found bool) {
}
}()
- if reflect.TypeOf(list).Kind() == reflect.String {
+ if listKind == reflect.String {
+ elementValue := reflect.ValueOf(element)
return true, strings.Contains(listValue.String(), elementValue.String())
}
- if reflect.TypeOf(list).Kind() == reflect.Map {
+ if listKind == reflect.Map {
mapKeys := listValue.MapKeys()
for i := 0; i < len(mapKeys); i++ {
if ObjectsAreEqual(mapKeys[i].Interface(), element) {
@@ -1337,6 +1370,24 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{
return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...)
}
+// YAMLEq asserts that two YAML strings are equivalent.
+func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ var expectedYAMLAsInterface, actualYAMLAsInterface interface{}
+
+ if err := yaml.Unmarshal([]byte(expected), &expectedYAMLAsInterface); err != nil {
+ return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid yaml.\nYAML parsing error: '%s'", expected, err.Error()), msgAndArgs...)
+ }
+
+ if err := yaml.Unmarshal([]byte(actual), &actualYAMLAsInterface); err != nil {
+ return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid yaml.\nYAML error: '%s'", actual, err.Error()), msgAndArgs...)
+ }
+
+ return Equal(t, expectedYAMLAsInterface, actualYAMLAsInterface, msgAndArgs...)
+}
+
func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) {
t := reflect.TypeOf(v)
k := t.Kind()
@@ -1371,8 +1422,8 @@ func diff(expected interface{}, actual interface{}) string {
e = spewConfig.Sdump(expected)
a = spewConfig.Sdump(actual)
} else {
- e = expected.(string)
- a = actual.(string)
+ e = reflect.ValueOf(expected).String()
+ a = reflect.ValueOf(actual).String()
}
diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
@@ -1414,3 +1465,34 @@ var spewConfig = spew.ConfigState{
type tHelper interface {
Helper()
}
+
+// Eventually asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
+func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ timer := time.NewTimer(waitFor)
+ ticker := time.NewTicker(tick)
+ checkPassed := make(chan bool)
+ defer timer.Stop()
+ defer ticker.Stop()
+ defer close(checkPassed)
+ for {
+ select {
+ case <-timer.C:
+ return Fail(t, "Condition never satisfied", msgAndArgs...)
+ case result := <-checkPassed:
+ if result {
+ return true
+ }
+ case <-ticker.C:
+ go func() {
+ checkPassed <- condition()
+ }()
+ }
+ }
+}
diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go
index d6694ed78a..b5288af5b7 100644
--- a/vendor/github.com/stretchr/testify/mock/mock.go
+++ b/vendor/github.com/stretchr/testify/mock/mock.go
@@ -262,17 +262,21 @@ func (m *Mock) On(methodName string, arguments ...interface{}) *Call {
// */
func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, *Call) {
- for i, call := range m.ExpectedCalls {
- if call.Method == method && call.Repeatability > -1 {
+ var expectedCall *Call
+ for i, call := range m.ExpectedCalls {
+ if call.Method == method {
_, diffCount := call.Arguments.Diff(arguments)
if diffCount == 0 {
- return i, call
+ expectedCall = call
+ if call.Repeatability > -1 {
+ return i, call
+ }
}
-
}
}
- return -1, nil
+
+ return -1, expectedCall
}
func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) {
@@ -344,13 +348,17 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen
found, call := m.findExpectedCall(methodName, arguments...)
if found < 0 {
+ // expected call found but it has already been called with repeatable times
+ if call != nil {
+ m.mutex.Unlock()
+ m.fail("\nassert: mock: The method has been called over %d times.\n\tEither do one more Mock.On(\"%s\").Return(...), or remove extra call.\n\tThis call was unexpected:\n\t\t%s\n\tat: %s", call.totalCalls, methodName, callString(methodName, arguments, true), assert.CallerInfo())
+ }
// we have to fail here - because we don't know what to do
// as the return arguments. This is because:
//
// a) this is a totally unexpected call to this method,
// b) the arguments are not what was expected, or
// c) the developer has forgotten to add an accompanying On...Return pair.
-
closestCall, mismatch := m.findClosestCall(methodName, arguments...)
m.mutex.Unlock()
diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go
index 535f293490..c5903f5dbb 100644
--- a/vendor/github.com/stretchr/testify/require/require.go
+++ b/vendor/github.com/stretchr/testify/require/require.go
@@ -14,23 +14,23 @@ import (
// Condition uses a Comparison to assert a complex condition.
func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) {
- if assert.Condition(t, comp, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Condition(t, comp, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// Conditionf uses a Comparison to assert a complex condition.
func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interface{}) {
- if assert.Conditionf(t, comp, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Conditionf(t, comp, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -41,12 +41,12 @@ func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interfac
// assert.Contains(t, ["Hello", "World"], "World")
// assert.Contains(t, {"Hello": "World"}, "Hello")
func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- if assert.Contains(t, s, contains, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Contains(t, s, contains, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -57,34 +57,34 @@ func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...int
// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) {
- if assert.Containsf(t, s, contains, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Containsf(t, s, contains, msg, args...) {
+ return
+ }
t.FailNow()
}
// DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists.
func DirExists(t TestingT, path string, msgAndArgs ...interface{}) {
- if assert.DirExists(t, path, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.DirExists(t, path, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// DirExistsf checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists.
func DirExistsf(t TestingT, path string, msg string, args ...interface{}) {
- if assert.DirExistsf(t, path, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.DirExistsf(t, path, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -94,12 +94,12 @@ func DirExistsf(t TestingT, path string, msg string, args ...interface{}) {
//
// assert.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2])
func ElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{}) {
- if assert.ElementsMatch(t, listA, listB, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.ElementsMatch(t, listA, listB, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -109,12 +109,12 @@ func ElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs
//
// assert.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted")
func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) {
- if assert.ElementsMatchf(t, listA, listB, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.ElementsMatchf(t, listA, listB, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -123,12 +123,12 @@ func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string
//
// assert.Empty(t, obj)
func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if assert.Empty(t, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Empty(t, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -137,12 +137,12 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
//
// assert.Emptyf(t, obj, "error message %s", "formatted")
func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
- if assert.Emptyf(t, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Emptyf(t, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -154,12 +154,12 @@ func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
// referenced values (as opposed to the memory addresses). Function equality
// cannot be determined and will always fail.
func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if assert.Equal(t, expected, actual, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Equal(t, expected, actual, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -169,12 +169,12 @@ func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...i
// actualObj, err := SomeFunction()
// assert.EqualError(t, err, expectedErrorString)
func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) {
- if assert.EqualError(t, theError, errString, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.EqualError(t, theError, errString, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -184,12 +184,12 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
// actualObj, err := SomeFunction()
// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) {
- if assert.EqualErrorf(t, theError, errString, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.EqualErrorf(t, theError, errString, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -198,12 +198,12 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
//
// assert.EqualValues(t, uint32(123), int32(123))
func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if assert.EqualValues(t, expected, actual, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.EqualValues(t, expected, actual, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -212,12 +212,12 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg
//
// assert.EqualValuesf(t, uint32(123, "error message %s", "formatted"), int32(123))
func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
- if assert.EqualValuesf(t, expected, actual, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.EqualValuesf(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -229,12 +229,12 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri
// referenced values (as opposed to the memory addresses). Function equality
// cannot be determined and will always fail.
func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
- if assert.Equalf(t, expected, actual, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Equalf(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -245,12 +245,12 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar
// assert.Equal(t, expectedError, err)
// }
func Error(t TestingT, err error, msgAndArgs ...interface{}) {
- if assert.Error(t, err, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Error(t, err, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -261,9 +261,37 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) {
// assert.Equal(t, expectedErrorf, err)
// }
func Errorf(t TestingT, err error, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
if assert.Errorf(t, err, msg, args...) {
return
}
+ t.FailNow()
+}
+
+// Eventually asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
+func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
+ if assert.Eventually(t, condition, waitFor, tick, msgAndArgs...) {
+ return
+ }
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ t.FailNow()
+}
+
+// Eventuallyf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
+ if assert.Eventuallyf(t, condition, waitFor, tick, msg, args...) {
+ return
+ }
if h, ok := t.(tHelper); ok {
h.Helper()
}
@@ -274,12 +302,12 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) {
//
// assert.Exactly(t, int32(123), int64(123))
func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if assert.Exactly(t, expected, actual, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Exactly(t, expected, actual, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -287,56 +315,56 @@ func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ..
//
// assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123))
func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
- if assert.Exactlyf(t, expected, actual, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Exactlyf(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
// Fail reports a failure through
func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) {
- if assert.Fail(t, failureMessage, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Fail(t, failureMessage, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// FailNow fails test
func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) {
- if assert.FailNow(t, failureMessage, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.FailNow(t, failureMessage, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// FailNowf fails test
func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}) {
- if assert.FailNowf(t, failureMessage, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.FailNowf(t, failureMessage, msg, args...) {
+ return
+ }
t.FailNow()
}
// Failf reports a failure through
func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) {
- if assert.Failf(t, failureMessage, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Failf(t, failureMessage, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -344,12 +372,12 @@ func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) {
//
// assert.False(t, myBool)
func False(t TestingT, value bool, msgAndArgs ...interface{}) {
- if assert.False(t, value, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.False(t, value, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -357,34 +385,96 @@ func False(t TestingT, value bool, msgAndArgs ...interface{}) {
//
// assert.Falsef(t, myBool, "error message %s", "formatted")
func Falsef(t TestingT, value bool, msg string, args ...interface{}) {
- if assert.Falsef(t, value, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Falsef(t, value, msg, args...) {
+ return
+ }
t.FailNow()
}
// FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
func FileExists(t TestingT, path string, msgAndArgs ...interface{}) {
- if assert.FileExists(t, path, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.FileExists(t, path, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// FileExistsf checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.
func FileExistsf(t TestingT, path string, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
if assert.FileExistsf(t, path, msg, args...) {
return
}
+ t.FailNow()
+}
+
+// Greater asserts that the first element is greater than the second
+//
+// assert.Greater(t, 2, 1)
+// assert.Greater(t, float64(2), float64(1))
+// assert.Greater(t, "b", "a")
+func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Greater(t, e1, e2, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// GreaterOrEqual asserts that the first element is greater than or equal to the second
+//
+// assert.GreaterOrEqual(t, 2, 1)
+// assert.GreaterOrEqual(t, 2, 2)
+// assert.GreaterOrEqual(t, "b", "a")
+// assert.GreaterOrEqual(t, "b", "b")
+func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.GreaterOrEqual(t, e1, e2, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// GreaterOrEqualf asserts that the first element is greater than or equal to the second
+//
+// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
+func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.GreaterOrEqualf(t, e1, e2, msg, args...) {
+ return
+ }
+ t.FailNow()
+}
+
+// Greaterf asserts that the first element is greater than the second
+//
+// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
+// assert.Greaterf(t, float64(2, "error message %s", "formatted"), float64(1))
+// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
+func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.Greaterf(t, e1, e2, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -395,12 +485,12 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) {
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
- if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -411,12 +501,12 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url s
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
- if assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -427,12 +517,12 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
- if assert.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -443,12 +533,12 @@ func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, ur
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
- if assert.HTTPBodyNotContainsf(t, handler, method, url, values, str, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPBodyNotContainsf(t, handler, method, url, values, str, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -458,12 +548,12 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
- if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -473,12 +563,12 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string,
//
// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
- if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -488,12 +578,12 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string,
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
- if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -503,12 +593,12 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin
//
// Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false).
func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
- if assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -518,12 +608,12 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
- if assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -533,12 +623,12 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
- if assert.HTTPSuccessf(t, handler, method, url, values, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.HTTPSuccessf(t, handler, method, url, values, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -546,12 +636,12 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin
//
// assert.Implements(t, (*MyInterface)(nil), new(MyObject))
func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
- if assert.Implements(t, interfaceObject, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Implements(t, interfaceObject, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -559,12 +649,12 @@ func Implements(t TestingT, interfaceObject interface{}, object interface{}, msg
//
// assert.Implementsf(t, (*MyInterface, "error message %s", "formatted")(nil), new(MyObject))
func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) {
- if assert.Implementsf(t, interfaceObject, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Implementsf(t, interfaceObject, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -572,56 +662,56 @@ func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, ms
//
// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01)
func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if assert.InDelta(t, expected, actual, delta, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDelta(t, expected, actual, delta, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
func InDeltaMapValues(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if assert.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys.
func InDeltaMapValuesf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) {
- if assert.InDeltaMapValuesf(t, expected, actual, delta, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDeltaMapValuesf(t, expected, actual, delta, msg, args...) {
+ return
+ }
t.FailNow()
}
// InDeltaSlice is the same as InDelta, except it compares two slices.
func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
- if assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// InDeltaSlicef is the same as InDelta, except it compares two slices.
func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) {
- if assert.InDeltaSlicef(t, expected, actual, delta, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDeltaSlicef(t, expected, actual, delta, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -629,78 +719,78 @@ func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta f
//
// assert.InDeltaf(t, math.Pi, (22 / 7.0, "error message %s", "formatted"), 0.01)
func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) {
- if assert.InDeltaf(t, expected, actual, delta, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InDeltaf(t, expected, actual, delta, msg, args...) {
+ return
+ }
t.FailNow()
}
// InEpsilon asserts that expected and actual have a relative error less than epsilon
func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {
- if assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices.
func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) {
- if assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices.
func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) {
- if assert.InEpsilonSlicef(t, expected, actual, epsilon, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InEpsilonSlicef(t, expected, actual, epsilon, msg, args...) {
+ return
+ }
t.FailNow()
}
// InEpsilonf asserts that expected and actual have a relative error less than epsilon
func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) {
- if assert.InEpsilonf(t, expected, actual, epsilon, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.InEpsilonf(t, expected, actual, epsilon, msg, args...) {
+ return
+ }
t.FailNow()
}
// IsType asserts that the specified objects are of the same type.
func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) {
- if assert.IsType(t, expectedType, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.IsType(t, expectedType, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// IsTypef asserts that the specified objects are of the same type.
func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) {
- if assert.IsTypef(t, expectedType, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.IsTypef(t, expectedType, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -708,12 +798,12 @@ func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg strin
//
// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) {
- if assert.JSONEq(t, expected, actual, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.JSONEq(t, expected, actual, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -721,12 +811,34 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{
//
// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
if assert.JSONEqf(t, expected, actual, msg, args...) {
return
}
+ t.FailNow()
+}
+
+// YAMLEq asserts that two YAML strings are equivalent.
+func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.YAMLEq(t, expected, actual, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// YAMLEqf asserts that two YAML strings are equivalent.
+func YAMLEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.YAMLEqf(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -735,12 +847,12 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int
//
// assert.Len(t, mySlice, 3)
func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) {
- if assert.Len(t, object, length, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Len(t, object, length, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -749,12 +861,74 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
//
// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")
func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
if assert.Lenf(t, object, length, msg, args...) {
return
}
+ t.FailNow()
+}
+
+// Less asserts that the first element is less than the second
+//
+// assert.Less(t, 1, 2)
+// assert.Less(t, float64(1), float64(2))
+// assert.Less(t, "a", "b")
+func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Less(t, e1, e2, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// LessOrEqual asserts that the first element is less than or equal to the second
+//
+// assert.LessOrEqual(t, 1, 2)
+// assert.LessOrEqual(t, 2, 2)
+// assert.LessOrEqual(t, "a", "b")
+// assert.LessOrEqual(t, "b", "b")
+func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.LessOrEqual(t, e1, e2, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// LessOrEqualf asserts that the first element is less than or equal to the second
+//
+// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
+func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.LessOrEqualf(t, e1, e2, msg, args...) {
+ return
+ }
+ t.FailNow()
+}
+
+// Lessf asserts that the first element is less than the second
+//
+// assert.Lessf(t, 1, 2, "error message %s", "formatted")
+// assert.Lessf(t, float64(1, "error message %s", "formatted"), float64(2))
+// assert.Lessf(t, "a", "b", "error message %s", "formatted")
+func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.Lessf(t, e1, e2, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -762,12 +936,12 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf
//
// assert.Nil(t, err)
func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if assert.Nil(t, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Nil(t, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -775,12 +949,12 @@ func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
//
// assert.Nilf(t, err, "error message %s", "formatted")
func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) {
- if assert.Nilf(t, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Nilf(t, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -791,12 +965,12 @@ func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) {
// assert.Equal(t, expectedObj, actualObj)
// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
- if assert.NoError(t, err, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NoError(t, err, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -807,12 +981,12 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
// assert.Equal(t, expectedObj, actualObj)
// }
func NoErrorf(t TestingT, err error, msg string, args ...interface{}) {
- if assert.NoErrorf(t, err, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NoErrorf(t, err, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -823,12 +997,12 @@ func NoErrorf(t TestingT, err error, msg string, args ...interface{}) {
// assert.NotContains(t, ["Hello", "World"], "Earth")
// assert.NotContains(t, {"Hello": "World"}, "Earth")
func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
- if assert.NotContains(t, s, contains, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotContains(t, s, contains, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -839,12 +1013,12 @@ func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...
// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")
// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")
func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) {
- if assert.NotContainsf(t, s, contains, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotContainsf(t, s, contains, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -855,12 +1029,12 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a
// assert.Equal(t, "two", obj[1])
// }
func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if assert.NotEmpty(t, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotEmpty(t, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -871,12 +1045,12 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// assert.Equal(t, "two", obj[1])
// }
func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
- if assert.NotEmptyf(t, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotEmptyf(t, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -887,12 +1061,12 @@ func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{})
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
- if assert.NotEqual(t, expected, actual, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotEqual(t, expected, actual, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -903,12 +1077,12 @@ func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs .
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
- if assert.NotEqualf(t, expected, actual, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotEqualf(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -916,12 +1090,12 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string,
//
// assert.NotNil(t, err)
func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
- if assert.NotNil(t, object, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotNil(t, object, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -929,12 +1103,12 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
//
// assert.NotNilf(t, err, "error message %s", "formatted")
func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) {
- if assert.NotNilf(t, object, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotNilf(t, object, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -942,12 +1116,12 @@ func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) {
//
// assert.NotPanics(t, func(){ RemainCalm() })
func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- if assert.NotPanics(t, f, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotPanics(t, f, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -955,12 +1129,12 @@ func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
//
// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")
func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) {
- if assert.NotPanicsf(t, f, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotPanicsf(t, f, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -969,12 +1143,12 @@ func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interfac
// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
// assert.NotRegexp(t, "^start", "it's not starting")
func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- if assert.NotRegexp(t, rx, str, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotRegexp(t, rx, str, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -983,12 +1157,12 @@ func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interf
// assert.NotRegexpf(t, regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting")
// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) {
- if assert.NotRegexpf(t, rx, str, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotRegexpf(t, rx, str, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -997,12 +1171,12 @@ func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ..
//
// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) {
- if assert.NotSubset(t, list, subset, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotSubset(t, list, subset, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1011,34 +1185,34 @@ func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...i
//
// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) {
- if assert.NotSubsetf(t, list, subset, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotSubsetf(t, list, subset, msg, args...) {
+ return
+ }
t.FailNow()
}
// NotZero asserts that i is not the zero value for its type.
func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) {
- if assert.NotZero(t, i, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotZero(t, i, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// NotZerof asserts that i is not the zero value for its type.
func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) {
- if assert.NotZerof(t, i, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.NotZerof(t, i, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1046,12 +1220,12 @@ func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) {
//
// assert.Panics(t, func(){ GoCrazy() })
func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- if assert.Panics(t, f, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Panics(t, f, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1060,12 +1234,12 @@ func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
//
// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
- if assert.PanicsWithValue(t, expected, f, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.PanicsWithValue(t, expected, f, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1074,12 +1248,12 @@ func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, m
//
// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) {
- if assert.PanicsWithValuef(t, expected, f, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.PanicsWithValuef(t, expected, f, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1087,12 +1261,12 @@ func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc,
//
// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) {
- if assert.Panicsf(t, f, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Panicsf(t, f, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1101,12 +1275,12 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}
// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
// assert.Regexp(t, "start...$", "it's not starting")
func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
- if assert.Regexp(t, rx, str, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Regexp(t, rx, str, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1115,12 +1289,44 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface
// assert.Regexpf(t, regexp.MustCompile("start", "error message %s", "formatted"), "it's starting")
// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
if assert.Regexpf(t, rx, str, msg, args...) {
return
}
+ t.FailNow()
+}
+
+// Same asserts that two pointers reference the same object.
+//
+// assert.Same(t, ptr1, ptr2)
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func Same(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Same(t, expected, actual, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// Samef asserts that two pointers reference the same object.
+//
+// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func Samef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.Samef(t, expected, actual, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1129,12 +1335,12 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in
//
// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) {
- if assert.Subset(t, list, subset, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Subset(t, list, subset, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1143,12 +1349,12 @@ func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...inte
//
// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) {
- if assert.Subsetf(t, list, subset, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Subsetf(t, list, subset, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1156,12 +1362,12 @@ func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args
//
// assert.True(t, myBool)
func True(t TestingT, value bool, msgAndArgs ...interface{}) {
- if assert.True(t, value, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.True(t, value, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1169,12 +1375,12 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) {
//
// assert.Truef(t, myBool, "error message %s", "formatted")
func Truef(t TestingT, value bool, msg string, args ...interface{}) {
- if assert.Truef(t, value, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Truef(t, value, msg, args...) {
+ return
+ }
t.FailNow()
}
@@ -1182,12 +1388,12 @@ func Truef(t TestingT, value bool, msg string, args ...interface{}) {
//
// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
- if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
@@ -1195,33 +1401,33 @@ func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time
//
// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) {
- if assert.WithinDurationf(t, expected, actual, delta, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.WithinDurationf(t, expected, actual, delta, msg, args...) {
+ return
+ }
t.FailNow()
}
// Zero asserts that i is the zero value for its type.
func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) {
- if assert.Zero(t, i, msgAndArgs...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Zero(t, i, msgAndArgs...) {
+ return
+ }
t.FailNow()
}
// Zerof asserts that i is the zero value for its type.
func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) {
- if assert.Zerof(t, i, msg, args...) {
- return
- }
if h, ok := t.(tHelper); ok {
h.Helper()
}
+ if assert.Zerof(t, i, msg, args...) {
+ return
+ }
t.FailNow()
}
diff --git a/vendor/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/stretchr/testify/require/require.go.tmpl
index 6ffc751b5e..55e42ddebd 100644
--- a/vendor/github.com/stretchr/testify/require/require.go.tmpl
+++ b/vendor/github.com/stretchr/testify/require/require.go.tmpl
@@ -1,6 +1,6 @@
{{.Comment}}
func {{.DocInfo.Name}}(t TestingT, {{.Params}}) {
- if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return }
if h, ok := t.(tHelper); ok { h.Helper() }
+ if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return }
t.FailNow()
}
diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go
index 9fe41dbdc0..804fae035b 100644
--- a/vendor/github.com/stretchr/testify/require/require_forward.go
+++ b/vendor/github.com/stretchr/testify/require/require_forward.go
@@ -216,6 +216,28 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) {
Errorf(a.t, err, msg, args...)
}
+// Eventually asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
+func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Eventually(a.t, condition, waitFor, tick, msgAndArgs...)
+}
+
+// Eventuallyf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick.
+//
+// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Eventuallyf(a.t, condition, waitFor, tick, msg, args...)
+}
+
// Exactly asserts that two objects are equal in value and type.
//
// a.Exactly(int32(123), int64(123))
@@ -304,6 +326,56 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) {
FileExistsf(a.t, path, msg, args...)
}
+// Greater asserts that the first element is greater than the second
+//
+// a.Greater(2, 1)
+// a.Greater(float64(2), float64(1))
+// a.Greater("b", "a")
+func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Greater(a.t, e1, e2, msgAndArgs...)
+}
+
+// GreaterOrEqual asserts that the first element is greater than or equal to the second
+//
+// a.GreaterOrEqual(2, 1)
+// a.GreaterOrEqual(2, 2)
+// a.GreaterOrEqual("b", "a")
+// a.GreaterOrEqual("b", "b")
+func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ GreaterOrEqual(a.t, e1, e2, msgAndArgs...)
+}
+
+// GreaterOrEqualf asserts that the first element is greater than or equal to the second
+//
+// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
+func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ GreaterOrEqualf(a.t, e1, e2, msg, args...)
+}
+
+// Greaterf asserts that the first element is greater than the second
+//
+// a.Greaterf(2, 1, "error message %s", "formatted")
+// a.Greaterf(float64(2, "error message %s", "formatted"), float64(1))
+// a.Greaterf("b", "a", "error message %s", "formatted")
+func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Greaterf(a.t, e1, e2, msg, args...)
+}
+
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
@@ -568,6 +640,22 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ..
JSONEqf(a.t, expected, actual, msg, args...)
}
+// YAMLEq asserts that two YAML strings are equivalent.
+func (a *Assertions) YAMLEq(expected string, actual string, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ YAMLEq(a.t, expected, actual, msgAndArgs...)
+}
+
+// YAMLEqf asserts that two YAML strings are equivalent.
+func (a *Assertions) YAMLEqf(expected string, actual string, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ YAMLEqf(a.t, expected, actual, msg, args...)
+}
+
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
@@ -590,6 +678,56 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in
Lenf(a.t, object, length, msg, args...)
}
+// Less asserts that the first element is less than the second
+//
+// a.Less(1, 2)
+// a.Less(float64(1), float64(2))
+// a.Less("a", "b")
+func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Less(a.t, e1, e2, msgAndArgs...)
+}
+
+// LessOrEqual asserts that the first element is less than or equal to the second
+//
+// a.LessOrEqual(1, 2)
+// a.LessOrEqual(2, 2)
+// a.LessOrEqual("a", "b")
+// a.LessOrEqual("b", "b")
+func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ LessOrEqual(a.t, e1, e2, msgAndArgs...)
+}
+
+// LessOrEqualf asserts that the first element is less than or equal to the second
+//
+// a.LessOrEqualf(1, 2, "error message %s", "formatted")
+// a.LessOrEqualf(2, 2, "error message %s", "formatted")
+// a.LessOrEqualf("a", "b", "error message %s", "formatted")
+// a.LessOrEqualf("b", "b", "error message %s", "formatted")
+func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ LessOrEqualf(a.t, e1, e2, msg, args...)
+}
+
+// Lessf asserts that the first element is less than the second
+//
+// a.Lessf(1, 2, "error message %s", "formatted")
+// a.Lessf(float64(1, "error message %s", "formatted"), float64(2))
+// a.Lessf("a", "b", "error message %s", "formatted")
+func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Lessf(a.t, e1, e2, msg, args...)
+}
+
// Nil asserts that the specified object is nil.
//
// a.Nil(err)
@@ -878,6 +1016,32 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args .
Regexpf(a.t, rx, str, msg, args...)
}
+// Same asserts that two pointers reference the same object.
+//
+// a.Same(ptr1, ptr2)
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Same(a.t, expected, actual, msgAndArgs...)
+}
+
+// Samef asserts that two pointers reference the same object.
+//
+// a.Samef(ptr1, ptr2, "error message %s", "formatted")
+//
+// Both arguments must be pointer variables. Pointer variable sameness is
+// determined based on the equality of both type and value.
+func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ Samef(a.t, expected, actual, msg, args...)
+}
+
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
diff --git a/vendor/github.com/stretchr/testify/suite/suite.go b/vendor/github.com/stretchr/testify/suite/suite.go
index 5cea8f8c75..d708d7d753 100644
--- a/vendor/github.com/stretchr/testify/suite/suite.go
+++ b/vendor/github.com/stretchr/testify/suite/suite.go
@@ -6,6 +6,7 @@ import (
"os"
"reflect"
"regexp"
+ "runtime/debug"
"testing"
"github.com/stretchr/testify/assert"
@@ -58,7 +59,7 @@ func (suite *Suite) Assert() *assert.Assertions {
func failOnPanic(t *testing.T) {
r := recover()
if r != nil {
- t.Errorf("test panicked: %v", r)
+ t.Errorf("test panicked: %v\n%s", r, debug.Stack())
t.FailNow()
}
}
@@ -82,15 +83,8 @@ func Run(t *testing.T, suite TestingSuite) {
suite.SetT(t)
defer failOnPanic(t)
- if setupAllSuite, ok := suite.(SetupAllSuite); ok {
- setupAllSuite.SetupSuite()
- }
- defer func() {
- if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
- tearDownAllSuite.TearDownSuite()
- }
- }()
-
+ suiteSetupDone := false
+
methodFinder := reflect.TypeOf(suite)
tests := []testing.InternalTest{}
for index := 0; index < methodFinder.NumMethod(); index++ {
@@ -100,34 +94,46 @@ func Run(t *testing.T, suite TestingSuite) {
fmt.Fprintf(os.Stderr, "testify: invalid regexp for -m: %s\n", err)
os.Exit(1)
}
- if ok {
- test := testing.InternalTest{
- Name: method.Name,
- F: func(t *testing.T) {
- parentT := suite.T()
- suite.SetT(t)
- defer failOnPanic(t)
-
- if setupTestSuite, ok := suite.(SetupTestSuite); ok {
- setupTestSuite.SetupTest()
- }
- if beforeTestSuite, ok := suite.(BeforeTest); ok {
- beforeTestSuite.BeforeTest(methodFinder.Elem().Name(), method.Name)
- }
- defer func() {
- if afterTestSuite, ok := suite.(AfterTest); ok {
- afterTestSuite.AfterTest(methodFinder.Elem().Name(), method.Name)
- }
- if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok {
- tearDownTestSuite.TearDownTest()
- }
- suite.SetT(parentT)
- }()
- method.Func.Call([]reflect.Value{reflect.ValueOf(suite)})
- },
- }
- tests = append(tests, test)
+ if !ok {
+ continue
}
+ if !suiteSetupDone {
+ if setupAllSuite, ok := suite.(SetupAllSuite); ok {
+ setupAllSuite.SetupSuite()
+ }
+ defer func() {
+ if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
+ tearDownAllSuite.TearDownSuite()
+ }
+ }()
+ suiteSetupDone = true
+ }
+ test := testing.InternalTest{
+ Name: method.Name,
+ F: func(t *testing.T) {
+ parentT := suite.T()
+ suite.SetT(t)
+ defer failOnPanic(t)
+
+ if setupTestSuite, ok := suite.(SetupTestSuite); ok {
+ setupTestSuite.SetupTest()
+ }
+ if beforeTestSuite, ok := suite.(BeforeTest); ok {
+ beforeTestSuite.BeforeTest(methodFinder.Elem().Name(), method.Name)
+ }
+ defer func() {
+ if afterTestSuite, ok := suite.(AfterTest); ok {
+ afterTestSuite.AfterTest(methodFinder.Elem().Name(), method.Name)
+ }
+ if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok {
+ tearDownTestSuite.TearDownTest()
+ }
+ suite.SetT(parentT)
+ }()
+ method.Func.Call([]reflect.Value{reflect.ValueOf(suite)})
+ },
+ }
+ tests = append(tests, test)
}
runTests(t, tests)
}
diff --git a/vendor/go.uber.org/multierr/.travis.yml b/vendor/go.uber.org/multierr/.travis.yml
index 5ffa8fed48..a6412b7fed 100644
--- a/vendor/go.uber.org/multierr/.travis.yml
+++ b/vendor/go.uber.org/multierr/.travis.yml
@@ -7,9 +7,9 @@ env:
- GO15VENDOREXPERIMENT=1
go:
- - 1.7
- - 1.8
- - tip
+ - 1.11.x
+ - 1.12.x
+ - 1.13.x
cache:
directories:
diff --git a/vendor/go.uber.org/multierr/CHANGELOG.md b/vendor/go.uber.org/multierr/CHANGELOG.md
index 898445d063..f1b852cf3f 100644
--- a/vendor/go.uber.org/multierr/CHANGELOG.md
+++ b/vendor/go.uber.org/multierr/CHANGELOG.md
@@ -1,6 +1,13 @@
Releases
========
+v1.2.0 (2019-09-26)
+===================
+
+- Support extracting and matching against wrapped errors with `errors.As`
+ and `errors.Is`.
+
+
v1.1.0 (2017-06-30)
===================
diff --git a/vendor/go.uber.org/multierr/Makefile b/vendor/go.uber.org/multierr/Makefile
index a7437d061f..b4bf73d8c3 100644
--- a/vendor/go.uber.org/multierr/Makefile
+++ b/vendor/go.uber.org/multierr/Makefile
@@ -34,7 +34,7 @@ govet:
.PHONY: golint
golint:
- @go get github.com/golang/lint/golint
+ @go get golang.org/x/lint/golint
$(eval LINT_LOG := $(shell mktemp -t golint.XXXXX))
@cat /dev/null > $(LINT_LOG)
@$(foreach pkg, $(PACKAGES), golint $(pkg) >> $(LINT_LOG) || true;)
diff --git a/vendor/go.uber.org/multierr/README.md b/vendor/go.uber.org/multierr/README.md
index 065088f641..751bd65e58 100644
--- a/vendor/go.uber.org/multierr/README.md
+++ b/vendor/go.uber.org/multierr/README.md
@@ -17,7 +17,7 @@ Released under the [MIT License].
[MIT License]: LICENSE.txt
[doc-img]: https://godoc.org/go.uber.org/multierr?status.svg
[doc]: https://godoc.org/go.uber.org/multierr
-[ci-img]: https://travis-ci.org/uber-go/multierr.svg?branch=master
+[ci-img]: https://travis-ci.com/uber-go/multierr.svg?branch=master
[cov-img]: https://codecov.io/gh/uber-go/multierr/branch/master/graph/badge.svg
-[ci]: https://travis-ci.org/uber-go/multierr
+[ci]: https://travis-ci.com/uber-go/multierr
[cov]: https://codecov.io/gh/uber-go/multierr
diff --git a/vendor/go.uber.org/multierr/error.go b/vendor/go.uber.org/multierr/error.go
index de6ce4736c..d4be183448 100644
--- a/vendor/go.uber.org/multierr/error.go
+++ b/vendor/go.uber.org/multierr/error.go
@@ -33,7 +33,7 @@
// If only two errors are being combined, the Append function may be used
// instead.
//
-// err = multierr.Combine(reader.Close(), writer.Close())
+// err = multierr.Append(reader.Close(), writer.Close())
//
// This makes it possible to record resource cleanup failures from deferred
// blocks with the help of named return values.
@@ -99,8 +99,6 @@ var (
// Separator for single-line error messages.
_singlelineSeparator = []byte("; ")
- _newline = []byte("\n")
-
// Prefix for multi-line messages
_multilinePrefix = []byte("the following errors occurred:")
diff --git a/vendor/go.uber.org/multierr/go113.go b/vendor/go.uber.org/multierr/go113.go
new file mode 100644
index 0000000000..264b0eac0d
--- /dev/null
+++ b/vendor/go.uber.org/multierr/go113.go
@@ -0,0 +1,52 @@
+// Copyright (c) 2019 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+// +build go1.13
+
+package multierr
+
+import "errors"
+
+// As attempts to find the first error in the error list that matches the type
+// of the value that target points to.
+//
+// This function allows errors.As to traverse the values stored on the
+// multierr error.
+func (merr *multiError) As(target interface{}) bool {
+ for _, err := range merr.Errors() {
+ if errors.As(err, target) {
+ return true
+ }
+ }
+ return false
+}
+
+// Is attempts to match the provided error against errors in the error list.
+//
+// This function allows errors.Is to traverse the values stored on the
+// multierr error.
+func (merr *multiError) Is(target error) bool {
+ for _, err := range merr.Errors() {
+ if errors.Is(err, target) {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go
index fa365b7b6a..fde2acb592 100644
--- a/vendor/golang.org/x/crypto/acme/acme.go
+++ b/vendor/golang.org/x/crypto/acme/acme.go
@@ -4,7 +4,10 @@
// Package acme provides an implementation of the
// Automatic Certificate Management Environment (ACME) spec.
-// See https://tools.ietf.org/html/draft-ietf-acme-acme-02 for details.
+// The intial implementation was based on ACME draft-02 and
+// is now being extended to comply with RFC 8555.
+// See https://tools.ietf.org/html/draft-ietf-acme-acme-02
+// and https://tools.ietf.org/html/rfc8555 for details.
//
// Most common scenarios will want to use autocert subdirectory instead,
// which provides automatic access to certificates from Let's Encrypt
@@ -57,7 +60,10 @@ var idPeACMEIdentifierV1 = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 30, 1}
const (
maxChainLen = 5 // max depth and breadth of a certificate chain
- maxCertSize = 1 << 20 // max size of a certificate, in bytes
+ maxCertSize = 1 << 20 // max size of a certificate, in DER bytes
+ // Used for decoding certs from application/pem-certificate-chain response,
+ // the default when in RFC mode.
+ maxCertChainSize = maxCertSize * maxChainLen
// Max number of collected nonces kept in memory.
// Expect usual peak of 1 or 2.
@@ -116,21 +122,48 @@ type Client struct {
// identifiable by the server, in case they are causing issues.
UserAgent string
- dirMu sync.Mutex // guards writes to dir
- dir *Directory // cached result of Client's Discover method
+ cacheMu sync.Mutex
+ dir *Directory // cached result of Client's Discover method
+ kid keyID // cached Account.URI obtained from registerRFC or getAccountRFC
noncesMu sync.Mutex
nonces map[string]struct{} // nonces collected from previous responses
}
+// accountKID returns a key ID associated with c.Key, the account identity
+// provided by the CA during RFC based registration.
+// It assumes c.Discover has already been called.
+//
+// accountKID requires at most one network roundtrip.
+// It caches only successful result.
+//
+// When in pre-RFC mode or when c.getRegRFC responds with an error, accountKID
+// returns noKeyID.
+func (c *Client) accountKID(ctx context.Context) keyID {
+ c.cacheMu.Lock()
+ defer c.cacheMu.Unlock()
+ if !c.dir.rfcCompliant() {
+ return noKeyID
+ }
+ if c.kid != noKeyID {
+ return c.kid
+ }
+ a, err := c.getRegRFC(ctx)
+ if err != nil {
+ return noKeyID
+ }
+ c.kid = keyID(a.URI)
+ return c.kid
+}
+
// Discover performs ACME server discovery using c.DirectoryURL.
//
// It caches successful result. So, subsequent calls will not result in
// a network round-trip. This also means mutating c.DirectoryURL after successful call
// of this method will have no effect.
func (c *Client) Discover(ctx context.Context) (Directory, error) {
- c.dirMu.Lock()
- defer c.dirMu.Unlock()
+ c.cacheMu.Lock()
+ defer c.cacheMu.Unlock()
if c.dir != nil {
return *c.dir, nil
}
@@ -143,27 +176,53 @@ func (c *Client) Discover(ctx context.Context) (Directory, error) {
c.addNonce(res.Header)
var v struct {
- Reg string `json:"new-reg"`
- Authz string `json:"new-authz"`
- Cert string `json:"new-cert"`
- Revoke string `json:"revoke-cert"`
- Meta struct {
- Terms string `json:"terms-of-service"`
- Website string `json:"website"`
- CAA []string `json:"caa-identities"`
+ Reg string `json:"new-reg"`
+ RegRFC string `json:"newAccount"`
+ Authz string `json:"new-authz"`
+ AuthzRFC string `json:"newAuthz"`
+ OrderRFC string `json:"newOrder"`
+ Cert string `json:"new-cert"`
+ Revoke string `json:"revoke-cert"`
+ RevokeRFC string `json:"revokeCert"`
+ NonceRFC string `json:"newNonce"`
+ KeyChangeRFC string `json:"keyChange"`
+ Meta struct {
+ Terms string `json:"terms-of-service"`
+ TermsRFC string `json:"termsOfService"`
+ WebsiteRFC string `json:"website"`
+ CAA []string `json:"caa-identities"`
+ CAARFC []string `json:"caaIdentities"`
+ ExternalAcctRFC bool `json:"externalAccountRequired"`
}
}
if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
return Directory{}, err
}
+ if v.OrderRFC == "" {
+ // Non-RFC compliant ACME CA.
+ c.dir = &Directory{
+ RegURL: v.Reg,
+ AuthzURL: v.Authz,
+ CertURL: v.Cert,
+ RevokeURL: v.Revoke,
+ Terms: v.Meta.Terms,
+ Website: v.Meta.WebsiteRFC,
+ CAA: v.Meta.CAA,
+ }
+ return *c.dir, nil
+ }
+ // RFC compliant ACME CA.
c.dir = &Directory{
- RegURL: v.Reg,
- AuthzURL: v.Authz,
- CertURL: v.Cert,
- RevokeURL: v.Revoke,
- Terms: v.Meta.Terms,
- Website: v.Meta.Website,
- CAA: v.Meta.CAA,
+ RegURL: v.RegRFC,
+ AuthzURL: v.AuthzRFC,
+ OrderURL: v.OrderRFC,
+ RevokeURL: v.RevokeRFC,
+ NonceURL: v.NonceRFC,
+ KeyChangeURL: v.KeyChangeRFC,
+ Terms: v.Meta.TermsRFC,
+ Website: v.Meta.WebsiteRFC,
+ CAA: v.Meta.CAARFC,
+ ExternalAccountRequired: v.Meta.ExternalAcctRFC,
}
return *c.dir, nil
}
@@ -176,6 +235,9 @@ func (c *Client) directoryURL() string {
}
// CreateCert requests a new certificate using the Certificate Signing Request csr encoded in DER format.
+// It is incompatible with RFC 8555. Callers should use CreateOrderCert when interfacing
+// with an RFC-compliant CA.
+//
// The exp argument indicates the desired certificate validity duration. CA may issue a certificate
// with a different duration.
// If the bundle argument is true, the returned value will also contain the CA (issuer) certificate chain.
@@ -206,7 +268,7 @@ func (c *Client) CreateCert(ctx context.Context, csr []byte, exp time.Duration,
req.NotAfter = now.Add(exp).Format(time.RFC3339)
}
- res, err := c.post(ctx, c.Key, c.dir.CertURL, req, wantStatus(http.StatusCreated))
+ res, err := c.post(ctx, nil, c.dir.CertURL, req, wantStatus(http.StatusCreated))
if err != nil {
return nil, "", err
}
@@ -227,12 +289,22 @@ func (c *Client) CreateCert(ctx context.Context, csr []byte, exp time.Duration,
// It retries the request until the certificate is successfully retrieved,
// context is cancelled by the caller or an error response is received.
//
-// The returned value will also contain the CA (issuer) certificate if the bundle argument is true.
+// If the bundle argument is true, the returned value also contains the CA (issuer)
+// certificate chain.
//
// FetchCert returns an error if the CA's response or chain was unreasonably large.
// Callers are encouraged to parse the returned value to ensure the certificate is valid
// and has expected features.
func (c *Client) FetchCert(ctx context.Context, url string, bundle bool) ([][]byte, error) {
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+ if dir.rfcCompliant() {
+ return c.fetchCertRFC(ctx, url, bundle)
+ }
+
+ // Legacy non-authenticated GET request.
res, err := c.get(ctx, url, wantStatus(http.StatusOK))
if err != nil {
return nil, err
@@ -247,10 +319,15 @@ func (c *Client) FetchCert(ctx context.Context, url string, bundle bool) ([][]by
// For instance, the key pair of the certificate may be authorized.
// If the key is nil, c.Key is used instead.
func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, reason CRLReasonCode) error {
- if _, err := c.Discover(ctx); err != nil {
+ dir, err := c.Discover(ctx)
+ if err != nil {
return err
}
+ if dir.rfcCompliant() {
+ return c.revokeCertRFC(ctx, key, cert, reason)
+ }
+ // Legacy CA.
body := &struct {
Resource string `json:"resource"`
Cert string `json:"certificate"`
@@ -260,10 +337,7 @@ func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte,
Cert: base64.RawURLEncoding.EncodeToString(cert),
Reason: int(reason),
}
- if key == nil {
- key = c.Key
- }
- res, err := c.post(ctx, key, c.dir.RevokeURL, body, wantStatus(http.StatusOK))
+ res, err := c.post(ctx, key, dir.RevokeURL, body, wantStatus(http.StatusOK))
if err != nil {
return err
}
@@ -275,20 +349,30 @@ func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte,
// during account registration. See Register method of Client for more details.
func AcceptTOS(tosURL string) bool { return true }
-// Register creates a new account registration by following the "new-reg" flow.
-// It returns the registered account. The account is not modified.
+// Register creates a new account with the CA using c.Key.
+// It returns the registered account. The account acct is not modified.
//
// The registration may require the caller to agree to the CA's Terms of Service (TOS).
// If so, and the account has not indicated the acceptance of the terms (see Account for details),
// Register calls prompt with a TOS URL provided by the CA. Prompt should report
// whether the caller agrees to the terms. To always accept the terms, the caller can use AcceptTOS.
-func (c *Client) Register(ctx context.Context, a *Account, prompt func(tosURL string) bool) (*Account, error) {
- if _, err := c.Discover(ctx); err != nil {
+//
+// When interfacing with an RFC-compliant CA, non-RFC 8555 fields of acct are ignored
+// and prompt is called if Directory's Terms field is non-zero.
+// Also see Error's Instance field for when a CA requires already registered accounts to agree
+// to an updated Terms of Service.
+func (c *Client) Register(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
+ dir, err := c.Discover(ctx)
+ if err != nil {
return nil, err
}
+ if dir.rfcCompliant() {
+ return c.registerRFC(ctx, acct, prompt)
+ }
- var err error
- if a, err = c.doReg(ctx, c.dir.RegURL, "new-reg", a); err != nil {
+ // Legacy ACME draft registration flow.
+ a, err := c.doReg(ctx, dir.RegURL, "new-reg", acct)
+ if err != nil {
return nil, err
}
var accept bool
@@ -302,9 +386,20 @@ func (c *Client) Register(ctx context.Context, a *Account, prompt func(tosURL st
return a, err
}
-// GetReg retrieves an existing registration.
-// The url argument is an Account URI.
+// GetReg retrieves an existing account associated with c.Key.
+//
+// The url argument is an Account URI used with pre-RFC 8555 CAs.
+// It is ignored when interfacing with an RFC-compliant CA.
func (c *Client) GetReg(ctx context.Context, url string) (*Account, error) {
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+ if dir.rfcCompliant() {
+ return c.getRegRFC(ctx)
+ }
+
+ // Legacy CA.
a, err := c.doReg(ctx, url, "reg", nil)
if err != nil {
return nil, err
@@ -315,9 +410,21 @@ func (c *Client) GetReg(ctx context.Context, url string) (*Account, error) {
// UpdateReg updates an existing registration.
// It returns an updated account copy. The provided account is not modified.
-func (c *Client) UpdateReg(ctx context.Context, a *Account) (*Account, error) {
- uri := a.URI
- a, err := c.doReg(ctx, uri, "reg", a)
+//
+// When interfacing with RFC-compliant CAs, a.URI is ignored and the account URL
+// associated with c.Key is used instead.
+func (c *Client) UpdateReg(ctx context.Context, acct *Account) (*Account, error) {
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+ if dir.rfcCompliant() {
+ return c.updateRegRFC(ctx, acct)
+ }
+
+ // Legacy CA.
+ uri := acct.URI
+ a, err := c.doReg(ctx, uri, "reg", acct)
if err != nil {
return nil, err
}
@@ -325,13 +432,21 @@ func (c *Client) UpdateReg(ctx context.Context, a *Account) (*Account, error) {
return a, nil
}
-// Authorize performs the initial step in an authorization flow.
+// Authorize performs the initial step in the pre-authorization flow,
+// as opposed to order-based flow.
// The caller will then need to choose from and perform a set of returned
// challenges using c.Accept in order to successfully complete authorization.
//
+// Once complete, the caller can use AuthorizeOrder which the CA
+// should provision with the already satisfied authorization.
+// For pre-RFC CAs, the caller can proceed directly to requesting a certificate
+// using CreateCert method.
+//
// If an authorization has been previously granted, the CA may return
-// a valid authorization (Authorization.Status is StatusValid). If so, the caller
-// need not fulfill any challenge and can proceed to requesting a certificate.
+// a valid authorization which has its Status field set to StatusValid.
+//
+// More about pre-authorization can be found at
+// https://tools.ietf.org/html/rfc8555#section-7.4.1.
func (c *Client) Authorize(ctx context.Context, domain string) (*Authorization, error) {
return c.authorize(ctx, "dns", domain)
}
@@ -362,7 +477,7 @@ func (c *Client) authorize(ctx context.Context, typ, val string) (*Authorization
Resource: "new-authz",
Identifier: authzID{Type: typ, Value: val},
}
- res, err := c.post(ctx, c.Key, c.dir.AuthzURL, req, wantStatus(http.StatusCreated))
+ res, err := c.post(ctx, nil, c.dir.AuthzURL, req, wantStatus(http.StatusCreated))
if err != nil {
return nil, err
}
@@ -383,7 +498,17 @@ func (c *Client) authorize(ctx context.Context, typ, val string) (*Authorization
// If a caller needs to poll an authorization until its status is final,
// see the WaitAuthorization method.
func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorization, error) {
- res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ var res *http.Response
+ if dir.rfcCompliant() {
+ res, err = c.postAsGet(ctx, url, wantStatus(http.StatusOK))
+ } else {
+ res, err = c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
+ }
if err != nil {
return nil, err
}
@@ -400,11 +525,16 @@ func (c *Client) GetAuthorization(ctx context.Context, url string) (*Authorizati
// The url argument is an Authorization.URI value.
//
// If successful, the caller will be required to obtain a new authorization
-// using the Authorize method before being able to request a new certificate
-// for the domain associated with the authorization.
+// using the Authorize or AuthorizeOrder methods before being able to request
+// a new certificate for the domain associated with the authorization.
//
// It does not revoke existing certificates.
func (c *Client) RevokeAuthorization(ctx context.Context, url string) error {
+ // Required for c.accountKID() when in RFC mode.
+ if _, err := c.Discover(ctx); err != nil {
+ return err
+ }
+
req := struct {
Resource string `json:"resource"`
Status string `json:"status"`
@@ -414,7 +544,7 @@ func (c *Client) RevokeAuthorization(ctx context.Context, url string) error {
Status: "deactivated",
Delete: true,
}
- res, err := c.post(ctx, c.Key, url, req, wantStatus(http.StatusOK))
+ res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK))
if err != nil {
return err
}
@@ -430,8 +560,18 @@ func (c *Client) RevokeAuthorization(ctx context.Context, url string) error {
// In all other cases WaitAuthorization returns an error.
// If the Status is StatusInvalid, the returned error is of type *AuthorizationError.
func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorization, error) {
+ // Required for c.accountKID() when in RFC mode.
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+ getfn := c.postAsGet
+ if !dir.rfcCompliant() {
+ getfn = c.get
+ }
+
for {
- res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
+ res, err := getfn(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
if err != nil {
return nil, err
}
@@ -474,10 +614,21 @@ func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorizat
//
// A client typically polls a challenge status using this method.
func (c *Client) GetChallenge(ctx context.Context, url string) (*Challenge, error) {
- res, err := c.get(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
+ // Required for c.accountKID() when in RFC mode.
+ dir, err := c.Discover(ctx)
if err != nil {
return nil, err
}
+
+ getfn := c.postAsGet
+ if !dir.rfcCompliant() {
+ getfn = c.get
+ }
+ res, err := getfn(ctx, url, wantStatus(http.StatusOK, http.StatusAccepted))
+ if err != nil {
+ return nil, err
+ }
+
defer res.Body.Close()
v := wireChallenge{URI: url}
if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
@@ -491,21 +642,29 @@ func (c *Client) GetChallenge(ctx context.Context, url string) (*Challenge, erro
//
// The server will then perform the validation asynchronously.
func (c *Client) Accept(ctx context.Context, chal *Challenge) (*Challenge, error) {
- auth, err := keyAuth(c.Key.Public(), chal.Token)
+ // Required for c.accountKID() when in RFC mode.
+ dir, err := c.Discover(ctx)
if err != nil {
return nil, err
}
- req := struct {
- Resource string `json:"resource"`
- Type string `json:"type"`
- Auth string `json:"keyAuthorization"`
- }{
- Resource: "challenge",
- Type: chal.Type,
- Auth: auth,
+ var req interface{} = json.RawMessage("{}") // RFC-compliant CA
+ if !dir.rfcCompliant() {
+ auth, err := keyAuth(c.Key.Public(), chal.Token)
+ if err != nil {
+ return nil, err
+ }
+ req = struct {
+ Resource string `json:"resource"`
+ Type string `json:"type"`
+ Auth string `json:"keyAuthorization"`
+ }{
+ Resource: "challenge",
+ Type: chal.Type,
+ Auth: auth,
+ }
}
- res, err := c.post(ctx, c.Key, chal.URI, req, wantStatus(
+ res, err := c.post(ctx, nil, chal.URI, req, wantStatus(
http.StatusOK, // according to the spec
http.StatusAccepted, // Let's Encrypt: see https://goo.gl/WsJ7VT (acme-divergences.md)
))
@@ -555,21 +714,8 @@ func (c *Client) HTTP01ChallengePath(token string) string {
}
// TLSSNI01ChallengeCert creates a certificate for TLS-SNI-01 challenge response.
-// Servers can present the certificate to validate the challenge and prove control
-// over a domain name.
//
-// The implementation is incomplete in that the returned value is a single certificate,
-// computed only for Z0 of the key authorization. ACME CAs are expected to update
-// their implementations to use the newer version, TLS-SNI-02.
-// For more details on TLS-SNI-01 see https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.3.
-//
-// The token argument is a Challenge.Token value.
-// If a WithKey option is provided, its private part signs the returned cert,
-// and the public part is used to specify the signee.
-// If no WithKey option is provided, a new ECDSA key is generated using P-256 curve.
-//
-// The returned certificate is valid for the next 24 hours and must be presented only when
-// the server name of the TLS ClientHello matches exactly the returned name value.
+// Deprecated: This challenge type is unused in both draft-02 and RFC versions of ACME spec.
func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) {
ka, err := keyAuth(c.Key.Public(), token)
if err != nil {
@@ -586,17 +732,8 @@ func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (cert tl
}
// TLSSNI02ChallengeCert creates a certificate for TLS-SNI-02 challenge response.
-// Servers can present the certificate to validate the challenge and prove control
-// over a domain name. For more details on TLS-SNI-02 see
-// https://tools.ietf.org/html/draft-ietf-acme-acme-03#section-7.3.
//
-// The token argument is a Challenge.Token value.
-// If a WithKey option is provided, its private part signs the returned cert,
-// and the public part is used to specify the signee.
-// If no WithKey option is provided, a new ECDSA key is generated using P-256 curve.
-//
-// The returned certificate is valid for the next 24 hours and must be presented only when
-// the server name in the TLS ClientHello matches exactly the returned name value.
+// Deprecated: This challenge type is unused in both draft-02 and RFC versions of ACME spec.
func (c *Client) TLSSNI02ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) {
b := sha256.Sum256([]byte(token))
h := hex.EncodeToString(b[:])
@@ -663,7 +800,7 @@ func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption)
return tlsChallengeCert([]string{domain}, newOpt)
}
-// doReg sends all types of registration requests.
+// doReg sends all types of registration requests the old way (pre-RFC world).
// The type of request is identified by typ argument, which is a "resource"
// in the ACME spec terms.
//
@@ -682,7 +819,7 @@ func (c *Client) doReg(ctx context.Context, url string, typ string, acct *Accoun
req.Contact = acct.Contact
req.Agreement = acct.AgreedTerms
}
- res, err := c.post(ctx, c.Key, url, req, wantStatus(
+ res, err := c.post(ctx, nil, url, req, wantStatus(
http.StatusOK, // updates and deletes
http.StatusCreated, // new account creation
http.StatusAccepted, // Let's Encrypt divergent implementation
@@ -721,12 +858,16 @@ func (c *Client) doReg(ctx context.Context, url string, typ string, acct *Accoun
}
// popNonce returns a nonce value previously stored with c.addNonce
-// or fetches a fresh one from a URL by issuing a HEAD request.
-// It first tries c.directoryURL() and then the provided url if the former fails.
+// or fetches a fresh one from c.dir.NonceURL.
+// If NonceURL is empty, it first tries c.directoryURL() and, failing that,
+// the provided url.
func (c *Client) popNonce(ctx context.Context, url string) (string, error) {
c.noncesMu.Lock()
defer c.noncesMu.Unlock()
if len(c.nonces) == 0 {
+ if c.dir != nil && c.dir.NonceURL != "" {
+ return c.fetchNonce(ctx, c.dir.NonceURL)
+ }
dirURL := c.directoryURL()
v, err := c.fetchNonce(ctx, dirURL)
if err != nil && url != dirURL {
diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go
index 70ab355f37..5256bc3105 100644
--- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go
+++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go
@@ -88,9 +88,9 @@ func defaultHostPolicy(context.Context, string) error {
}
// Manager is a stateful certificate manager built on top of acme.Client.
-// It obtains and refreshes certificates automatically using "tls-alpn-01",
-// "tls-sni-01", "tls-sni-02" and "http-01" challenge types,
-// as well as providing them to a TLS server via tls.Config.
+// It obtains and refreshes certificates automatically using "tls-alpn-01"
+// or "http-01" challenge types, as well as providing them to a TLS server
+// via tls.Config.
//
// You must specify a cache implementation, such as DirCache,
// to reuse obtained certificates across program restarts.
@@ -184,10 +184,8 @@ type Manager struct {
// to be provisioned.
// The entries are stored for the duration of the authorization flow.
httpTokens map[string][]byte
- // certTokens contains temporary certificates for tls-sni and tls-alpn challenges
- // and is keyed by token domain name, which matches server name of ClientHello.
- // Keys always have ".acme.invalid" suffix for tls-sni. Otherwise, they are domain names
- // for tls-alpn.
+ // certTokens contains temporary certificates for tls-alpn-01 challenges
+ // and is keyed by the domain name which matches the ClientHello server name.
// The entries are stored for the duration of the authorization flow.
certTokens map[string]*tls.Certificate
// nowFunc, if not nil, returns the current time. This may be set for
@@ -226,7 +224,7 @@ func (m *Manager) TLSConfig() *tls.Config {
// GetCertificate implements the tls.Config.GetCertificate hook.
// It provides a TLS certificate for hello.ServerName host, including answering
-// tls-alpn-01 and *.acme.invalid (tls-sni-01 and tls-sni-02) challenges.
+// tls-alpn-01 challenges.
// All other fields of hello are ignored.
//
// If m.HostPolicy is non-nil, GetCertificate calls the policy before requesting
@@ -235,9 +233,7 @@ func (m *Manager) TLSConfig() *tls.Config {
// This does not affect cached certs. See HostPolicy field description for more details.
//
// If GetCertificate is used directly, instead of via Manager.TLSConfig, package users will
-// also have to add acme.ALPNProto to NextProtos for tls-alpn-01, or use HTTPHandler
-// for http-01. (The tls-sni-* challenges have been deprecated by popular ACME providers
-// due to security issues in the ecosystem.)
+// also have to add acme.ALPNProto to NextProtos for tls-alpn-01, or use HTTPHandler for http-01.
func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
if m.Prompt == nil {
return nil, errors.New("acme/autocert: Manager.Prompt not set")
@@ -269,13 +265,10 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
- // Check whether this is a token cert requested for TLS-SNI or TLS-ALPN challenge.
+ // Check whether this is a token cert requested for TLS-ALPN challenge.
if wantsTokenCert(hello) {
m.tokensMu.RLock()
defer m.tokensMu.RUnlock()
- // It's ok to use the same token cert key for both tls-sni and tls-alpn
- // because there's always at most 1 token cert per on-going domain authorization.
- // See m.verify for details.
if cert := m.certTokens[name]; cert != nil {
return cert, nil
}
@@ -318,8 +311,7 @@ func wantsTokenCert(hello *tls.ClientHelloInfo) bool {
if len(hello.SupportedProtos) == 1 && hello.SupportedProtos[0] == acme.ALPNProto {
return true
}
- // tls-sni-xx
- return strings.HasSuffix(hello.ServerName, ".acme.invalid")
+ return false
}
func supportsECDSA(hello *tls.ClientHelloInfo) bool {
@@ -688,7 +680,7 @@ func (m *Manager) revokePendingAuthz(ctx context.Context, uri []string) {
func (m *Manager) verify(ctx context.Context, client *acme.Client, domain string) error {
// The list of challenge types we'll try to fulfill
// in this specific order.
- challengeTypes := []string{"tls-alpn-01", "tls-sni-02", "tls-sni-01"}
+ challengeTypes := []string{"tls-alpn-01"}
m.tokensMu.RLock()
if m.tryHTTP01 {
challengeTypes = append(challengeTypes, "http-01")
@@ -776,20 +768,6 @@ func (m *Manager) fulfill(ctx context.Context, client *acme.Client, chal *acme.C
}
m.putCertToken(ctx, domain, &cert)
return func() { go m.deleteCertToken(domain) }, nil
- case "tls-sni-01":
- cert, name, err := client.TLSSNI01ChallengeCert(chal.Token)
- if err != nil {
- return nil, err
- }
- m.putCertToken(ctx, name, &cert)
- return func() { go m.deleteCertToken(name) }, nil
- case "tls-sni-02":
- cert, name, err := client.TLSSNI02ChallengeCert(chal.Token)
- if err != nil {
- return nil, err
- }
- m.putCertToken(ctx, name, &cert)
- return func() { go m.deleteCertToken(name) }, nil
case "http-01":
resp, err := client.HTTP01ChallengeResponse(chal.Token)
if err != nil {
diff --git a/vendor/golang.org/x/crypto/acme/autocert/cache.go b/vendor/golang.org/x/crypto/acme/autocert/cache.go
index aa9aa845c8..03f63022fa 100644
--- a/vendor/golang.org/x/crypto/acme/autocert/cache.go
+++ b/vendor/golang.org/x/crypto/acme/autocert/cache.go
@@ -77,6 +77,7 @@ func (d DirCache) Put(ctx context.Context, name string, data []byte) error {
if tmp, err = d.writeTempFile(name, data); err != nil {
return
}
+ defer os.Remove(tmp)
select {
case <-ctx.Done():
// Don't overwrite the file if the context was canceled.
@@ -116,12 +117,17 @@ func (d DirCache) Delete(ctx context.Context, name string) error {
}
// writeTempFile writes b to a temporary file, closes the file and returns its path.
-func (d DirCache) writeTempFile(prefix string, b []byte) (string, error) {
+func (d DirCache) writeTempFile(prefix string, b []byte) (name string, reterr error) {
// TempFile uses 0600 permissions
f, err := ioutil.TempFile(string(d), prefix)
if err != nil {
return "", err
}
+ defer func() {
+ if reterr != nil {
+ os.Remove(f.Name())
+ }
+ }()
if _, err := f.Write(b); err != nil {
f.Close()
return "", err
diff --git a/vendor/golang.org/x/crypto/acme/http.go b/vendor/golang.org/x/crypto/acme/http.go
index 600d5798b8..c51943e71a 100644
--- a/vendor/golang.org/x/crypto/acme/http.go
+++ b/vendor/golang.org/x/crypto/acme/http.go
@@ -155,8 +155,16 @@ func (c *Client) get(ctx context.Context, url string, ok resOkay) (*http.Respons
}
}
+// postAsGet is POST-as-GET, a replacement for GET in RFC8555
+// as described in https://tools.ietf.org/html/rfc8555#section-6.3.
+// It makes a POST request in KID form with zero JWS payload.
+// See nopayload doc comments in jws.go.
+func (c *Client) postAsGet(ctx context.Context, url string, ok resOkay) (*http.Response, error) {
+ return c.post(ctx, nil, url, noPayload, ok)
+}
+
// post issues a signed POST request in JWS format using the provided key
-// to the specified URL.
+// to the specified URL. If key is nil, c.Key is used instead.
// It returns a non-error value only when ok reports true.
//
// post retries unsuccessful attempts according to c.RetryBackoff
@@ -193,14 +201,28 @@ func (c *Client) post(ctx context.Context, key crypto.Signer, url string, body i
}
// postNoRetry signs the body with the given key and POSTs it to the provided url.
-// The body argument must be JSON-serializable.
// It is used by c.post to retry unsuccessful attempts.
+// The body argument must be JSON-serializable.
+//
+// If key argument is nil, c.Key is used to sign the request.
+// If key argument is nil and c.accountKID returns a non-zero keyID,
+// the request is sent in KID form. Otherwise, JWK form is used.
+//
+// In practice, when interfacing with RFC-compliant CAs most requests are sent in KID form
+// and JWK is used only when KID is unavailable: new account endpoint and certificate
+// revocation requests authenticated by a cert key.
+// See jwsEncodeJSON for other details.
func (c *Client) postNoRetry(ctx context.Context, key crypto.Signer, url string, body interface{}) (*http.Response, *http.Request, error) {
+ kid := noKeyID
+ if key == nil {
+ key = c.Key
+ kid = c.accountKID(ctx)
+ }
nonce, err := c.popNonce(ctx, url)
if err != nil {
return nil, nil, err
}
- b, err := jwsEncodeJSON(body, key, nonce)
+ b, err := jwsEncodeJSON(body, key, kid, nonce, url)
if err != nil {
return nil, nil, err
}
diff --git a/vendor/golang.org/x/crypto/acme/jws.go b/vendor/golang.org/x/crypto/acme/jws.go
index 1093b50390..cac8b6786e 100644
--- a/vendor/golang.org/x/crypto/acme/jws.go
+++ b/vendor/golang.org/x/crypto/acme/jws.go
@@ -17,25 +17,53 @@ import (
"math/big"
)
+// keyID is the account identity provided by a CA during registration.
+type keyID string
+
+// noKeyID indicates that jwsEncodeJSON should compute and use JWK instead of a KID.
+// See jwsEncodeJSON for details.
+const noKeyID = keyID("")
+
+// noPayload indicates jwsEncodeJSON will encode zero-length octet string
+// in a JWS request. This is called POST-as-GET in RFC 8555 and is used to make
+// authenticated GET requests via POSTing with an empty payload.
+// See https://tools.ietf.org/html/rfc8555#section-6.3 for more details.
+const noPayload = ""
+
// jwsEncodeJSON signs claimset using provided key and a nonce.
-// The result is serialized in JSON format.
+// The result is serialized in JSON format containing either kid or jwk
+// fields based on the provided keyID value.
+//
+// If kid is non-empty, its quoted value is inserted in the protected head
+// as "kid" field value. Otherwise, JWK is computed using jwkEncode and inserted
+// as "jwk" field value. The "jwk" and "kid" fields are mutually exclusive.
+//
// See https://tools.ietf.org/html/rfc7515#section-7.
-func jwsEncodeJSON(claimset interface{}, key crypto.Signer, nonce string) ([]byte, error) {
- jwk, err := jwkEncode(key.Public())
- if err != nil {
- return nil, err
- }
+func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid keyID, nonce, url string) ([]byte, error) {
alg, sha := jwsHasher(key.Public())
if alg == "" || !sha.Available() {
return nil, ErrUnsupportedKey
}
- phead := fmt.Sprintf(`{"alg":%q,"jwk":%s,"nonce":%q}`, alg, jwk, nonce)
- phead = base64.RawURLEncoding.EncodeToString([]byte(phead))
- cs, err := json.Marshal(claimset)
- if err != nil {
- return nil, err
+ var phead string
+ switch kid {
+ case noKeyID:
+ jwk, err := jwkEncode(key.Public())
+ if err != nil {
+ return nil, err
+ }
+ phead = fmt.Sprintf(`{"alg":%q,"jwk":%s,"nonce":%q,"url":%q}`, alg, jwk, nonce, url)
+ default:
+ phead = fmt.Sprintf(`{"alg":%q,"kid":%q,"nonce":%q,"url":%q}`, alg, kid, nonce, url)
+ }
+ phead = base64.RawURLEncoding.EncodeToString([]byte(phead))
+ var payload string
+ if claimset != noPayload {
+ cs, err := json.Marshal(claimset)
+ if err != nil {
+ return nil, err
+ }
+ payload = base64.RawURLEncoding.EncodeToString(cs)
}
- payload := base64.RawURLEncoding.EncodeToString(cs)
hash := sha.New()
hash.Write([]byte(phead + "." + payload))
sig, err := jwsSign(key, sha, hash.Sum(nil))
diff --git a/vendor/golang.org/x/crypto/acme/rfc8555.go b/vendor/golang.org/x/crypto/acme/rfc8555.go
new file mode 100644
index 0000000000..dfb57a66fd
--- /dev/null
+++ b/vendor/golang.org/x/crypto/acme/rfc8555.go
@@ -0,0 +1,392 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package acme
+
+import (
+ "context"
+ "crypto"
+ "encoding/base64"
+ "encoding/json"
+ "encoding/pem"
+ "errors"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "time"
+)
+
+// DeactivateReg permanently disables an existing account associated with c.Key.
+// A deactivated account can no longer request certificate issuance or access
+// resources related to the account, such as orders or authorizations.
+//
+// It only works with CAs implementing RFC 8555.
+func (c *Client) DeactivateReg(ctx context.Context) error {
+ url := string(c.accountKID(ctx))
+ if url == "" {
+ return ErrNoAccount
+ }
+ req := json.RawMessage(`{"status": "deactivated"}`)
+ res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK))
+ if err != nil {
+ return err
+ }
+ res.Body.Close()
+ return nil
+}
+
+// registerRFC is quivalent to c.Register but for CAs implementing RFC 8555.
+// It expects c.Discover to have already been called.
+// TODO: Implement externalAccountBinding.
+func (c *Client) registerRFC(ctx context.Context, acct *Account, prompt func(tosURL string) bool) (*Account, error) {
+ c.cacheMu.Lock() // guard c.kid access
+ defer c.cacheMu.Unlock()
+
+ req := struct {
+ TermsAgreed bool `json:"termsOfServiceAgreed,omitempty"`
+ Contact []string `json:"contact,omitempty"`
+ }{
+ Contact: acct.Contact,
+ }
+ if c.dir.Terms != "" {
+ req.TermsAgreed = prompt(c.dir.Terms)
+ }
+ res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus(
+ http.StatusOK, // account with this key already registered
+ http.StatusCreated, // new account created
+ ))
+ if err != nil {
+ return nil, err
+ }
+
+ defer res.Body.Close()
+ a, err := responseAccount(res)
+ if err != nil {
+ return nil, err
+ }
+ // Cache Account URL even if we return an error to the caller.
+ // It is by all means a valid and usable "kid" value for future requests.
+ c.kid = keyID(a.URI)
+ if res.StatusCode == http.StatusOK {
+ return nil, ErrAccountAlreadyExists
+ }
+ return a, nil
+}
+
+// updateGegRFC is equivalent to c.UpdateReg but for CAs implementing RFC 8555.
+// It expects c.Discover to have already been called.
+func (c *Client) updateRegRFC(ctx context.Context, a *Account) (*Account, error) {
+ url := string(c.accountKID(ctx))
+ if url == "" {
+ return nil, ErrNoAccount
+ }
+ req := struct {
+ Contact []string `json:"contact,omitempty"`
+ }{
+ Contact: a.Contact,
+ }
+ res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+ return responseAccount(res)
+}
+
+// getGegRFC is equivalent to c.GetReg but for CAs implementing RFC 8555.
+// It expects c.Discover to have already been called.
+func (c *Client) getRegRFC(ctx context.Context) (*Account, error) {
+ req := json.RawMessage(`{"onlyReturnExisting": true}`)
+ res, err := c.post(ctx, c.Key, c.dir.RegURL, req, wantStatus(http.StatusOK))
+ if e, ok := err.(*Error); ok && e.ProblemType == "urn:ietf:params:acme:error:accountDoesNotExist" {
+ return nil, ErrNoAccount
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ defer res.Body.Close()
+ return responseAccount(res)
+}
+
+func responseAccount(res *http.Response) (*Account, error) {
+ var v struct {
+ Status string
+ Contact []string
+ Orders string
+ }
+ if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
+ return nil, fmt.Errorf("acme: invalid account response: %v", err)
+ }
+ return &Account{
+ URI: res.Header.Get("Location"),
+ Status: v.Status,
+ Contact: v.Contact,
+ OrdersURL: v.Orders,
+ }, nil
+}
+
+// AuthorizeOrder initiates the order-based application for certificate issuance,
+// as opposed to pre-authorization in Authorize.
+// It is only supported by CAs implementing RFC 8555.
+//
+// The caller then needs to fetch each authorization with GetAuthorization,
+// identify those with StatusPending status and fulfill a challenge using Accept.
+// Once all authorizations are satisfied, the caller will typically want to poll
+// order status using WaitOrder until it's in StatusReady state.
+// To finalize the order and obtain a certificate, the caller submits a CSR with CreateOrderCert.
+func (c *Client) AuthorizeOrder(ctx context.Context, id []AuthzID, opt ...OrderOption) (*Order, error) {
+ dir, err := c.Discover(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ req := struct {
+ Identifiers []wireAuthzID `json:"identifiers"`
+ NotBefore string `json:"notBefore,omitempty"`
+ NotAfter string `json:"notAfter,omitempty"`
+ }{}
+ for _, v := range id {
+ req.Identifiers = append(req.Identifiers, wireAuthzID{
+ Type: v.Type,
+ Value: v.Value,
+ })
+ }
+ for _, o := range opt {
+ switch o := o.(type) {
+ case orderNotBeforeOpt:
+ req.NotBefore = time.Time(o).Format(time.RFC3339)
+ case orderNotAfterOpt:
+ req.NotAfter = time.Time(o).Format(time.RFC3339)
+ default:
+ // Package's fault if we let this happen.
+ panic(fmt.Sprintf("unsupported order option type %T", o))
+ }
+ }
+
+ res, err := c.post(ctx, nil, dir.OrderURL, req, wantStatus(http.StatusCreated))
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+ return responseOrder(res)
+}
+
+// GetOrder retrives an order identified by the given URL.
+// For orders created with AuthorizeOrder, the url value is Order.URI.
+//
+// If a caller needs to poll an order until its status is final,
+// see the WaitOrder method.
+func (c *Client) GetOrder(ctx context.Context, url string) (*Order, error) {
+ if _, err := c.Discover(ctx); err != nil {
+ return nil, err
+ }
+
+ res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+ return responseOrder(res)
+}
+
+// WaitOrder polls an order from the given URL until it is in one of the final states,
+// StatusReady, StatusValid or StatusInvalid, the CA responded with a non-retryable error
+// or the context is done.
+//
+// It returns a non-nil Order only if its Status is StatusReady or StatusValid.
+// In all other cases WaitOrder returns an error.
+// If the Status is StatusInvalid, the returned error is of type *OrderError.
+func (c *Client) WaitOrder(ctx context.Context, url string) (*Order, error) {
+ if _, err := c.Discover(ctx); err != nil {
+ return nil, err
+ }
+ for {
+ res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, err
+ }
+ o, err := responseOrder(res)
+ res.Body.Close()
+ switch {
+ case err != nil:
+ // Skip and retry.
+ case o.Status == StatusInvalid:
+ return nil, &OrderError{OrderURL: o.URI, Status: o.Status}
+ case o.Status == StatusReady || o.Status == StatusValid:
+ return o, nil
+ }
+
+ d := retryAfter(res.Header.Get("Retry-After"))
+ if d == 0 {
+ // Default retry-after.
+ // Same reasoning as in WaitAuthorization.
+ d = time.Second
+ }
+ t := time.NewTimer(d)
+ select {
+ case <-ctx.Done():
+ t.Stop()
+ return nil, ctx.Err()
+ case <-t.C:
+ // Retry.
+ }
+ }
+}
+
+func responseOrder(res *http.Response) (*Order, error) {
+ var v struct {
+ Status string
+ Expires time.Time
+ Identifiers []wireAuthzID
+ NotBefore time.Time
+ NotAfter time.Time
+ Error *wireError
+ Authorizations []string
+ Finalize string
+ Certificate string
+ }
+ if err := json.NewDecoder(res.Body).Decode(&v); err != nil {
+ return nil, fmt.Errorf("acme: error reading order: %v", err)
+ }
+ o := &Order{
+ URI: res.Header.Get("Location"),
+ Status: v.Status,
+ Expires: v.Expires,
+ NotBefore: v.NotBefore,
+ NotAfter: v.NotAfter,
+ AuthzURLs: v.Authorizations,
+ FinalizeURL: v.Finalize,
+ CertURL: v.Certificate,
+ }
+ for _, id := range v.Identifiers {
+ o.Identifiers = append(o.Identifiers, AuthzID{Type: id.Type, Value: id.Value})
+ }
+ if v.Error != nil {
+ o.Error = v.Error.error(nil /* headers */)
+ }
+ return o, nil
+}
+
+// CreateOrderCert submits the CSR (Certificate Signing Request) to a CA at the specified URL.
+// The URL is the FinalizeURL field of an Order created with AuthorizeOrder.
+//
+// If the bundle argument is true, the returned value also contain the CA (issuer)
+// certificate chain. Otherwise, only a leaf certificate is returned.
+// The returned URL can be used to re-fetch the certificate using FetchCert.
+//
+// This method is only supported by CAs implementing RFC 8555. See CreateCert for pre-RFC CAs.
+//
+// CreateOrderCert returns an error if the CA's response is unreasonably large.
+// Callers are encouraged to parse the returned value to ensure the certificate is valid and has the expected features.
+func (c *Client) CreateOrderCert(ctx context.Context, url string, csr []byte, bundle bool) (der [][]byte, certURL string, err error) {
+ if _, err := c.Discover(ctx); err != nil { // required by c.accountKID
+ return nil, "", err
+ }
+
+ // RFC describes this as "finalize order" request.
+ req := struct {
+ CSR string `json:"csr"`
+ }{
+ CSR: base64.RawURLEncoding.EncodeToString(csr),
+ }
+ res, err := c.post(ctx, nil, url, req, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, "", err
+ }
+ defer res.Body.Close()
+ o, err := responseOrder(res)
+ if err != nil {
+ return nil, "", err
+ }
+
+ // Wait for CA to issue the cert if they haven't.
+ if o.Status != StatusValid {
+ o, err = c.WaitOrder(ctx, o.URI)
+ }
+ if err != nil {
+ return nil, "", err
+ }
+ // The only acceptable status post finalize and WaitOrder is "valid".
+ if o.Status != StatusValid {
+ return nil, "", &OrderError{OrderURL: o.URI, Status: o.Status}
+ }
+ crt, err := c.fetchCertRFC(ctx, o.CertURL, bundle)
+ return crt, o.CertURL, err
+}
+
+// fetchCertRFC downloads issued certificate from the given URL.
+// It expects the CA to respond with PEM-encoded certificate chain.
+//
+// The URL argument is the CertURL field of Order.
+func (c *Client) fetchCertRFC(ctx context.Context, url string, bundle bool) ([][]byte, error) {
+ res, err := c.postAsGet(ctx, url, wantStatus(http.StatusOK))
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+
+ // Get all the bytes up to a sane maximum.
+ // Account very roughly for base64 overhead.
+ const max = maxCertChainSize + maxCertChainSize/33
+ b, err := ioutil.ReadAll(io.LimitReader(res.Body, max+1))
+ if err != nil {
+ return nil, fmt.Errorf("acme: fetch cert response stream: %v", err)
+ }
+ if len(b) > max {
+ return nil, errors.New("acme: certificate chain is too big")
+ }
+
+ // Decode PEM chain.
+ var chain [][]byte
+ for {
+ var p *pem.Block
+ p, b = pem.Decode(b)
+ if p == nil {
+ break
+ }
+ if p.Type != "CERTIFICATE" {
+ return nil, fmt.Errorf("acme: invalid PEM cert type %q", p.Type)
+ }
+
+ chain = append(chain, p.Bytes)
+ if !bundle {
+ return chain, nil
+ }
+ if len(chain) > maxChainLen {
+ return nil, errors.New("acme: certificate chain is too long")
+ }
+ }
+ if len(chain) == 0 {
+ return nil, errors.New("acme: certificate chain is empty")
+ }
+ return chain, nil
+}
+
+// sends a cert revocation request in either JWK form when key is non-nil or KID form otherwise.
+func (c *Client) revokeCertRFC(ctx context.Context, key crypto.Signer, cert []byte, reason CRLReasonCode) error {
+ req := &struct {
+ Cert string `json:"certificate"`
+ Reason int `json:"reason"`
+ }{
+ Cert: base64.RawURLEncoding.EncodeToString(cert),
+ Reason: int(reason),
+ }
+ res, err := c.post(ctx, key, c.dir.RevokeURL, req, wantStatus(http.StatusOK))
+ if err != nil {
+ if isAlreadyRevoked(err) {
+ // Assume it is not an error to revoke an already revoked cert.
+ return nil
+ }
+ return err
+ }
+ defer res.Body.Close()
+ return nil
+}
+
+func isAlreadyRevoked(err error) bool {
+ e, ok := err.(*Error)
+ return ok && e.ProblemType == "urn:ietf:params:acme:error:alreadyRevoked"
+}
diff --git a/vendor/golang.org/x/crypto/acme/types.go b/vendor/golang.org/x/crypto/acme/types.go
index 54792c0650..9c59097a05 100644
--- a/vendor/golang.org/x/crypto/acme/types.go
+++ b/vendor/golang.org/x/crypto/acme/types.go
@@ -14,14 +14,18 @@ import (
"time"
)
-// ACME server response statuses used to describe Authorization and Challenge states.
+// ACME status values of Account, Order, Authorization and Challenge objects.
+// See https://tools.ietf.org/html/rfc8555#section-7.1.6 for details.
const (
- StatusUnknown = "unknown"
- StatusPending = "pending"
- StatusProcessing = "processing"
- StatusValid = "valid"
- StatusInvalid = "invalid"
- StatusRevoked = "revoked"
+ StatusDeactivated = "deactivated"
+ StatusExpired = "expired"
+ StatusInvalid = "invalid"
+ StatusPending = "pending"
+ StatusProcessing = "processing"
+ StatusReady = "ready"
+ StatusRevoked = "revoked"
+ StatusUnknown = "unknown"
+ StatusValid = "valid"
)
// CRLReasonCode identifies the reason for a certificate revocation.
@@ -41,8 +45,17 @@ const (
CRLReasonAACompromise CRLReasonCode = 10
)
-// ErrUnsupportedKey is returned when an unsupported key type is encountered.
-var ErrUnsupportedKey = errors.New("acme: unknown key type; only RSA and ECDSA are supported")
+var (
+ // ErrUnsupportedKey is returned when an unsupported key type is encountered.
+ ErrUnsupportedKey = errors.New("acme: unknown key type; only RSA and ECDSA are supported")
+
+ // ErrAccountAlreadyExists indicates that the Client's key has already been registered
+ // with the CA. It is returned by Register method.
+ ErrAccountAlreadyExists = errors.New("acme: account already exists")
+
+ // ErrNoAccount indicates that the Client's key has not been registered with the CA.
+ ErrNoAccount = errors.New("acme: account does not exist")
+)
// Error is an ACME error, defined in Problem Details for HTTP APIs doc
// http://tools.ietf.org/html/draft-ietf-appsawg-http-problem.
@@ -54,6 +67,12 @@ type Error struct {
ProblemType string
// Detail is a human-readable explanation specific to this occurrence of the problem.
Detail string
+ // Instance indicates a URL that the client should direct a human user to visit
+ // in order for instructions on how to agree to the updated Terms of Service.
+ // In such an event CA sets StatusCode to 403, ProblemType to
+ // "urn:ietf:params:acme:error:userActionRequired" and a Link header with relation
+ // "terms-of-service" containing the latest TOS URL.
+ Instance string
// Header is the original server error response headers.
// It may be nil.
Header http.Header
@@ -86,6 +105,21 @@ func (a *AuthorizationError) Error() string {
return fmt.Sprintf("acme: authorization error for %s: %s", a.Identifier, strings.Join(e, "; "))
}
+// OrderError is returned from Client's order related methods.
+// It indicates the order is unusable and the clients should start over with
+// AuthorizeOrder.
+//
+// The clients can still fetch the order object from CA using GetOrder
+// to inspect its state.
+type OrderError struct {
+ OrderURL string
+ Status string
+}
+
+func (oe *OrderError) Error() string {
+ return fmt.Sprintf("acme: order %s status: %s", oe.OrderURL, oe.Status)
+}
+
// RateLimit reports whether err represents a rate limit error and
// any Retry-After duration returned by the server.
//
@@ -108,49 +142,88 @@ func RateLimit(err error) (time.Duration, bool) {
}
// Account is a user account. It is associated with a private key.
+// Non-RFC 8555 fields are empty when interfacing with a compliant CA.
type Account struct {
// URI is the account unique ID, which is also a URL used to retrieve
// account data from the CA.
+ // When interfacing with RFC 8555-compliant CAs, URI is the "kid" field
+ // value in JWS signed requests.
URI string
// Contact is a slice of contact info used during registration.
+ // See https://tools.ietf.org/html/rfc8555#section-7.3 for supported
+ // formats.
Contact []string
+ // Status indicates current account status as returned by the CA.
+ // Possible values are StatusValid, StatusDeactivated, and StatusRevoked.
+ Status string
+
+ // OrdersURL is a URL from which a list of orders submitted by this account
+ // can be fetched.
+ OrdersURL string
+
// The terms user has agreed to.
// A value not matching CurrentTerms indicates that the user hasn't agreed
// to the actual Terms of Service of the CA.
+ //
+ // It is non-RFC 8555 compliant. Package users can store the ToS they agree to
+ // during Client's Register call in the prompt callback function.
AgreedTerms string
// Actual terms of a CA.
+ //
+ // It is non-RFC 8555 compliant. Use Directory's Terms field.
+ // When a CA updates their terms and requires an account agreement,
+ // a URL at which instructions to do so is available in Error's Instance field.
CurrentTerms string
// Authz is the authorization URL used to initiate a new authz flow.
+ //
+ // It is non-RFC 8555 compliant. Use Directory's AuthzURL or OrderURL.
Authz string
// Authorizations is a URI from which a list of authorizations
// granted to this account can be fetched via a GET request.
+ //
+ // It is non-RFC 8555 compliant and is obsoleted by OrdersURL.
Authorizations string
// Certificates is a URI from which a list of certificates
// issued for this account can be fetched via a GET request.
+ //
+ // It is non-RFC 8555 compliant and is obsoleted by OrdersURL.
Certificates string
}
// Directory is ACME server discovery data.
+// See https://tools.ietf.org/html/rfc8555#section-7.1.1 for more details.
type Directory struct {
- // RegURL is an account endpoint URL, allowing for creating new
- // and modifying existing accounts.
+ // NonceURL indicates an endpoint where to fetch fresh nonce values from.
+ NonceURL string
+
+ // RegURL is an account endpoint URL, allowing for creating new accounts.
+ // Pre-RFC 8555 CAs also allow modifying existing accounts at this URL.
RegURL string
- // AuthzURL is used to initiate Identifier Authorization flow.
+ // OrderURL is used to initiate the certificate issuance flow
+ // as described in RFC 8555.
+ OrderURL string
+
+ // AuthzURL is used to initiate identifier pre-authorization flow.
+ // Empty string indicates the flow is unsupported by the CA.
AuthzURL string
// CertURL is a new certificate issuance endpoint URL.
+ // It is non-RFC 8555 compliant and is obsoleted by OrderURL.
CertURL string
// RevokeURL is used to initiate a certificate revocation flow.
RevokeURL string
+ // KeyChangeURL allows to perform account key rollover flow.
+ KeyChangeURL string
+
// Term is a URI identifying the current terms of service.
Terms string
@@ -162,44 +235,126 @@ type Directory struct {
// recognises as referring to itself for the purposes of CAA record validation
// as defined in RFC6844.
CAA []string
+
+ // ExternalAccountRequired indicates that the CA requires for all account-related
+ // requests to include external account binding information.
+ ExternalAccountRequired bool
}
-// Challenge encodes a returned CA challenge.
-// Its Error field may be non-nil if the challenge is part of an Authorization
-// with StatusInvalid.
-type Challenge struct {
- // Type is the challenge type, e.g. "http-01", "tls-sni-02", "dns-01".
- Type string
+// rfcCompliant reports whether the ACME server implements RFC 8555.
+// Note that some servers may have incomplete RFC implementation
+// even if the returned value is true.
+// If rfcCompliant reports false, the server most likely implements draft-02.
+func (d *Directory) rfcCompliant() bool {
+ return d.OrderURL != ""
+}
- // URI is where a challenge response can be posted to.
+// Order represents a client's request for a certificate.
+// It tracks the request flow progress through to issuance.
+type Order struct {
+ // URI uniquely identifies an order.
URI string
- // Token is a random value that uniquely identifies the challenge.
- Token string
-
- // Status identifies the status of this challenge.
+ // Status represents the current status of the order.
+ // It indicates which action the client should take.
+ //
+ // Possible values are StatusPending, StatusReady, StatusProcessing, StatusValid and StatusInvalid.
+ // Pending means the CA does not believe that the client has fulfilled the requirements.
+ // Ready indicates that the client has fulfilled all the requirements and can submit a CSR
+ // to obtain a certificate. This is done with Client's CreateOrderCert.
+ // Processing means the certificate is being issued.
+ // Valid indicates the CA has issued the certificate. It can be downloaded
+ // from the Order's CertURL. This is done with Client's FetchCert.
+ // Invalid means the certificate will not be issued. Users should consider this order
+ // abandoned.
Status string
- // Error indicates the reason for an authorization failure
- // when this challenge was used.
- // The type of a non-nil value is *Error.
- Error error
+ // Expires is the timestamp after which CA considers this order invalid.
+ Expires time.Time
+
+ // Identifiers contains all identifier objects which the order pertains to.
+ Identifiers []AuthzID
+
+ // NotBefore is the requested value of the notBefore field in the certificate.
+ NotBefore time.Time
+
+ // NotAfter is the requested value of the notAfter field in the certificate.
+ NotAfter time.Time
+
+ // AuthzURLs represents authorizations to complete before a certificate
+ // for identifiers specified in the order can be issued.
+ // It also contains unexpired authorizations that the client has completed
+ // in the past.
+ //
+ // Authorization objects can be fetched using Client's GetAuthorization method.
+ //
+ // The required authorizations are dictated by CA policies.
+ // There may not be a 1:1 relationship between the identifiers and required authorizations.
+ // Required authorizations can be identified by their StatusPending status.
+ //
+ // For orders in the StatusValid or StatusInvalid state these are the authorizations
+ // which were completed.
+ AuthzURLs []string
+
+ // FinalizeURL is the endpoint at which a CSR is submitted to obtain a certificate
+ // once all the authorizations are satisfied.
+ FinalizeURL string
+
+ // CertURL points to the certificate that has been issued in response to this order.
+ CertURL string
+
+ // The error that occurred while processing the order as received from a CA, if any.
+ Error *Error
}
+// OrderOption allows customizing Client.AuthorizeOrder call.
+type OrderOption interface {
+ privateOrderOpt()
+}
+
+// WithOrderNotBefore sets order's NotBefore field.
+func WithOrderNotBefore(t time.Time) OrderOption {
+ return orderNotBeforeOpt(t)
+}
+
+// WithOrderNotAfter sets order's NotAfter field.
+func WithOrderNotAfter(t time.Time) OrderOption {
+ return orderNotAfterOpt(t)
+}
+
+type orderNotBeforeOpt time.Time
+
+func (orderNotBeforeOpt) privateOrderOpt() {}
+
+type orderNotAfterOpt time.Time
+
+func (orderNotAfterOpt) privateOrderOpt() {}
+
// Authorization encodes an authorization response.
type Authorization struct {
// URI uniquely identifies a authorization.
URI string
- // Status identifies the status of an authorization.
+ // Status is the current status of an authorization.
+ // Possible values are StatusPending, StatusValid, StatusInvalid, StatusDeactivated,
+ // StatusExpired and StatusRevoked.
Status string
// Identifier is what the account is authorized to represent.
Identifier AuthzID
+ // The timestamp after which the CA considers the authorization invalid.
+ Expires time.Time
+
+ // Wildcard is true for authorizations of a wildcard domain name.
+ Wildcard bool
+
// Challenges that the client needs to fulfill in order to prove possession
// of the identifier (for pending authorizations).
- // For final authorizations, the challenges that were used.
+ // For valid authorizations, the challenge that was validated.
+ // For invalid authorizations, the challenge that was attempted and failed.
+ //
+ // RFC 8555 compatible CAs require users to fuflfill only one of the challenges.
Challenges []*Challenge
// A collection of sets of challenges, each of which would be sufficient
@@ -207,24 +362,51 @@ type Authorization struct {
// Clients must complete a set of challenges that covers at least one set.
// Challenges are identified by their indices in the challenges array.
// If this field is empty, the client needs to complete all challenges.
+ //
+ // This field is unused in RFC 8555.
Combinations [][]int
}
// AuthzID is an identifier that an account is authorized to represent.
type AuthzID struct {
- Type string // The type of identifier, e.g. "dns".
+ Type string // The type of identifier, "dns" or "ip".
Value string // The identifier itself, e.g. "example.org".
}
+// DomainIDs creates a slice of AuthzID with "dns" identifier type.
+func DomainIDs(names ...string) []AuthzID {
+ a := make([]AuthzID, len(names))
+ for i, v := range names {
+ a[i] = AuthzID{Type: "dns", Value: v}
+ }
+ return a
+}
+
+// IPIDs creates a slice of AuthzID with "ip" identifier type.
+// Each element of addr is textual form of an address as defined
+// in RFC1123 Section 2.1 for IPv4 and in RFC5952 Section 4 for IPv6.
+func IPIDs(addr ...string) []AuthzID {
+ a := make([]AuthzID, len(addr))
+ for i, v := range addr {
+ a[i] = AuthzID{Type: "ip", Value: v}
+ }
+ return a
+}
+
+// wireAuthzID is ACME JSON representation of authorization identifier objects.
+type wireAuthzID struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+}
+
// wireAuthz is ACME JSON representation of Authorization objects.
type wireAuthz struct {
+ Identifier wireAuthzID
Status string
+ Expires time.Time
+ Wildcard bool
Challenges []wireChallenge
Combinations [][]int
- Identifier struct {
- Type string
- Value string
- }
}
func (z *wireAuthz) authorization(uri string) *Authorization {
@@ -232,8 +414,10 @@ func (z *wireAuthz) authorization(uri string) *Authorization {
URI: uri,
Status: z.Status,
Identifier: AuthzID{Type: z.Identifier.Type, Value: z.Identifier.Value},
- Combinations: z.Combinations, // shallow copy
+ Expires: z.Expires,
+ Wildcard: z.Wildcard,
Challenges: make([]*Challenge, len(z.Challenges)),
+ Combinations: z.Combinations, // shallow copy
}
for i, v := range z.Challenges {
a.Challenges[i] = v.challenge()
@@ -254,22 +438,55 @@ func (z *wireAuthz) error(uri string) *AuthorizationError {
return err
}
+// Challenge encodes a returned CA challenge.
+// Its Error field may be non-nil if the challenge is part of an Authorization
+// with StatusInvalid.
+type Challenge struct {
+ // Type is the challenge type, e.g. "http-01", "tls-alpn-01", "dns-01".
+ Type string
+
+ // URI is where a challenge response can be posted to.
+ URI string
+
+ // Token is a random value that uniquely identifies the challenge.
+ Token string
+
+ // Status identifies the status of this challenge.
+ // In RFC 8555, possible values are StatusPending, StatusProcessing, StatusValid,
+ // and StatusInvalid.
+ Status string
+
+ // Validated is the time at which the CA validated this challenge.
+ // Always zero value in pre-RFC 8555.
+ Validated time.Time
+
+ // Error indicates the reason for an authorization failure
+ // when this challenge was used.
+ // The type of a non-nil value is *Error.
+ Error error
+}
+
// wireChallenge is ACME JSON challenge representation.
type wireChallenge struct {
- URI string `json:"uri"`
- Type string
- Token string
- Status string
- Error *wireError
+ URL string `json:"url"` // RFC
+ URI string `json:"uri"` // pre-RFC
+ Type string
+ Token string
+ Status string
+ Validated time.Time
+ Error *wireError
}
func (c *wireChallenge) challenge() *Challenge {
v := &Challenge{
- URI: c.URI,
+ URI: c.URL,
Type: c.Type,
Token: c.Token,
Status: c.Status,
}
+ if v.URI == "" {
+ v.URI = c.URI // c.URL was empty; use legacy
+ }
if v.Status == "" {
v.Status = StatusPending
}
@@ -282,9 +499,10 @@ func (c *wireChallenge) challenge() *Challenge {
// wireError is a subset of fields of the Problem Details object
// as described in https://tools.ietf.org/html/rfc7807#section-3.1.
type wireError struct {
- Status int
- Type string
- Detail string
+ Status int
+ Type string
+ Detail string
+ Instance string
}
func (e *wireError) error(h http.Header) *Error {
@@ -292,6 +510,7 @@ func (e *wireError) error(h http.Header) *Error {
StatusCode: e.Status,
ProblemType: e.Type,
Detail: e.Detail,
+ Instance: e.Instance,
Header: h,
}
}
diff --git a/vendor/golang.org/x/image/ccitt/gen.go b/vendor/golang.org/x/image/ccitt/gen.go
deleted file mode 100644
index 0245f6604b..0000000000
--- a/vendor/golang.org/x/image/ccitt/gen.go
+++ /dev/null
@@ -1,524 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import (
- "bytes"
- "flag"
- "fmt"
- "go/format"
- "io/ioutil"
- "log"
- "os"
-)
-
-var debug = flag.Bool("debug", false, "")
-
-func main() {
- flag.Parse()
-
- // Generate table.go.
- {
- w := &bytes.Buffer{}
- w.WriteString(header)
- w.WriteString(headerComment)
- write(w, build(modeCodes[:], 0), "modeDecodeTable",
- "// modeDecodeTable represents Table 1 and the End-of-Line code.\n")
- write(w, build(whiteCodes[:], 0), "whiteDecodeTable",
- "// whiteDecodeTable represents Tables 2 and 3 for a white run.\n")
- write(w, build(blackCodes[:], 0), "blackDecodeTable",
- "// blackDecodeTable represents Tables 2 and 3 for a black run.\n")
- writeMaxCodeLength(w, modeCodes[:], whiteCodes[:], blackCodes[:])
- finish(w, "table.go")
- }
-
- // Generate table_test.go.
- {
- w := &bytes.Buffer{}
- w.WriteString(header)
- finish(w, "table_test.go")
- }
-}
-
-const header = `// generated by "go run gen.go". DO NOT EDIT.
-
-package ccitt
-
-`
-
-const headerComment = `
-// Each decodeTable is represented by an array of [2]int16's: a binary tree.
-// Each array element (other than element 0, which means invalid) is a branch
-// node in that tree. The root node is always element 1 (the second element).
-//
-// To walk the tree, look at the next bit in the bit stream, using it to select
-// the first or second element of the [2]int16. If that int16 is 0, we have an
-// invalid code. If it is positive, go to that branch node. If it is negative,
-// then we have a leaf node, whose value is the bitwise complement (the ^
-// operator) of that int16.
-//
-// Comments above each decodeTable also show the same structure visually. The
-// "b123" lines show the 123'rd branch node. The "=XXXXX" lines show an invalid
-// code. The "=v1234" lines show a leaf node with value 1234. When reading the
-// bit stream, a 0 or 1 bit means to go up or down, as you move left to right.
-//
-// For example, in modeDecodeTable, branch node b005 is three steps up from the
-// root node, meaning that we have already seen "000". If the next bit is "0"
-// then we move to branch node b006. Otherwise, the next bit is "1", and we
-// move to the leaf node v0000 (also known as the modePass constant). Indeed,
-// the bits that encode modePass are "0001".
-//
-// Tables 1, 2 and 3 come from the "ITU-T Recommendation T.6: FACSIMILE CODING
-// SCHEMES AND CODING CONTROL FUNCTIONS FOR GROUP 4 FACSIMILE APPARATUS"
-// specification:
-//
-// https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-T.6-198811-I!!PDF-E&type=items
-
-
-`
-
-type node struct {
- children [2]*node
- val uint32
- branchIndex int32
-}
-
-func (n *node) isBranch() bool {
- return (n != nil) && ((n.children[0] != nil) || (n.children[1] != nil))
-}
-
-func (n *node) String() string {
- if n == nil {
- return "0"
- }
- if n.branchIndex > 0 {
- return fmt.Sprintf("%d", n.branchIndex)
- }
- return fmt.Sprintf("^%d", n.val)
-}
-
-func build(codes []code, prefixLen int) *node {
- if len(codes) == 0 {
- return nil
- }
-
- if prefixLen == len(codes[0].str) {
- if len(codes) != 1 {
- panic("ambiguous codes")
- }
- return &node{
- val: codes[0].val,
- }
- }
-
- childrenCodes := [2][]code{}
- for _, code := range codes {
- bit := code.str[prefixLen] & 1
- childrenCodes[bit] = append(childrenCodes[bit], code)
- }
- return &node{
- children: [2]*node{
- build(childrenCodes[0], prefixLen+1),
- build(childrenCodes[1], prefixLen+1),
- },
- }
-}
-
-func write(w *bytes.Buffer, root *node, varName string, comment string) {
- assignBranchIndexes(root)
-
- w.WriteString(comment)
- w.WriteString("//\n")
- writeComment(w, root, " ", false)
- fmt.Fprintf(w, "var %s = [...][2]int16{\n", varName)
- fmt.Fprintf(w, "0: {0, 0},\n")
-
- // Walk the tree in breadth-first order.
- for queue := []*node{root}; len(queue) > 0; {
- n := queue[0]
- queue = queue[1:]
-
- if n.isBranch() {
- fmt.Fprintf(w, "%d: {%v, %v},\n", n.branchIndex, n.children[0], n.children[1])
- queue = append(queue, n.children[0], n.children[1])
- }
- }
-
- fmt.Fprintf(w, "}\n\n")
-}
-
-func assignBranchIndexes(root *node) {
- // 0 is reserved for an invalid value.
- branchIndex := int32(1)
-
- // Walk the tree in breadth-first order.
- for queue := []*node{root}; len(queue) > 0; {
- n := queue[0]
- queue = queue[1:]
-
- if n.isBranch() {
- n.branchIndex = branchIndex
- branchIndex++
- queue = append(queue, n.children[0], n.children[1])
- }
- }
-}
-
-func writeComment(w *bytes.Buffer, n *node, prefix string, down bool) {
- if n.isBranch() {
- prefixUp := prefix[:len(prefix)-2] + " | "
- prefixDown := prefix + "| "
- if down {
- prefixUp, prefixDown = prefixDown, prefixUp
- }
-
- writeComment(w, n.children[0], prefixUp, false)
- defer writeComment(w, n.children[1], prefixDown, true)
-
- fmt.Fprintf(w, "// b%03d ", n.branchIndex)
- } else {
- fmt.Fprintf(w, "// ")
- }
-
- w.WriteString(prefix[:len(prefix)-2])
-
- if n == nil {
- fmt.Fprintf(w, "+=XXXXX\n")
- return
- }
- if !n.isBranch() {
- fmt.Fprintf(w, "+=v%04d\n", n.val)
- return
- }
- w.WriteString("+-+\n")
-}
-
-func writeMaxCodeLength(w *bytes.Buffer, codesList ...[]code) {
- maxCodeLength := 0
- for _, codes := range codesList {
- for _, code := range codes {
- if n := len(code.str); maxCodeLength < n {
- maxCodeLength = n
- }
- }
- }
- fmt.Fprintf(w, "const maxCodeLength = %d\n\n", maxCodeLength)
-}
-
-func finish(w *bytes.Buffer, filename string) {
- copyPaste(w, filename)
- if *debug {
- os.Stdout.Write(w.Bytes())
- return
- }
- out, err := format.Source(w.Bytes())
- if err != nil {
- log.Fatalf("format.Source: %v", err)
- }
- if err := ioutil.WriteFile(filename, out, 0660); err != nil {
- log.Fatalf("ioutil.WriteFile: %v", err)
- }
-}
-
-func copyPaste(w *bytes.Buffer, filename string) {
- b, err := ioutil.ReadFile("gen.go")
- if err != nil {
- log.Fatalf("ioutil.ReadFile: %v", err)
- }
- begin := []byte("\n// COPY PASTE " + filename + " BEGIN\n\n")
- end := []byte("\n// COPY PASTE " + filename + " END\n\n")
-
- for len(b) > 0 {
- i := bytes.Index(b, begin)
- if i < 0 {
- break
- }
- b = b[i:]
-
- j := bytes.Index(b, end)
- if j < 0 {
- break
- }
- j += len(end)
-
- w.Write(b[:j])
- b = b[j:]
- }
-}
-
-// COPY PASTE table.go BEGIN
-
-const (
- modePass = iota // Pass
- modeH // Horizontal
- modeV0 // Vertical-0
- modeVR1 // Vertical-Right-1
- modeVR2 // Vertical-Right-2
- modeVR3 // Vertical-Right-3
- modeVL1 // Vertical-Left-1
- modeVL2 // Vertical-Left-2
- modeVL3 // Vertical-Left-3
- modeExt // Extension
- modeEOL // End-of-Line
-)
-
-// COPY PASTE table.go END
-
-// The data that is the rest of this file is taken from Tables 1, 2 and 3 from
-// the "ITU-T Recommendation T.6" spec.
-
-// COPY PASTE table_test.go BEGIN
-
-type code struct {
- val uint32
- str string
-}
-
-var modeCodes = []code{
- {modePass, "0001"},
- {modeH, "001"},
- {modeV0, "1"},
- {modeVR1, "011"},
- {modeVR2, "000011"},
- {modeVR3, "0000011"},
- {modeVL1, "010"},
- {modeVL2, "000010"},
- {modeVL3, "0000010"},
- {modeExt, "0000001"},
-
- // End-of-Line is not in Table 1, but we look for it at the same time that
- // we look for other mode codes.
- {modeEOL, "000000000001"},
-}
-
-var whiteCodes = []code{
- // Terminating codes (0-63).
- {0x0000, "00110101"},
- {0x0001, "000111"},
- {0x0002, "0111"},
- {0x0003, "1000"},
- {0x0004, "1011"},
- {0x0005, "1100"},
- {0x0006, "1110"},
- {0x0007, "1111"},
- {0x0008, "10011"},
- {0x0009, "10100"},
- {0x000A, "00111"},
- {0x000B, "01000"},
- {0x000C, "001000"},
- {0x000D, "000011"},
- {0x000E, "110100"},
- {0x000F, "110101"},
- {0x0010, "101010"},
- {0x0011, "101011"},
- {0x0012, "0100111"},
- {0x0013, "0001100"},
- {0x0014, "0001000"},
- {0x0015, "0010111"},
- {0x0016, "0000011"},
- {0x0017, "0000100"},
- {0x0018, "0101000"},
- {0x0019, "0101011"},
- {0x001A, "0010011"},
- {0x001B, "0100100"},
- {0x001C, "0011000"},
- {0x001D, "00000010"},
- {0x001E, "00000011"},
- {0x001F, "00011010"},
- {0x0020, "00011011"},
- {0x0021, "00010010"},
- {0x0022, "00010011"},
- {0x0023, "00010100"},
- {0x0024, "00010101"},
- {0x0025, "00010110"},
- {0x0026, "00010111"},
- {0x0027, "00101000"},
- {0x0028, "00101001"},
- {0x0029, "00101010"},
- {0x002A, "00101011"},
- {0x002B, "00101100"},
- {0x002C, "00101101"},
- {0x002D, "00000100"},
- {0x002E, "00000101"},
- {0x002F, "00001010"},
- {0x0030, "00001011"},
- {0x0031, "01010010"},
- {0x0032, "01010011"},
- {0x0033, "01010100"},
- {0x0034, "01010101"},
- {0x0035, "00100100"},
- {0x0036, "00100101"},
- {0x0037, "01011000"},
- {0x0038, "01011001"},
- {0x0039, "01011010"},
- {0x003A, "01011011"},
- {0x003B, "01001010"},
- {0x003C, "01001011"},
- {0x003D, "00110010"},
- {0x003E, "00110011"},
- {0x003F, "00110100"},
-
- // Make-up codes between 64 and 1728.
- {0x0040, "11011"},
- {0x0080, "10010"},
- {0x00C0, "010111"},
- {0x0100, "0110111"},
- {0x0140, "00110110"},
- {0x0180, "00110111"},
- {0x01C0, "01100100"},
- {0x0200, "01100101"},
- {0x0240, "01101000"},
- {0x0280, "01100111"},
- {0x02C0, "011001100"},
- {0x0300, "011001101"},
- {0x0340, "011010010"},
- {0x0380, "011010011"},
- {0x03C0, "011010100"},
- {0x0400, "011010101"},
- {0x0440, "011010110"},
- {0x0480, "011010111"},
- {0x04C0, "011011000"},
- {0x0500, "011011001"},
- {0x0540, "011011010"},
- {0x0580, "011011011"},
- {0x05C0, "010011000"},
- {0x0600, "010011001"},
- {0x0640, "010011010"},
- {0x0680, "011000"},
- {0x06C0, "010011011"},
-
- // Make-up codes between 1792 and 2560.
- {0x0700, "00000001000"},
- {0x0740, "00000001100"},
- {0x0780, "00000001101"},
- {0x07C0, "000000010010"},
- {0x0800, "000000010011"},
- {0x0840, "000000010100"},
- {0x0880, "000000010101"},
- {0x08C0, "000000010110"},
- {0x0900, "000000010111"},
- {0x0940, "000000011100"},
- {0x0980, "000000011101"},
- {0x09C0, "000000011110"},
- {0x0A00, "000000011111"},
-}
-
-var blackCodes = []code{
- // Terminating codes (0-63).
- {0x0000, "0000110111"},
- {0x0001, "010"},
- {0x0002, "11"},
- {0x0003, "10"},
- {0x0004, "011"},
- {0x0005, "0011"},
- {0x0006, "0010"},
- {0x0007, "00011"},
- {0x0008, "000101"},
- {0x0009, "000100"},
- {0x000A, "0000100"},
- {0x000B, "0000101"},
- {0x000C, "0000111"},
- {0x000D, "00000100"},
- {0x000E, "00000111"},
- {0x000F, "000011000"},
- {0x0010, "0000010111"},
- {0x0011, "0000011000"},
- {0x0012, "0000001000"},
- {0x0013, "00001100111"},
- {0x0014, "00001101000"},
- {0x0015, "00001101100"},
- {0x0016, "00000110111"},
- {0x0017, "00000101000"},
- {0x0018, "00000010111"},
- {0x0019, "00000011000"},
- {0x001A, "000011001010"},
- {0x001B, "000011001011"},
- {0x001C, "000011001100"},
- {0x001D, "000011001101"},
- {0x001E, "000001101000"},
- {0x001F, "000001101001"},
- {0x0020, "000001101010"},
- {0x0021, "000001101011"},
- {0x0022, "000011010010"},
- {0x0023, "000011010011"},
- {0x0024, "000011010100"},
- {0x0025, "000011010101"},
- {0x0026, "000011010110"},
- {0x0027, "000011010111"},
- {0x0028, "000001101100"},
- {0x0029, "000001101101"},
- {0x002A, "000011011010"},
- {0x002B, "000011011011"},
- {0x002C, "000001010100"},
- {0x002D, "000001010101"},
- {0x002E, "000001010110"},
- {0x002F, "000001010111"},
- {0x0030, "000001100100"},
- {0x0031, "000001100101"},
- {0x0032, "000001010010"},
- {0x0033, "000001010011"},
- {0x0034, "000000100100"},
- {0x0035, "000000110111"},
- {0x0036, "000000111000"},
- {0x0037, "000000100111"},
- {0x0038, "000000101000"},
- {0x0039, "000001011000"},
- {0x003A, "000001011001"},
- {0x003B, "000000101011"},
- {0x003C, "000000101100"},
- {0x003D, "000001011010"},
- {0x003E, "000001100110"},
- {0x003F, "000001100111"},
-
- // Make-up codes between 64 and 1728.
- {0x0040, "0000001111"},
- {0x0080, "000011001000"},
- {0x00C0, "000011001001"},
- {0x0100, "000001011011"},
- {0x0140, "000000110011"},
- {0x0180, "000000110100"},
- {0x01C0, "000000110101"},
- {0x0200, "0000001101100"},
- {0x0240, "0000001101101"},
- {0x0280, "0000001001010"},
- {0x02C0, "0000001001011"},
- {0x0300, "0000001001100"},
- {0x0340, "0000001001101"},
- {0x0380, "0000001110010"},
- {0x03C0, "0000001110011"},
- {0x0400, "0000001110100"},
- {0x0440, "0000001110101"},
- {0x0480, "0000001110110"},
- {0x04C0, "0000001110111"},
- {0x0500, "0000001010010"},
- {0x0540, "0000001010011"},
- {0x0580, "0000001010100"},
- {0x05C0, "0000001010101"},
- {0x0600, "0000001011010"},
- {0x0640, "0000001011011"},
- {0x0680, "0000001100100"},
- {0x06C0, "0000001100101"},
-
- // Make-up codes between 1792 and 2560.
- {0x0700, "00000001000"},
- {0x0740, "00000001100"},
- {0x0780, "00000001101"},
- {0x07C0, "000000010010"},
- {0x0800, "000000010011"},
- {0x0840, "000000010100"},
- {0x0880, "000000010101"},
- {0x08C0, "000000010110"},
- {0x0900, "000000010111"},
- {0x0940, "000000011100"},
- {0x0980, "000000011101"},
- {0x09C0, "000000011110"},
- {0x0A00, "000000011111"},
-}
-
-// COPY PASTE table_test.go END
-
-// This final comment makes the "END" above be followed by "\n\n".
diff --git a/vendor/golang.org/x/image/ccitt/reader.go b/vendor/golang.org/x/image/ccitt/reader.go
index 04d0302398..66a928cd8b 100644
--- a/vendor/golang.org/x/image/ccitt/reader.go
+++ b/vendor/golang.org/x/image/ccitt/reader.go
@@ -67,6 +67,62 @@ func invertBytes(b []byte) {
}
}
+func reverseBitsWithinBytes(b []byte) {
+ for i, c := range b {
+ b[i] = bits.Reverse8(c)
+ }
+}
+
+// highBits writes to dst (1 bit per pixel, most significant bit first) the
+// high (0x80) bits from src (1 byte per pixel). It returns the number of bytes
+// written and read such that dst[:d] is the packed form of src[:s].
+//
+// For example, if src starts with the 8 bytes [0x7D, 0x7E, 0x7F, 0x80, 0x81,
+// 0x82, 0x00, 0xFF] then 0x1D will be written to dst[0].
+//
+// If src has (8 * len(dst)) or more bytes then only len(dst) bytes are
+// written, (8 * len(dst)) bytes are read, and invert is ignored.
+//
+// Otherwise, if len(src) is not a multiple of 8 then the final byte written to
+// dst is padded with 1 bits (if invert is true) or 0 bits. If inverted, the 1s
+// are typically temporary, e.g. they will be flipped back to 0s by an
+// invertBytes call in the highBits caller, reader.Read.
+func highBits(dst []byte, src []byte, invert bool) (d int, s int) {
+ // Pack as many complete groups of 8 src bytes as we can.
+ n := len(src) / 8
+ if n > len(dst) {
+ n = len(dst)
+ }
+ dstN := dst[:n]
+ for i := range dstN {
+ src8 := src[i*8 : i*8+8]
+ dstN[i] = ((src8[0] & 0x80) >> 0) |
+ ((src8[1] & 0x80) >> 1) |
+ ((src8[2] & 0x80) >> 2) |
+ ((src8[3] & 0x80) >> 3) |
+ ((src8[4] & 0x80) >> 4) |
+ ((src8[5] & 0x80) >> 5) |
+ ((src8[6] & 0x80) >> 6) |
+ ((src8[7] & 0x80) >> 7)
+ }
+ d, s = n, 8*n
+ dst, src = dst[d:], src[s:]
+
+ // Pack up to 7 remaining src bytes, if there's room in dst.
+ if (len(dst) > 0) && (len(src) > 0) {
+ dstByte := byte(0)
+ if invert {
+ dstByte = 0xFF >> uint(len(src))
+ }
+ for n, srcByte := range src {
+ dstByte |= (srcByte & 0x80) >> uint(n)
+ }
+ dst[0] = dstByte
+ d, s = d+1, s+len(src)
+ }
+ return d, s
+}
+
type bitReader struct {
r io.Reader
@@ -78,7 +134,7 @@ type bitReader struct {
// order is whether to process r's bytes LSB first or MSB first.
order Order
- // The low nBits bits of the bits field hold upcoming bits in LSB order.
+ // The high nBits bits of the bits field hold upcoming bits in MSB order.
bits uint64
nBits uint32
@@ -90,7 +146,7 @@ type bitReader struct {
func (b *bitReader) alignToByteBoundary() {
n := b.nBits & 7
- b.bits >>= n
+ b.bits <<= n
b.nBits -= n
}
@@ -105,10 +161,10 @@ const nextBitMaxNBits = 31
func (b *bitReader) nextBit() (uint32, error) {
for {
if b.nBits > 0 {
- bit := uint32(b.bits) & 1
- b.bits >>= 1
+ bit := (b.bits >> 63) & 1
+ b.bits <<= 1
b.nBits--
- return bit, nil
+ return uint32(bit), nil
}
if available := b.bw - b.br; available >= 4 {
@@ -118,12 +174,12 @@ func (b *bitReader) nextBit() (uint32, error) {
// checks that the generated maxCodeLength constant fits.
//
// If changing the Uint32 call, also change nextBitMaxNBits.
- b.bits = uint64(binary.LittleEndian.Uint32(b.bytes[b.br:]))
+ b.bits = uint64(binary.BigEndian.Uint32(b.bytes[b.br:])) << 32
b.br += 4
b.nBits = 32
continue
} else if available > 0 {
- b.bits = uint64(b.bytes[b.br])
+ b.bits = uint64(b.bytes[b.br]) << (7 * 8)
b.br++
b.nBits = 8
continue
@@ -138,23 +194,20 @@ func (b *bitReader) nextBit() (uint32, error) {
b.bw = uint32(n)
b.readErr = err
- if b.order != LSB {
- written := b.bytes[:b.bw]
- for i, x := range written {
- written[i] = bits.Reverse8(x)
- }
+ if b.order != MSB {
+ reverseBitsWithinBytes(b.bytes[:b.bw])
}
}
}
func decode(b *bitReader, decodeTable [][2]int16) (uint32, error) {
- nBitsRead, bitsRead, state := uint32(0), uint32(0), int32(1)
+ nBitsRead, bitsRead, state := uint32(0), uint64(0), int32(1)
for {
bit, err := b.nextBit()
if err != nil {
return 0, err
}
- bitsRead |= bit << nBitsRead
+ bitsRead |= uint64(bit) << (63 - nBitsRead)
nBitsRead++
// The "&1" is redundant, but can eliminate a bounds check.
state = int32(decodeTable[state][bit&1])
@@ -162,7 +215,7 @@ func decode(b *bitReader, decodeTable [][2]int16) (uint32, error) {
return uint32(^state), nil
} else if state == 0 {
// Unread the bits we've read, then return errInvalidCode.
- b.bits = (b.bits << nBitsRead) | uint64(bitsRead)
+ b.bits = (b.bits >> nBitsRead) | bitsRead
b.nBits += nBitsRead
return 0, errInvalidCode
}
@@ -254,25 +307,10 @@ func (z *reader) Read(p []byte) (int, error) {
z.rowsRemaining--
}
- // Pack from z.curr (1 byte per pixel) to p (1 bit per pixel), up to 8
- // elements per iteration.
- i := 0
- for ; i < len(p); i++ {
- numToPack := len(z.curr) - z.ri
- if numToPack <= 0 {
- break
- } else if numToPack > 8 {
- numToPack = 8
- }
-
- byteValue := byte(0)
- for j := 0; j < numToPack; j++ {
- byteValue |= (z.curr[z.ri] & 0x80) >> uint(j)
- z.ri++
- }
- p[i] = byteValue
- }
- p = p[i:]
+ // Pack from z.curr (1 byte per pixel) to p (1 bit per pixel).
+ packD, packS := highBits(p, z.curr[z.ri:], z.invert)
+ p = p[packD:]
+ z.ri += packS
// Prepare to decode the next row, if necessary.
if z.ri == len(z.curr) {
@@ -282,7 +320,6 @@ func (z *reader) Read(p []byte) (int, error) {
}
n := len(originalP) - len(p)
- // TODO: when invert is true, should the end-of-row padding bits be 0 or 1?
if z.invert {
invertBytes(originalP[:n])
}
@@ -366,6 +403,10 @@ func (z *reader) decodeRow() error {
z.atStartOfRow = true
z.penColorIsWhite = true
+ if z.align {
+ z.br.alignToByteBoundary()
+ }
+
switch z.subFormat {
case Group3:
for ; z.wi < len(z.curr); z.atStartOfRow = false {
@@ -376,10 +417,6 @@ func (z *reader) decodeRow() error {
return z.decodeEOL()
case Group4:
- if z.align {
- z.br.alignToByteBoundary()
- }
-
for ; z.wi < len(z.curr); z.atStartOfRow = false {
mode, err := decode(&z.br, modeDecodeTable[:])
if err != nil {
diff --git a/vendor/golang.org/x/image/ccitt/table.go b/vendor/golang.org/x/image/ccitt/table.go
index 29d0ea49a4..f01cc12b59 100644
--- a/vendor/golang.org/x/image/ccitt/table.go
+++ b/vendor/golang.org/x/image/ccitt/table.go
@@ -721,6 +721,255 @@ var blackDecodeTable = [...][2]int16{
const maxCodeLength = 13
+// Each encodeTable is represented by an array of bitStrings.
+
+// bitString is a pair of uint32 values representing a bit code.
+// The nBits low bits of bits make up the actual bit code.
+// Eg. bitString{0x0004, 8} represents the bitcode "00000100".
+type bitString struct {
+ bits uint32
+ nBits uint32
+}
+
+// modeEncodeTable represents Table 1 and the End-of-Line code.
+var modeEncodeTable = [...]bitString{
+ 0: {0x0001, 4}, // "0001"
+ 1: {0x0001, 3}, // "001"
+ 2: {0x0001, 1}, // "1"
+ 3: {0x0003, 3}, // "011"
+ 4: {0x0003, 6}, // "000011"
+ 5: {0x0003, 7}, // "0000011"
+ 6: {0x0002, 3}, // "010"
+ 7: {0x0002, 6}, // "000010"
+ 8: {0x0002, 7}, // "0000010"
+ 9: {0x0001, 7}, // "0000001"
+ 10: {0x0001, 12}, // "000000000001"
+}
+
+// whiteEncodeTable2 represents Table 2 for a white run.
+var whiteEncodeTable2 = [...]bitString{
+ 0: {0x0035, 8}, // "00110101"
+ 1: {0x0007, 6}, // "000111"
+ 2: {0x0007, 4}, // "0111"
+ 3: {0x0008, 4}, // "1000"
+ 4: {0x000b, 4}, // "1011"
+ 5: {0x000c, 4}, // "1100"
+ 6: {0x000e, 4}, // "1110"
+ 7: {0x000f, 4}, // "1111"
+ 8: {0x0013, 5}, // "10011"
+ 9: {0x0014, 5}, // "10100"
+ 10: {0x0007, 5}, // "00111"
+ 11: {0x0008, 5}, // "01000"
+ 12: {0x0008, 6}, // "001000"
+ 13: {0x0003, 6}, // "000011"
+ 14: {0x0034, 6}, // "110100"
+ 15: {0x0035, 6}, // "110101"
+ 16: {0x002a, 6}, // "101010"
+ 17: {0x002b, 6}, // "101011"
+ 18: {0x0027, 7}, // "0100111"
+ 19: {0x000c, 7}, // "0001100"
+ 20: {0x0008, 7}, // "0001000"
+ 21: {0x0017, 7}, // "0010111"
+ 22: {0x0003, 7}, // "0000011"
+ 23: {0x0004, 7}, // "0000100"
+ 24: {0x0028, 7}, // "0101000"
+ 25: {0x002b, 7}, // "0101011"
+ 26: {0x0013, 7}, // "0010011"
+ 27: {0x0024, 7}, // "0100100"
+ 28: {0x0018, 7}, // "0011000"
+ 29: {0x0002, 8}, // "00000010"
+ 30: {0x0003, 8}, // "00000011"
+ 31: {0x001a, 8}, // "00011010"
+ 32: {0x001b, 8}, // "00011011"
+ 33: {0x0012, 8}, // "00010010"
+ 34: {0x0013, 8}, // "00010011"
+ 35: {0x0014, 8}, // "00010100"
+ 36: {0x0015, 8}, // "00010101"
+ 37: {0x0016, 8}, // "00010110"
+ 38: {0x0017, 8}, // "00010111"
+ 39: {0x0028, 8}, // "00101000"
+ 40: {0x0029, 8}, // "00101001"
+ 41: {0x002a, 8}, // "00101010"
+ 42: {0x002b, 8}, // "00101011"
+ 43: {0x002c, 8}, // "00101100"
+ 44: {0x002d, 8}, // "00101101"
+ 45: {0x0004, 8}, // "00000100"
+ 46: {0x0005, 8}, // "00000101"
+ 47: {0x000a, 8}, // "00001010"
+ 48: {0x000b, 8}, // "00001011"
+ 49: {0x0052, 8}, // "01010010"
+ 50: {0x0053, 8}, // "01010011"
+ 51: {0x0054, 8}, // "01010100"
+ 52: {0x0055, 8}, // "01010101"
+ 53: {0x0024, 8}, // "00100100"
+ 54: {0x0025, 8}, // "00100101"
+ 55: {0x0058, 8}, // "01011000"
+ 56: {0x0059, 8}, // "01011001"
+ 57: {0x005a, 8}, // "01011010"
+ 58: {0x005b, 8}, // "01011011"
+ 59: {0x004a, 8}, // "01001010"
+ 60: {0x004b, 8}, // "01001011"
+ 61: {0x0032, 8}, // "00110010"
+ 62: {0x0033, 8}, // "00110011"
+ 63: {0x0034, 8}, // "00110100"
+}
+
+// whiteEncodeTable3 represents Table 3 for a white run.
+var whiteEncodeTable3 = [...]bitString{
+ 0: {0x001b, 5}, // "11011"
+ 1: {0x0012, 5}, // "10010"
+ 2: {0x0017, 6}, // "010111"
+ 3: {0x0037, 7}, // "0110111"
+ 4: {0x0036, 8}, // "00110110"
+ 5: {0x0037, 8}, // "00110111"
+ 6: {0x0064, 8}, // "01100100"
+ 7: {0x0065, 8}, // "01100101"
+ 8: {0x0068, 8}, // "01101000"
+ 9: {0x0067, 8}, // "01100111"
+ 10: {0x00cc, 9}, // "011001100"
+ 11: {0x00cd, 9}, // "011001101"
+ 12: {0x00d2, 9}, // "011010010"
+ 13: {0x00d3, 9}, // "011010011"
+ 14: {0x00d4, 9}, // "011010100"
+ 15: {0x00d5, 9}, // "011010101"
+ 16: {0x00d6, 9}, // "011010110"
+ 17: {0x00d7, 9}, // "011010111"
+ 18: {0x00d8, 9}, // "011011000"
+ 19: {0x00d9, 9}, // "011011001"
+ 20: {0x00da, 9}, // "011011010"
+ 21: {0x00db, 9}, // "011011011"
+ 22: {0x0098, 9}, // "010011000"
+ 23: {0x0099, 9}, // "010011001"
+ 24: {0x009a, 9}, // "010011010"
+ 25: {0x0018, 6}, // "011000"
+ 26: {0x009b, 9}, // "010011011"
+ 27: {0x0008, 11}, // "00000001000"
+ 28: {0x000c, 11}, // "00000001100"
+ 29: {0x000d, 11}, // "00000001101"
+ 30: {0x0012, 12}, // "000000010010"
+ 31: {0x0013, 12}, // "000000010011"
+ 32: {0x0014, 12}, // "000000010100"
+ 33: {0x0015, 12}, // "000000010101"
+ 34: {0x0016, 12}, // "000000010110"
+ 35: {0x0017, 12}, // "000000010111"
+ 36: {0x001c, 12}, // "000000011100"
+ 37: {0x001d, 12}, // "000000011101"
+ 38: {0x001e, 12}, // "000000011110"
+ 39: {0x001f, 12}, // "000000011111"
+}
+
+// blackEncodeTable2 represents Table 2 for a black run.
+var blackEncodeTable2 = [...]bitString{
+ 0: {0x0037, 10}, // "0000110111"
+ 1: {0x0002, 3}, // "010"
+ 2: {0x0003, 2}, // "11"
+ 3: {0x0002, 2}, // "10"
+ 4: {0x0003, 3}, // "011"
+ 5: {0x0003, 4}, // "0011"
+ 6: {0x0002, 4}, // "0010"
+ 7: {0x0003, 5}, // "00011"
+ 8: {0x0005, 6}, // "000101"
+ 9: {0x0004, 6}, // "000100"
+ 10: {0x0004, 7}, // "0000100"
+ 11: {0x0005, 7}, // "0000101"
+ 12: {0x0007, 7}, // "0000111"
+ 13: {0x0004, 8}, // "00000100"
+ 14: {0x0007, 8}, // "00000111"
+ 15: {0x0018, 9}, // "000011000"
+ 16: {0x0017, 10}, // "0000010111"
+ 17: {0x0018, 10}, // "0000011000"
+ 18: {0x0008, 10}, // "0000001000"
+ 19: {0x0067, 11}, // "00001100111"
+ 20: {0x0068, 11}, // "00001101000"
+ 21: {0x006c, 11}, // "00001101100"
+ 22: {0x0037, 11}, // "00000110111"
+ 23: {0x0028, 11}, // "00000101000"
+ 24: {0x0017, 11}, // "00000010111"
+ 25: {0x0018, 11}, // "00000011000"
+ 26: {0x00ca, 12}, // "000011001010"
+ 27: {0x00cb, 12}, // "000011001011"
+ 28: {0x00cc, 12}, // "000011001100"
+ 29: {0x00cd, 12}, // "000011001101"
+ 30: {0x0068, 12}, // "000001101000"
+ 31: {0x0069, 12}, // "000001101001"
+ 32: {0x006a, 12}, // "000001101010"
+ 33: {0x006b, 12}, // "000001101011"
+ 34: {0x00d2, 12}, // "000011010010"
+ 35: {0x00d3, 12}, // "000011010011"
+ 36: {0x00d4, 12}, // "000011010100"
+ 37: {0x00d5, 12}, // "000011010101"
+ 38: {0x00d6, 12}, // "000011010110"
+ 39: {0x00d7, 12}, // "000011010111"
+ 40: {0x006c, 12}, // "000001101100"
+ 41: {0x006d, 12}, // "000001101101"
+ 42: {0x00da, 12}, // "000011011010"
+ 43: {0x00db, 12}, // "000011011011"
+ 44: {0x0054, 12}, // "000001010100"
+ 45: {0x0055, 12}, // "000001010101"
+ 46: {0x0056, 12}, // "000001010110"
+ 47: {0x0057, 12}, // "000001010111"
+ 48: {0x0064, 12}, // "000001100100"
+ 49: {0x0065, 12}, // "000001100101"
+ 50: {0x0052, 12}, // "000001010010"
+ 51: {0x0053, 12}, // "000001010011"
+ 52: {0x0024, 12}, // "000000100100"
+ 53: {0x0037, 12}, // "000000110111"
+ 54: {0x0038, 12}, // "000000111000"
+ 55: {0x0027, 12}, // "000000100111"
+ 56: {0x0028, 12}, // "000000101000"
+ 57: {0x0058, 12}, // "000001011000"
+ 58: {0x0059, 12}, // "000001011001"
+ 59: {0x002b, 12}, // "000000101011"
+ 60: {0x002c, 12}, // "000000101100"
+ 61: {0x005a, 12}, // "000001011010"
+ 62: {0x0066, 12}, // "000001100110"
+ 63: {0x0067, 12}, // "000001100111"
+}
+
+// blackEncodeTable3 represents Table 3 for a black run.
+var blackEncodeTable3 = [...]bitString{
+ 0: {0x000f, 10}, // "0000001111"
+ 1: {0x00c8, 12}, // "000011001000"
+ 2: {0x00c9, 12}, // "000011001001"
+ 3: {0x005b, 12}, // "000001011011"
+ 4: {0x0033, 12}, // "000000110011"
+ 5: {0x0034, 12}, // "000000110100"
+ 6: {0x0035, 12}, // "000000110101"
+ 7: {0x006c, 13}, // "0000001101100"
+ 8: {0x006d, 13}, // "0000001101101"
+ 9: {0x004a, 13}, // "0000001001010"
+ 10: {0x004b, 13}, // "0000001001011"
+ 11: {0x004c, 13}, // "0000001001100"
+ 12: {0x004d, 13}, // "0000001001101"
+ 13: {0x0072, 13}, // "0000001110010"
+ 14: {0x0073, 13}, // "0000001110011"
+ 15: {0x0074, 13}, // "0000001110100"
+ 16: {0x0075, 13}, // "0000001110101"
+ 17: {0x0076, 13}, // "0000001110110"
+ 18: {0x0077, 13}, // "0000001110111"
+ 19: {0x0052, 13}, // "0000001010010"
+ 20: {0x0053, 13}, // "0000001010011"
+ 21: {0x0054, 13}, // "0000001010100"
+ 22: {0x0055, 13}, // "0000001010101"
+ 23: {0x005a, 13}, // "0000001011010"
+ 24: {0x005b, 13}, // "0000001011011"
+ 25: {0x0064, 13}, // "0000001100100"
+ 26: {0x0065, 13}, // "0000001100101"
+ 27: {0x0008, 11}, // "00000001000"
+ 28: {0x000c, 11}, // "00000001100"
+ 29: {0x000d, 11}, // "00000001101"
+ 30: {0x0012, 12}, // "000000010010"
+ 31: {0x0013, 12}, // "000000010011"
+ 32: {0x0014, 12}, // "000000010100"
+ 33: {0x0015, 12}, // "000000010101"
+ 34: {0x0016, 12}, // "000000010110"
+ 35: {0x0017, 12}, // "000000010111"
+ 36: {0x001c, 12}, // "000000011100"
+ 37: {0x001d, 12}, // "000000011101"
+ 38: {0x001e, 12}, // "000000011110"
+ 39: {0x001f, 12}, // "000000011111"
+}
+
// COPY PASTE table.go BEGIN
const (
diff --git a/vendor/golang.org/x/image/ccitt/writer.go b/vendor/golang.org/x/image/ccitt/writer.go
new file mode 100644
index 0000000000..87130ab04d
--- /dev/null
+++ b/vendor/golang.org/x/image/ccitt/writer.go
@@ -0,0 +1,102 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ccitt
+
+import (
+ "encoding/binary"
+ "io"
+)
+
+type bitWriter struct {
+ w io.Writer
+
+ // order is whether to process w's bytes LSB first or MSB first.
+ order Order
+
+ // The high nBits bits of the bits field hold encoded bits to be written to w.
+ bits uint64
+ nBits uint32
+
+ // bytes[:bw] holds encoded bytes not yet written to w.
+ // Overflow protection is ensured by using a multiple of 8 as bytes length.
+ bw uint32
+ bytes [1024]uint8
+}
+
+// flushBits copies 64 bits from b.bits to b.bytes. If b.bytes is then full, it
+// is written to b.w.
+func (b *bitWriter) flushBits() error {
+ binary.BigEndian.PutUint64(b.bytes[b.bw:], b.bits)
+ b.bits = 0
+ b.nBits = 0
+ b.bw += 8
+ if b.bw < uint32(len(b.bytes)) {
+ return nil
+ }
+ b.bw = 0
+ if b.order != MSB {
+ reverseBitsWithinBytes(b.bytes[:])
+ }
+ _, err := b.w.Write(b.bytes[:])
+ return err
+}
+
+// close finalizes a bitcode stream by writing any
+// pending bits to bitWriter's underlying io.Writer.
+func (b *bitWriter) close() error {
+ // Write any encoded bits to bytes.
+ if b.nBits > 0 {
+ binary.BigEndian.PutUint64(b.bytes[b.bw:], b.bits)
+ b.bw += (b.nBits + 7) >> 3
+ }
+
+ if b.order != MSB {
+ reverseBitsWithinBytes(b.bytes[:b.bw])
+ }
+
+ // Write b.bw bytes to b.w.
+ _, err := b.w.Write(b.bytes[:b.bw])
+ return err
+}
+
+// alignToByteBoundary rounds b.nBits up to a multiple of 8.
+// If all 64 bits are used, flush them to bitWriter's bytes.
+func (b *bitWriter) alignToByteBoundary() error {
+ if b.nBits = (b.nBits + 7) &^ 7; b.nBits == 64 {
+ return b.flushBits()
+ }
+ return nil
+}
+
+// writeCode writes a variable length bitcode to b's underlying io.Writer.
+func (b *bitWriter) writeCode(bs bitString) error {
+ bits := bs.bits
+ nBits := bs.nBits
+ if 64-b.nBits >= nBits {
+ // b.bits has sufficient room for storing nBits bits.
+ b.bits |= uint64(bits) << (64 - nBits - b.nBits)
+ b.nBits += nBits
+ if b.nBits == 64 {
+ return b.flushBits()
+ }
+ return nil
+ }
+
+ // Number of leading bits that fill b.bits.
+ i := 64 - b.nBits
+
+ // Fill b.bits then flush and write remaining bits.
+ b.bits |= uint64(bits) >> (nBits - i)
+ b.nBits = 64
+
+ if err := b.flushBits(); err != nil {
+ return err
+ }
+
+ nBits -= i
+ b.bits = uint64(bits) << (64 - nBits)
+ b.nBits = nBits
+ return nil
+}
diff --git a/vendor/golang.org/x/image/draw/gen.go b/vendor/golang.org/x/image/draw/gen.go
deleted file mode 100644
index 822bb6a502..0000000000
--- a/vendor/golang.org/x/image/draw/gen.go
+++ /dev/null
@@ -1,1404 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import (
- "bytes"
- "flag"
- "fmt"
- "go/format"
- "io/ioutil"
- "log"
- "os"
- "strings"
-)
-
-var debug = flag.Bool("debug", false, "")
-
-func main() {
- flag.Parse()
-
- w := new(bytes.Buffer)
- w.WriteString("// generated by \"go run gen.go\". DO NOT EDIT.\n\n" +
- "package draw\n\nimport (\n" +
- "\"image\"\n" +
- "\"image/color\"\n" +
- "\"math\"\n" +
- "\n" +
- "\"golang.org/x/image/math/f64\"\n" +
- ")\n")
-
- gen(w, "nnInterpolator", codeNNScaleLeaf, codeNNTransformLeaf)
- gen(w, "ablInterpolator", codeABLScaleLeaf, codeABLTransformLeaf)
- genKernel(w)
-
- if *debug {
- os.Stdout.Write(w.Bytes())
- return
- }
- out, err := format.Source(w.Bytes())
- if err != nil {
- log.Fatal(err)
- }
- if err := ioutil.WriteFile("impl.go", out, 0660); err != nil {
- log.Fatal(err)
- }
-}
-
-var (
- // dsTypes are the (dst image type, src image type) pairs to generate
- // scale_DType_SType implementations for. The last element in the slice
- // should be the fallback pair ("Image", "image.Image").
- //
- // TODO: add *image.CMYK src type after Go 1.5 is released.
- // An *image.CMYK is also alwaysOpaque.
- dsTypes = []struct{ dType, sType string }{
- {"*image.RGBA", "*image.Gray"},
- {"*image.RGBA", "*image.NRGBA"},
- {"*image.RGBA", "*image.RGBA"},
- {"*image.RGBA", "*image.YCbCr"},
- {"*image.RGBA", "image.Image"},
- {"Image", "image.Image"},
- }
- dTypes, sTypes []string
- sTypesForDType = map[string][]string{}
- subsampleRatios = []string{
- "444",
- "422",
- "420",
- "440",
- }
- ops = []string{"Over", "Src"}
- // alwaysOpaque are those image.Image implementations that are always
- // opaque. For these types, Over is equivalent to the faster Src, in the
- // absence of a source mask.
- alwaysOpaque = map[string]bool{
- "*image.Gray": true,
- "*image.YCbCr": true,
- }
-)
-
-func init() {
- dTypesSeen := map[string]bool{}
- sTypesSeen := map[string]bool{}
- for _, t := range dsTypes {
- if !sTypesSeen[t.sType] {
- sTypesSeen[t.sType] = true
- sTypes = append(sTypes, t.sType)
- }
- if !dTypesSeen[t.dType] {
- dTypesSeen[t.dType] = true
- dTypes = append(dTypes, t.dType)
- }
- sTypesForDType[t.dType] = append(sTypesForDType[t.dType], t.sType)
- }
- sTypesForDType["anyDType"] = sTypes
-}
-
-type data struct {
- dType string
- sType string
- sratio string
- receiver string
- op string
-}
-
-func gen(w *bytes.Buffer, receiver string, codes ...string) {
- expn(w, codeRoot, &data{receiver: receiver})
- for _, code := range codes {
- for _, t := range dsTypes {
- for _, op := range ops {
- if op == "Over" && alwaysOpaque[t.sType] {
- continue
- }
- expn(w, code, &data{
- dType: t.dType,
- sType: t.sType,
- receiver: receiver,
- op: op,
- })
- }
- }
- }
-}
-
-func genKernel(w *bytes.Buffer) {
- expn(w, codeKernelRoot, &data{})
- for _, sType := range sTypes {
- expn(w, codeKernelScaleLeafX, &data{
- sType: sType,
- })
- }
- for _, dType := range dTypes {
- for _, op := range ops {
- expn(w, codeKernelScaleLeafY, &data{
- dType: dType,
- op: op,
- })
- }
- }
- for _, t := range dsTypes {
- for _, op := range ops {
- if op == "Over" && alwaysOpaque[t.sType] {
- continue
- }
- expn(w, codeKernelTransformLeaf, &data{
- dType: t.dType,
- sType: t.sType,
- op: op,
- })
- }
- }
-}
-
-func expn(w *bytes.Buffer, code string, d *data) {
- if d.sType == "*image.YCbCr" && d.sratio == "" {
- for _, sratio := range subsampleRatios {
- e := *d
- e.sratio = sratio
- expn(w, code, &e)
- }
- return
- }
-
- for _, line := range strings.Split(code, "\n") {
- line = expnLine(line, d)
- if line == ";" {
- continue
- }
- fmt.Fprintln(w, line)
- }
-}
-
-func expnLine(line string, d *data) string {
- for {
- i := strings.IndexByte(line, '$')
- if i < 0 {
- break
- }
- prefix, s := line[:i], line[i+1:]
-
- i = len(s)
- for j, c := range s {
- if !('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') {
- i = j
- break
- }
- }
- dollar, suffix := s[:i], s[i:]
-
- e := expnDollar(prefix, dollar, suffix, d)
- if e == "" {
- log.Fatalf("couldn't expand %q", line)
- }
- line = e
- }
- return line
-}
-
-// expnDollar expands a "$foo" fragment in a line of generated code. It returns
-// the empty string if there was a problem. It returns ";" if the generated
-// code is a no-op.
-func expnDollar(prefix, dollar, suffix string, d *data) string {
- switch dollar {
- case "dType":
- return prefix + d.dType + suffix
- case "dTypeRN":
- return prefix + relName(d.dType) + suffix
- case "sratio":
- return prefix + d.sratio + suffix
- case "sType":
- return prefix + d.sType + suffix
- case "sTypeRN":
- return prefix + relName(d.sType) + suffix
- case "receiver":
- return prefix + d.receiver + suffix
- case "op":
- return prefix + d.op + suffix
-
- case "switch":
- return expnSwitch("", "", true, suffix)
- case "switchD":
- return expnSwitch("", "", false, suffix)
- case "switchS":
- return expnSwitch("", "anyDType", false, suffix)
-
- case "preOuter":
- switch d.dType {
- default:
- return ";"
- case "Image":
- s := ""
- if d.sType == "image.Image" {
- s = "srcMask, smp := opts.SrcMask, opts.SrcMaskP\n"
- }
- return s +
- "dstMask, dmp := opts.DstMask, opts.DstMaskP\n" +
- "dstColorRGBA64 := &color.RGBA64{}\n" +
- "dstColor := color.Color(dstColorRGBA64)"
- }
-
- case "preInner":
- switch d.dType {
- default:
- return ";"
- case "*image.RGBA":
- return "d := " + pixOffset("dst", "dr.Min.X+adr.Min.X", "dr.Min.Y+int(dy)", "*4", "*dst.Stride")
- }
-
- case "preKernelOuter":
- switch d.sType {
- default:
- return ";"
- case "image.Image":
- return "srcMask, smp := opts.SrcMask, opts.SrcMaskP"
- }
-
- case "preKernelInner":
- switch d.dType {
- default:
- return ";"
- case "*image.RGBA":
- return "d := " + pixOffset("dst", "dr.Min.X+int(dx)", "dr.Min.Y+adr.Min.Y", "*4", "*dst.Stride")
- }
-
- case "blend":
- args, _ := splitArgs(suffix)
- if len(args) != 4 {
- return ""
- }
- switch d.sType {
- default:
- return argf(args, ""+
- "$3r = $0*$1r + $2*$3r\n"+
- "$3g = $0*$1g + $2*$3g\n"+
- "$3b = $0*$1b + $2*$3b\n"+
- "$3a = $0*$1a + $2*$3a",
- )
- case "*image.Gray":
- return argf(args, ""+
- "$3r = $0*$1r + $2*$3r",
- )
- case "*image.YCbCr":
- return argf(args, ""+
- "$3r = $0*$1r + $2*$3r\n"+
- "$3g = $0*$1g + $2*$3g\n"+
- "$3b = $0*$1b + $2*$3b",
- )
- }
-
- case "clampToAlpha":
- if alwaysOpaque[d.sType] {
- return ";"
- }
- // Go uses alpha-premultiplied color. The naive computation can lead to
- // invalid colors, e.g. red > alpha, when some weights are negative.
- return `
- if pr > pa {
- pr = pa
- }
- if pg > pa {
- pg = pa
- }
- if pb > pa {
- pb = pa
- }
- `
-
- case "convFtou":
- args, _ := splitArgs(suffix)
- if len(args) != 2 {
- return ""
- }
-
- switch d.sType {
- default:
- return argf(args, ""+
- "$0r := uint32($1r)\n"+
- "$0g := uint32($1g)\n"+
- "$0b := uint32($1b)\n"+
- "$0a := uint32($1a)",
- )
- case "*image.Gray":
- return argf(args, ""+
- "$0r := uint32($1r)",
- )
- case "*image.YCbCr":
- return argf(args, ""+
- "$0r := uint32($1r)\n"+
- "$0g := uint32($1g)\n"+
- "$0b := uint32($1b)",
- )
- }
-
- case "outputu":
- args, _ := splitArgs(suffix)
- if len(args) != 3 {
- return ""
- }
-
- switch d.op {
- case "Over":
- switch d.dType {
- default:
- log.Fatalf("bad dType %q", d.dType)
- case "Image":
- return argf(args, ""+
- "qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+
- "if dstMask != nil {\n"+
- " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+
- " $2r = $2r * ma / 0xffff\n"+
- " $2g = $2g * ma / 0xffff\n"+
- " $2b = $2b * ma / 0xffff\n"+
- " $2a = $2a * ma / 0xffff\n"+
- "}\n"+
- "$2a1 := 0xffff - $2a\n"+
- "dstColorRGBA64.R = uint16(qr*$2a1/0xffff + $2r)\n"+
- "dstColorRGBA64.G = uint16(qg*$2a1/0xffff + $2g)\n"+
- "dstColorRGBA64.B = uint16(qb*$2a1/0xffff + $2b)\n"+
- "dstColorRGBA64.A = uint16(qa*$2a1/0xffff + $2a)\n"+
- "dst.Set($0, $1, dstColor)",
- )
- case "*image.RGBA":
- return argf(args, ""+
- "$2a1 := (0xffff - $2a) * 0x101\n"+
- "dst.Pix[d+0] = uint8((uint32(dst.Pix[d+0])*$2a1/0xffff + $2r) >> 8)\n"+
- "dst.Pix[d+1] = uint8((uint32(dst.Pix[d+1])*$2a1/0xffff + $2g) >> 8)\n"+
- "dst.Pix[d+2] = uint8((uint32(dst.Pix[d+2])*$2a1/0xffff + $2b) >> 8)\n"+
- "dst.Pix[d+3] = uint8((uint32(dst.Pix[d+3])*$2a1/0xffff + $2a) >> 8)",
- )
- }
-
- case "Src":
- switch d.dType {
- default:
- log.Fatalf("bad dType %q", d.dType)
- case "Image":
- return argf(args, ""+
- "if dstMask != nil {\n"+
- " qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+
- " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+
- " pr = pr * ma / 0xffff\n"+
- " pg = pg * ma / 0xffff\n"+
- " pb = pb * ma / 0xffff\n"+
- " pa = pa * ma / 0xffff\n"+
- " $2a1 := 0xffff - ma\n"+ // Note that this is ma, not $2a.
- " dstColorRGBA64.R = uint16(qr*$2a1/0xffff + $2r)\n"+
- " dstColorRGBA64.G = uint16(qg*$2a1/0xffff + $2g)\n"+
- " dstColorRGBA64.B = uint16(qb*$2a1/0xffff + $2b)\n"+
- " dstColorRGBA64.A = uint16(qa*$2a1/0xffff + $2a)\n"+
- " dst.Set($0, $1, dstColor)\n"+
- "} else {\n"+
- " dstColorRGBA64.R = uint16($2r)\n"+
- " dstColorRGBA64.G = uint16($2g)\n"+
- " dstColorRGBA64.B = uint16($2b)\n"+
- " dstColorRGBA64.A = uint16($2a)\n"+
- " dst.Set($0, $1, dstColor)\n"+
- "}",
- )
- case "*image.RGBA":
- switch d.sType {
- default:
- return argf(args, ""+
- "dst.Pix[d+0] = uint8($2r >> 8)\n"+
- "dst.Pix[d+1] = uint8($2g >> 8)\n"+
- "dst.Pix[d+2] = uint8($2b >> 8)\n"+
- "dst.Pix[d+3] = uint8($2a >> 8)",
- )
- case "*image.Gray":
- return argf(args, ""+
- "out := uint8($2r >> 8)\n"+
- "dst.Pix[d+0] = out\n"+
- "dst.Pix[d+1] = out\n"+
- "dst.Pix[d+2] = out\n"+
- "dst.Pix[d+3] = 0xff",
- )
- case "*image.YCbCr":
- return argf(args, ""+
- "dst.Pix[d+0] = uint8($2r >> 8)\n"+
- "dst.Pix[d+1] = uint8($2g >> 8)\n"+
- "dst.Pix[d+2] = uint8($2b >> 8)\n"+
- "dst.Pix[d+3] = 0xff",
- )
- }
- }
- }
-
- case "outputf":
- args, _ := splitArgs(suffix)
- if len(args) != 5 {
- return ""
- }
- ret := ""
-
- switch d.op {
- case "Over":
- switch d.dType {
- default:
- log.Fatalf("bad dType %q", d.dType)
- case "Image":
- ret = argf(args, ""+
- "qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+
- "$3r0 := uint32($2($3r * $4))\n"+
- "$3g0 := uint32($2($3g * $4))\n"+
- "$3b0 := uint32($2($3b * $4))\n"+
- "$3a0 := uint32($2($3a * $4))\n"+
- "if dstMask != nil {\n"+
- " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+
- " $3r0 = $3r0 * ma / 0xffff\n"+
- " $3g0 = $3g0 * ma / 0xffff\n"+
- " $3b0 = $3b0 * ma / 0xffff\n"+
- " $3a0 = $3a0 * ma / 0xffff\n"+
- "}\n"+
- "$3a1 := 0xffff - $3a0\n"+
- "dstColorRGBA64.R = uint16(qr*$3a1/0xffff + $3r0)\n"+
- "dstColorRGBA64.G = uint16(qg*$3a1/0xffff + $3g0)\n"+
- "dstColorRGBA64.B = uint16(qb*$3a1/0xffff + $3b0)\n"+
- "dstColorRGBA64.A = uint16(qa*$3a1/0xffff + $3a0)\n"+
- "dst.Set($0, $1, dstColor)",
- )
- case "*image.RGBA":
- ret = argf(args, ""+
- "$3r0 := uint32($2($3r * $4))\n"+
- "$3g0 := uint32($2($3g * $4))\n"+
- "$3b0 := uint32($2($3b * $4))\n"+
- "$3a0 := uint32($2($3a * $4))\n"+
- "$3a1 := (0xffff - uint32($3a0)) * 0x101\n"+
- "dst.Pix[d+0] = uint8((uint32(dst.Pix[d+0])*$3a1/0xffff + $3r0) >> 8)\n"+
- "dst.Pix[d+1] = uint8((uint32(dst.Pix[d+1])*$3a1/0xffff + $3g0) >> 8)\n"+
- "dst.Pix[d+2] = uint8((uint32(dst.Pix[d+2])*$3a1/0xffff + $3b0) >> 8)\n"+
- "dst.Pix[d+3] = uint8((uint32(dst.Pix[d+3])*$3a1/0xffff + $3a0) >> 8)",
- )
- }
-
- case "Src":
- switch d.dType {
- default:
- log.Fatalf("bad dType %q", d.dType)
- case "Image":
- ret = argf(args, ""+
- "if dstMask != nil {\n"+
- " qr, qg, qb, qa := dst.At($0, $1).RGBA()\n"+
- " _, _, _, ma := dstMask.At(dmp.X + $0, dmp.Y + $1).RGBA()\n"+
- " pr := uint32($2($3r * $4)) * ma / 0xffff\n"+
- " pg := uint32($2($3g * $4)) * ma / 0xffff\n"+
- " pb := uint32($2($3b * $4)) * ma / 0xffff\n"+
- " pa := uint32($2($3a * $4)) * ma / 0xffff\n"+
- " pa1 := 0xffff - ma\n"+ // Note that this is ma, not pa.
- " dstColorRGBA64.R = uint16(qr*pa1/0xffff + pr)\n"+
- " dstColorRGBA64.G = uint16(qg*pa1/0xffff + pg)\n"+
- " dstColorRGBA64.B = uint16(qb*pa1/0xffff + pb)\n"+
- " dstColorRGBA64.A = uint16(qa*pa1/0xffff + pa)\n"+
- " dst.Set($0, $1, dstColor)\n"+
- "} else {\n"+
- " dstColorRGBA64.R = $2($3r * $4)\n"+
- " dstColorRGBA64.G = $2($3g * $4)\n"+
- " dstColorRGBA64.B = $2($3b * $4)\n"+
- " dstColorRGBA64.A = $2($3a * $4)\n"+
- " dst.Set($0, $1, dstColor)\n"+
- "}",
- )
- case "*image.RGBA":
- switch d.sType {
- default:
- ret = argf(args, ""+
- "dst.Pix[d+0] = uint8($2($3r * $4) >> 8)\n"+
- "dst.Pix[d+1] = uint8($2($3g * $4) >> 8)\n"+
- "dst.Pix[d+2] = uint8($2($3b * $4) >> 8)\n"+
- "dst.Pix[d+3] = uint8($2($3a * $4) >> 8)",
- )
- case "*image.Gray":
- ret = argf(args, ""+
- "out := uint8($2($3r * $4) >> 8)\n"+
- "dst.Pix[d+0] = out\n"+
- "dst.Pix[d+1] = out\n"+
- "dst.Pix[d+2] = out\n"+
- "dst.Pix[d+3] = 0xff",
- )
- case "*image.YCbCr":
- ret = argf(args, ""+
- "dst.Pix[d+0] = uint8($2($3r * $4) >> 8)\n"+
- "dst.Pix[d+1] = uint8($2($3g * $4) >> 8)\n"+
- "dst.Pix[d+2] = uint8($2($3b * $4) >> 8)\n"+
- "dst.Pix[d+3] = 0xff",
- )
- }
- }
- }
-
- return strings.Replace(ret, " * 1)", ")", -1)
-
- case "srcf", "srcu":
- lhs, eqOp := splitEq(prefix)
- if lhs == "" {
- return ""
- }
- args, extra := splitArgs(suffix)
- if len(args) != 2 {
- return ""
- }
-
- tmp := ""
- if dollar == "srcf" {
- tmp = "u"
- }
-
- // TODO: there's no need to multiply by 0x101 in the switch below if
- // the next thing we're going to do is shift right by 8.
-
- buf := new(bytes.Buffer)
- switch d.sType {
- default:
- log.Fatalf("bad sType %q", d.sType)
- case "image.Image":
- fmt.Fprintf(buf, ""+
- "%sr%s, %sg%s, %sb%s, %sa%s := src.At(%s, %s).RGBA()\n",
- lhs, tmp, lhs, tmp, lhs, tmp, lhs, tmp, args[0], args[1],
- )
- if d.dType == "" || d.dType == "Image" {
- fmt.Fprintf(buf, ""+
- "if srcMask != nil {\n"+
- " _, _, _, ma := srcMask.At(smp.X+%s, smp.Y+%s).RGBA()\n"+
- " %sr%s = %sr%s * ma / 0xffff\n"+
- " %sg%s = %sg%s * ma / 0xffff\n"+
- " %sb%s = %sb%s * ma / 0xffff\n"+
- " %sa%s = %sa%s * ma / 0xffff\n"+
- "}\n",
- args[0], args[1],
- lhs, tmp, lhs, tmp,
- lhs, tmp, lhs, tmp,
- lhs, tmp, lhs, tmp,
- lhs, tmp, lhs, tmp,
- )
- }
- case "*image.Gray":
- fmt.Fprintf(buf, ""+
- "%si := %s\n"+
- "%sr%s := uint32(src.Pix[%si]) * 0x101\n",
- lhs, pixOffset("src", args[0], args[1], "", "*src.Stride"),
- lhs, tmp, lhs,
- )
- case "*image.NRGBA":
- fmt.Fprintf(buf, ""+
- "%si := %s\n"+
- "%sa%s := uint32(src.Pix[%si+3]) * 0x101\n"+
- "%sr%s := uint32(src.Pix[%si+0]) * %sa%s / 0xff\n"+
- "%sg%s := uint32(src.Pix[%si+1]) * %sa%s / 0xff\n"+
- "%sb%s := uint32(src.Pix[%si+2]) * %sa%s / 0xff\n",
- lhs, pixOffset("src", args[0], args[1], "*4", "*src.Stride"),
- lhs, tmp, lhs,
- lhs, tmp, lhs, lhs, tmp,
- lhs, tmp, lhs, lhs, tmp,
- lhs, tmp, lhs, lhs, tmp,
- )
- case "*image.RGBA":
- fmt.Fprintf(buf, ""+
- "%si := %s\n"+
- "%sr%s := uint32(src.Pix[%si+0]) * 0x101\n"+
- "%sg%s := uint32(src.Pix[%si+1]) * 0x101\n"+
- "%sb%s := uint32(src.Pix[%si+2]) * 0x101\n"+
- "%sa%s := uint32(src.Pix[%si+3]) * 0x101\n",
- lhs, pixOffset("src", args[0], args[1], "*4", "*src.Stride"),
- lhs, tmp, lhs,
- lhs, tmp, lhs,
- lhs, tmp, lhs,
- lhs, tmp, lhs,
- )
- case "*image.YCbCr":
- fmt.Fprintf(buf, ""+
- "%si := %s\n"+
- "%sj := %s\n"+
- "%s\n",
- lhs, pixOffset("src", args[0], args[1], "", "*src.YStride"),
- lhs, cOffset(args[0], args[1], d.sratio),
- ycbcrToRGB(lhs, tmp),
- )
- }
-
- if dollar == "srcf" {
- switch d.sType {
- default:
- fmt.Fprintf(buf, ""+
- "%sr %s float64(%sru)%s\n"+
- "%sg %s float64(%sgu)%s\n"+
- "%sb %s float64(%sbu)%s\n"+
- "%sa %s float64(%sau)%s\n",
- lhs, eqOp, lhs, extra,
- lhs, eqOp, lhs, extra,
- lhs, eqOp, lhs, extra,
- lhs, eqOp, lhs, extra,
- )
- case "*image.Gray":
- fmt.Fprintf(buf, ""+
- "%sr %s float64(%sru)%s\n",
- lhs, eqOp, lhs, extra,
- )
- case "*image.YCbCr":
- fmt.Fprintf(buf, ""+
- "%sr %s float64(%sru)%s\n"+
- "%sg %s float64(%sgu)%s\n"+
- "%sb %s float64(%sbu)%s\n",
- lhs, eqOp, lhs, extra,
- lhs, eqOp, lhs, extra,
- lhs, eqOp, lhs, extra,
- )
- }
- }
-
- return strings.TrimSpace(buf.String())
-
- case "tweakD":
- if d.dType == "*image.RGBA" {
- return "d += dst.Stride"
- }
- return ";"
-
- case "tweakDx":
- if d.dType == "*image.RGBA" {
- return strings.Replace(prefix, "dx++", "dx, d = dx+1, d+4", 1)
- }
- return prefix
-
- case "tweakDy":
- if d.dType == "*image.RGBA" {
- return strings.Replace(prefix, "for dy, s", "for _, s", 1)
- }
- return prefix
-
- case "tweakP":
- switch d.sType {
- case "*image.Gray":
- if strings.HasPrefix(strings.TrimSpace(prefix), "pa * ") {
- return "1,"
- }
- return "pr,"
- case "*image.YCbCr":
- if strings.HasPrefix(strings.TrimSpace(prefix), "pa * ") {
- return "1,"
- }
- }
- return prefix
-
- case "tweakPr":
- if d.sType == "*image.Gray" {
- return "pr *= s.invTotalWeightFFFF"
- }
- return ";"
-
- case "tweakVarP":
- switch d.sType {
- case "*image.Gray":
- return strings.Replace(prefix, "var pr, pg, pb, pa", "var pr", 1)
- case "*image.YCbCr":
- return strings.Replace(prefix, "var pr, pg, pb, pa", "var pr, pg, pb", 1)
- }
- return prefix
- }
- return ""
-}
-
-func expnSwitch(op, dType string, expandBoth bool, template string) string {
- if op == "" && dType != "anyDType" {
- lines := []string{"switch op {"}
- for _, op = range ops {
- lines = append(lines,
- fmt.Sprintf("case %s:", op),
- expnSwitch(op, dType, expandBoth, template),
- )
- }
- lines = append(lines, "}")
- return strings.Join(lines, "\n")
- }
-
- switchVar := "dst"
- if dType != "" {
- switchVar = "src"
- }
- lines := []string{fmt.Sprintf("switch %s := %s.(type) {", switchVar, switchVar)}
-
- fallback, values := "Image", dTypes
- if dType != "" {
- fallback, values = "image.Image", sTypesForDType[dType]
- }
- for _, v := range values {
- if dType != "" {
- // v is the sType. Skip those always-opaque sTypes, where Over is
- // equivalent to Src.
- if op == "Over" && alwaysOpaque[v] {
- continue
- }
- }
-
- if v == fallback {
- lines = append(lines, "default:")
- } else {
- lines = append(lines, fmt.Sprintf("case %s:", v))
- }
-
- if dType != "" {
- if v == "*image.YCbCr" {
- lines = append(lines, expnSwitchYCbCr(op, dType, template))
- } else {
- lines = append(lines, expnLine(template, &data{dType: dType, sType: v, op: op}))
- }
- } else if !expandBoth {
- lines = append(lines, expnLine(template, &data{dType: v, op: op}))
- } else {
- lines = append(lines, expnSwitch(op, v, false, template))
- }
- }
-
- lines = append(lines, "}")
- return strings.Join(lines, "\n")
-}
-
-func expnSwitchYCbCr(op, dType, template string) string {
- lines := []string{
- "switch src.SubsampleRatio {",
- "default:",
- expnLine(template, &data{dType: dType, sType: "image.Image", op: op}),
- }
- for _, sratio := range subsampleRatios {
- lines = append(lines,
- fmt.Sprintf("case image.YCbCrSubsampleRatio%s:", sratio),
- expnLine(template, &data{dType: dType, sType: "*image.YCbCr", sratio: sratio, op: op}),
- )
- }
- lines = append(lines, "}")
- return strings.Join(lines, "\n")
-}
-
-func argf(args []string, s string) string {
- if len(args) > 9 {
- panic("too many args")
- }
- for i, a := range args {
- old := fmt.Sprintf("$%d", i)
- s = strings.Replace(s, old, a, -1)
- }
- return s
-}
-
-func pixOffset(m, x, y, xstride, ystride string) string {
- return fmt.Sprintf("(%s-%s.Rect.Min.Y)%s + (%s-%s.Rect.Min.X)%s", y, m, ystride, x, m, xstride)
-}
-
-func cOffset(x, y, sratio string) string {
- switch sratio {
- case "444":
- return fmt.Sprintf("( %s - src.Rect.Min.Y )*src.CStride + ( %s - src.Rect.Min.X )", y, x)
- case "422":
- return fmt.Sprintf("( %s - src.Rect.Min.Y )*src.CStride + ((%s)/2 - src.Rect.Min.X/2)", y, x)
- case "420":
- return fmt.Sprintf("((%s)/2 - src.Rect.Min.Y/2)*src.CStride + ((%s)/2 - src.Rect.Min.X/2)", y, x)
- case "440":
- return fmt.Sprintf("((%s)/2 - src.Rect.Min.Y/2)*src.CStride + ( %s - src.Rect.Min.X )", y, x)
- }
- return fmt.Sprintf("unsupported sratio %q", sratio)
-}
-
-func ycbcrToRGB(lhs, tmp string) string {
- s := `
- // This is an inline version of image/color/ycbcr.go's YCbCr.RGBA method.
- $yy1 := int(src.Y[$i]) * 0x10101
- $cb1 := int(src.Cb[$j]) - 128
- $cr1 := int(src.Cr[$j]) - 128
- $r@ := ($yy1 + 91881*$cr1) >> 8
- $g@ := ($yy1 - 22554*$cb1 - 46802*$cr1) >> 8
- $b@ := ($yy1 + 116130*$cb1) >> 8
- if $r@ < 0 {
- $r@ = 0
- } else if $r@ > 0xffff {
- $r@ = 0xffff
- }
- if $g@ < 0 {
- $g@ = 0
- } else if $g@ > 0xffff {
- $g@ = 0xffff
- }
- if $b@ < 0 {
- $b@ = 0
- } else if $b@ > 0xffff {
- $b@ = 0xffff
- }
- `
- s = strings.Replace(s, "$", lhs, -1)
- s = strings.Replace(s, "@", tmp, -1)
- return s
-}
-
-func split(s, sep string) (string, string) {
- if i := strings.Index(s, sep); i >= 0 {
- return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+len(sep):])
- }
- return "", ""
-}
-
-func splitEq(s string) (lhs, eqOp string) {
- s = strings.TrimSpace(s)
- if lhs, _ = split(s, ":="); lhs != "" {
- return lhs, ":="
- }
- if lhs, _ = split(s, "+="); lhs != "" {
- return lhs, "+="
- }
- return "", ""
-}
-
-func splitArgs(s string) (args []string, extra string) {
- s = strings.TrimSpace(s)
- if s == "" || s[0] != '[' {
- return nil, ""
- }
- s = s[1:]
-
- i := strings.IndexByte(s, ']')
- if i < 0 {
- return nil, ""
- }
- args, extra = strings.Split(s[:i], ","), s[i+1:]
- for i := range args {
- args[i] = strings.TrimSpace(args[i])
- }
- return args, extra
-}
-
-func relName(s string) string {
- if i := strings.LastIndex(s, "."); i >= 0 {
- return s[i+1:]
- }
- return s
-}
-
-const (
- codeRoot = `
- func (z $receiver) Scale(dst Image, dr image.Rectangle, src image.Image, sr image.Rectangle, op Op, opts *Options) {
- // Try to simplify a Scale to a Copy when DstMask is not specified.
- // If DstMask is not nil, Copy will call Scale back with same dr and sr, and cause stack overflow.
- if dr.Size() == sr.Size() && (opts == nil || opts.DstMask == nil) {
- Copy(dst, dr.Min, src, sr, op, opts)
- return
- }
-
- var o Options
- if opts != nil {
- o = *opts
- }
-
- // adr is the affected destination pixels.
- adr := dst.Bounds().Intersect(dr)
- adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP)
- if adr.Empty() || sr.Empty() {
- return
- }
- // Make adr relative to dr.Min.
- adr = adr.Sub(dr.Min)
- if op == Over && o.SrcMask == nil && opaque(src) {
- op = Src
- }
-
- // sr is the source pixels. If it extends beyond the src bounds,
- // we cannot use the type-specific fast paths, as they access
- // the Pix fields directly without bounds checking.
- //
- // Similarly, the fast paths assume that the masks are nil.
- if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) {
- switch op {
- case Over:
- z.scale_Image_Image_Over(dst, dr, adr, src, sr, &o)
- case Src:
- z.scale_Image_Image_Src(dst, dr, adr, src, sr, &o)
- }
- } else if _, ok := src.(*image.Uniform); ok {
- Draw(dst, dr, src, src.Bounds().Min, op)
- } else {
- $switch z.scale_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, src, sr, &o)
- }
- }
-
- func (z $receiver) Transform(dst Image, s2d f64.Aff3, src image.Image, sr image.Rectangle, op Op, opts *Options) {
- // Try to simplify a Transform to a Copy.
- if s2d[0] == 1 && s2d[1] == 0 && s2d[3] == 0 && s2d[4] == 1 {
- dx := int(s2d[2])
- dy := int(s2d[5])
- if float64(dx) == s2d[2] && float64(dy) == s2d[5] {
- Copy(dst, image.Point{X: sr.Min.X + dx, Y: sr.Min.X + dy}, src, sr, op, opts)
- return
- }
- }
-
- var o Options
- if opts != nil {
- o = *opts
- }
-
- dr := transformRect(&s2d, &sr)
- // adr is the affected destination pixels.
- adr := dst.Bounds().Intersect(dr)
- adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP)
- if adr.Empty() || sr.Empty() {
- return
- }
- if op == Over && o.SrcMask == nil && opaque(src) {
- op = Src
- }
-
- d2s := invert(&s2d)
- // bias is a translation of the mapping from dst coordinates to src
- // coordinates such that the latter temporarily have non-negative X
- // and Y coordinates. This allows us to write int(f) instead of
- // int(math.Floor(f)), since "round to zero" and "round down" are
- // equivalent when f >= 0, but the former is much cheaper. The X--
- // and Y-- are because the TransformLeaf methods have a "sx -= 0.5"
- // adjustment.
- bias := transformRect(&d2s, &adr).Min
- bias.X--
- bias.Y--
- d2s[2] -= float64(bias.X)
- d2s[5] -= float64(bias.Y)
- // Make adr relative to dr.Min.
- adr = adr.Sub(dr.Min)
- // sr is the source pixels. If it extends beyond the src bounds,
- // we cannot use the type-specific fast paths, as they access
- // the Pix fields directly without bounds checking.
- //
- // Similarly, the fast paths assume that the masks are nil.
- if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) {
- switch op {
- case Over:
- z.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, &o)
- case Src:
- z.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, &o)
- }
- } else if u, ok := src.(*image.Uniform); ok {
- transform_Uniform(dst, dr, adr, &d2s, u, sr, bias, op)
- } else {
- $switch z.transform_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, &d2s, src, sr, bias, &o)
- }
- }
- `
-
- codeNNScaleLeaf = `
- func (nnInterpolator) scale_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, src $sType, sr image.Rectangle, opts *Options) {
- dw2 := uint64(dr.Dx()) * 2
- dh2 := uint64(dr.Dy()) * 2
- sw := uint64(sr.Dx())
- sh := uint64(sr.Dy())
- $preOuter
- for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ {
- sy := (2*uint64(dy) + 1) * sh / dh2
- $preInner
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx
- sx := (2*uint64(dx) + 1) * sw / dw2
- p := $srcu[sr.Min.X + int(sx), sr.Min.Y + int(sy)]
- $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p]
- }
- }
- }
- `
-
- codeNNTransformLeaf = `
- func (nnInterpolator) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, opts *Options) {
- $preOuter
- for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ {
- dyf := float64(dr.Min.Y + int(dy)) + 0.5
- $preInner
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx
- dxf := float64(dr.Min.X + int(dx)) + 0.5
- sx0 := int(d2s[0]*dxf + d2s[1]*dyf + d2s[2]) + bias.X
- sy0 := int(d2s[3]*dxf + d2s[4]*dyf + d2s[5]) + bias.Y
- if !(image.Point{sx0, sy0}).In(sr) {
- continue
- }
- p := $srcu[sx0, sy0]
- $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p]
- }
- }
- }
- `
-
- codeABLScaleLeaf = `
- func (ablInterpolator) scale_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, src $sType, sr image.Rectangle, opts *Options) {
- sw := int32(sr.Dx())
- sh := int32(sr.Dy())
- yscale := float64(sh) / float64(dr.Dy())
- xscale := float64(sw) / float64(dr.Dx())
- swMinus1, shMinus1 := sw - 1, sh - 1
- $preOuter
-
- for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ {
- sy := (float64(dy)+0.5)*yscale - 0.5
- // If sy < 0, we will clamp sy0 to 0 anyway, so it doesn't matter if
- // we say int32(sy) instead of int32(math.Floor(sy)). Similarly for
- // sx, below.
- sy0 := int32(sy)
- yFrac0 := sy - float64(sy0)
- yFrac1 := 1 - yFrac0
- sy1 := sy0 + 1
- if sy < 0 {
- sy0, sy1 = 0, 0
- yFrac0, yFrac1 = 0, 1
- } else if sy1 > shMinus1 {
- sy0, sy1 = shMinus1, shMinus1
- yFrac0, yFrac1 = 1, 0
- }
- $preInner
-
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx
- sx := (float64(dx)+0.5)*xscale - 0.5
- sx0 := int32(sx)
- xFrac0 := sx - float64(sx0)
- xFrac1 := 1 - xFrac0
- sx1 := sx0 + 1
- if sx < 0 {
- sx0, sx1 = 0, 0
- xFrac0, xFrac1 = 0, 1
- } else if sx1 > swMinus1 {
- sx0, sx1 = swMinus1, swMinus1
- xFrac0, xFrac1 = 1, 0
- }
-
- s00 := $srcf[sr.Min.X + int(sx0), sr.Min.Y + int(sy0)]
- s10 := $srcf[sr.Min.X + int(sx1), sr.Min.Y + int(sy0)]
- $blend[xFrac1, s00, xFrac0, s10]
- s01 := $srcf[sr.Min.X + int(sx0), sr.Min.Y + int(sy1)]
- s11 := $srcf[sr.Min.X + int(sx1), sr.Min.Y + int(sy1)]
- $blend[xFrac1, s01, xFrac0, s11]
- $blend[yFrac1, s10, yFrac0, s11]
- $convFtou[p, s11]
- $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p]
- }
- }
- }
- `
-
- codeABLTransformLeaf = `
- func (ablInterpolator) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, opts *Options) {
- $preOuter
- for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ {
- dyf := float64(dr.Min.Y + int(dy)) + 0.5
- $preInner
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx
- dxf := float64(dr.Min.X + int(dx)) + 0.5
- sx := d2s[0]*dxf + d2s[1]*dyf + d2s[2]
- sy := d2s[3]*dxf + d2s[4]*dyf + d2s[5]
- if !(image.Point{int(sx) + bias.X, int(sy) + bias.Y}).In(sr) {
- continue
- }
-
- sx -= 0.5
- sx0 := int(sx)
- xFrac0 := sx - float64(sx0)
- xFrac1 := 1 - xFrac0
- sx0 += bias.X
- sx1 := sx0 + 1
- if sx0 < sr.Min.X {
- sx0, sx1 = sr.Min.X, sr.Min.X
- xFrac0, xFrac1 = 0, 1
- } else if sx1 >= sr.Max.X {
- sx0, sx1 = sr.Max.X-1, sr.Max.X-1
- xFrac0, xFrac1 = 1, 0
- }
-
- sy -= 0.5
- sy0 := int(sy)
- yFrac0 := sy - float64(sy0)
- yFrac1 := 1 - yFrac0
- sy0 += bias.Y
- sy1 := sy0 + 1
- if sy0 < sr.Min.Y {
- sy0, sy1 = sr.Min.Y, sr.Min.Y
- yFrac0, yFrac1 = 0, 1
- } else if sy1 >= sr.Max.Y {
- sy0, sy1 = sr.Max.Y-1, sr.Max.Y-1
- yFrac0, yFrac1 = 1, 0
- }
-
- s00 := $srcf[sx0, sy0]
- s10 := $srcf[sx1, sy0]
- $blend[xFrac1, s00, xFrac0, s10]
- s01 := $srcf[sx0, sy1]
- s11 := $srcf[sx1, sy1]
- $blend[xFrac1, s01, xFrac0, s11]
- $blend[yFrac1, s10, yFrac0, s11]
- $convFtou[p, s11]
- $outputu[dr.Min.X + int(dx), dr.Min.Y + int(dy), p]
- }
- }
- }
- `
-
- codeKernelRoot = `
- func (z *kernelScaler) Scale(dst Image, dr image.Rectangle, src image.Image, sr image.Rectangle, op Op, opts *Options) {
- if z.dw != int32(dr.Dx()) || z.dh != int32(dr.Dy()) || z.sw != int32(sr.Dx()) || z.sh != int32(sr.Dy()) {
- z.kernel.Scale(dst, dr, src, sr, op, opts)
- return
- }
-
- var o Options
- if opts != nil {
- o = *opts
- }
-
- // adr is the affected destination pixels.
- adr := dst.Bounds().Intersect(dr)
- adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP)
- if adr.Empty() || sr.Empty() {
- return
- }
- // Make adr relative to dr.Min.
- adr = adr.Sub(dr.Min)
- if op == Over && o.SrcMask == nil && opaque(src) {
- op = Src
- }
-
- if _, ok := src.(*image.Uniform); ok && o.DstMask == nil && o.SrcMask == nil && sr.In(src.Bounds()) {
- Draw(dst, dr, src, src.Bounds().Min, op)
- return
- }
-
- // Create a temporary buffer:
- // scaleX distributes the source image's columns over the temporary image.
- // scaleY distributes the temporary image's rows over the destination image.
- var tmp [][4]float64
- if z.pool.New != nil {
- tmpp := z.pool.Get().(*[][4]float64)
- defer z.pool.Put(tmpp)
- tmp = *tmpp
- } else {
- tmp = z.makeTmpBuf()
- }
-
- // sr is the source pixels. If it extends beyond the src bounds,
- // we cannot use the type-specific fast paths, as they access
- // the Pix fields directly without bounds checking.
- //
- // Similarly, the fast paths assume that the masks are nil.
- if o.SrcMask != nil || !sr.In(src.Bounds()) {
- z.scaleX_Image(tmp, src, sr, &o)
- } else {
- $switchS z.scaleX_$sTypeRN$sratio(tmp, src, sr, &o)
- }
-
- if o.DstMask != nil {
- switch op {
- case Over:
- z.scaleY_Image_Over(dst, dr, adr, tmp, &o)
- case Src:
- z.scaleY_Image_Src(dst, dr, adr, tmp, &o)
- }
- } else {
- $switchD z.scaleY_$dTypeRN_$op(dst, dr, adr, tmp, &o)
- }
- }
-
- func (q *Kernel) Transform(dst Image, s2d f64.Aff3, src image.Image, sr image.Rectangle, op Op, opts *Options) {
- var o Options
- if opts != nil {
- o = *opts
- }
-
- dr := transformRect(&s2d, &sr)
- // adr is the affected destination pixels.
- adr := dst.Bounds().Intersect(dr)
- adr, o.DstMask = clipAffectedDestRect(adr, o.DstMask, o.DstMaskP)
- if adr.Empty() || sr.Empty() {
- return
- }
- if op == Over && o.SrcMask == nil && opaque(src) {
- op = Src
- }
- d2s := invert(&s2d)
- // bias is a translation of the mapping from dst coordinates to src
- // coordinates such that the latter temporarily have non-negative X
- // and Y coordinates. This allows us to write int(f) instead of
- // int(math.Floor(f)), since "round to zero" and "round down" are
- // equivalent when f >= 0, but the former is much cheaper. The X--
- // and Y-- are because the TransformLeaf methods have a "sx -= 0.5"
- // adjustment.
- bias := transformRect(&d2s, &adr).Min
- bias.X--
- bias.Y--
- d2s[2] -= float64(bias.X)
- d2s[5] -= float64(bias.Y)
- // Make adr relative to dr.Min.
- adr = adr.Sub(dr.Min)
-
- if u, ok := src.(*image.Uniform); ok && o.DstMask != nil && o.SrcMask != nil && sr.In(src.Bounds()) {
- transform_Uniform(dst, dr, adr, &d2s, u, sr, bias, op)
- return
- }
-
- xscale := abs(d2s[0])
- if s := abs(d2s[1]); xscale < s {
- xscale = s
- }
- yscale := abs(d2s[3])
- if s := abs(d2s[4]); yscale < s {
- yscale = s
- }
-
- // sr is the source pixels. If it extends beyond the src bounds,
- // we cannot use the type-specific fast paths, as they access
- // the Pix fields directly without bounds checking.
- //
- // Similarly, the fast paths assume that the masks are nil.
- if o.DstMask != nil || o.SrcMask != nil || !sr.In(src.Bounds()) {
- switch op {
- case Over:
- q.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o)
- case Src:
- q.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o)
- }
- } else {
- $switch q.transform_$dTypeRN_$sTypeRN$sratio_$op(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale, &o)
- }
- }
- `
-
- codeKernelScaleLeafX = `
- func (z *kernelScaler) scaleX_$sTypeRN$sratio(tmp [][4]float64, src $sType, sr image.Rectangle, opts *Options) {
- t := 0
- $preKernelOuter
- for y := int32(0); y < z.sh; y++ {
- for _, s := range z.horizontal.sources {
- var pr, pg, pb, pa float64 $tweakVarP
- for _, c := range z.horizontal.contribs[s.i:s.j] {
- p += $srcf[sr.Min.X + int(c.coord), sr.Min.Y + int(y)] * c.weight
- }
- $tweakPr
- tmp[t] = [4]float64{
- pr * s.invTotalWeightFFFF, $tweakP
- pg * s.invTotalWeightFFFF, $tweakP
- pb * s.invTotalWeightFFFF, $tweakP
- pa * s.invTotalWeightFFFF, $tweakP
- }
- t++
- }
- }
- }
- `
-
- codeKernelScaleLeafY = `
- func (z *kernelScaler) scaleY_$dTypeRN_$op(dst $dType, dr, adr image.Rectangle, tmp [][4]float64, opts *Options) {
- $preOuter
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ {
- $preKernelInner
- for dy, s := range z.vertical.sources[adr.Min.Y:adr.Max.Y] { $tweakDy
- var pr, pg, pb, pa float64
- for _, c := range z.vertical.contribs[s.i:s.j] {
- p := &tmp[c.coord*z.dw+dx]
- pr += p[0] * c.weight
- pg += p[1] * c.weight
- pb += p[2] * c.weight
- pa += p[3] * c.weight
- }
- $clampToAlpha
- $outputf[dr.Min.X + int(dx), dr.Min.Y + int(adr.Min.Y + dy), ftou, p, s.invTotalWeight]
- $tweakD
- }
- }
- }
- `
-
- codeKernelTransformLeaf = `
- func (q *Kernel) transform_$dTypeRN_$sTypeRN$sratio_$op(dst $dType, dr, adr image.Rectangle, d2s *f64.Aff3, src $sType, sr image.Rectangle, bias image.Point, xscale, yscale float64, opts *Options) {
- // When shrinking, broaden the effective kernel support so that we still
- // visit every source pixel.
- xHalfWidth, xKernelArgScale := q.Support, 1.0
- if xscale > 1 {
- xHalfWidth *= xscale
- xKernelArgScale = 1 / xscale
- }
- yHalfWidth, yKernelArgScale := q.Support, 1.0
- if yscale > 1 {
- yHalfWidth *= yscale
- yKernelArgScale = 1 / yscale
- }
-
- xWeights := make([]float64, 1 + 2*int(math.Ceil(xHalfWidth)))
- yWeights := make([]float64, 1 + 2*int(math.Ceil(yHalfWidth)))
-
- $preOuter
- for dy := int32(adr.Min.Y); dy < int32(adr.Max.Y); dy++ {
- dyf := float64(dr.Min.Y + int(dy)) + 0.5
- $preInner
- for dx := int32(adr.Min.X); dx < int32(adr.Max.X); dx++ { $tweakDx
- dxf := float64(dr.Min.X + int(dx)) + 0.5
- sx := d2s[0]*dxf + d2s[1]*dyf + d2s[2]
- sy := d2s[3]*dxf + d2s[4]*dyf + d2s[5]
- if !(image.Point{int(sx) + bias.X, int(sy) + bias.Y}).In(sr) {
- continue
- }
-
- // TODO: adjust the bias so that we can use int(f) instead
- // of math.Floor(f) and math.Ceil(f).
- sx += float64(bias.X)
- sx -= 0.5
- ix := int(math.Floor(sx - xHalfWidth))
- if ix < sr.Min.X {
- ix = sr.Min.X
- }
- jx := int(math.Ceil(sx + xHalfWidth))
- if jx > sr.Max.X {
- jx = sr.Max.X
- }
-
- totalXWeight := 0.0
- for kx := ix; kx < jx; kx++ {
- xWeight := 0.0
- if t := abs((sx - float64(kx)) * xKernelArgScale); t < q.Support {
- xWeight = q.At(t)
- }
- xWeights[kx - ix] = xWeight
- totalXWeight += xWeight
- }
- for x := range xWeights[:jx-ix] {
- xWeights[x] /= totalXWeight
- }
-
- sy += float64(bias.Y)
- sy -= 0.5
- iy := int(math.Floor(sy - yHalfWidth))
- if iy < sr.Min.Y {
- iy = sr.Min.Y
- }
- jy := int(math.Ceil(sy + yHalfWidth))
- if jy > sr.Max.Y {
- jy = sr.Max.Y
- }
-
- totalYWeight := 0.0
- for ky := iy; ky < jy; ky++ {
- yWeight := 0.0
- if t := abs((sy - float64(ky)) * yKernelArgScale); t < q.Support {
- yWeight = q.At(t)
- }
- yWeights[ky - iy] = yWeight
- totalYWeight += yWeight
- }
- for y := range yWeights[:jy-iy] {
- yWeights[y] /= totalYWeight
- }
-
- var pr, pg, pb, pa float64 $tweakVarP
- for ky := iy; ky < jy; ky++ {
- if yWeight := yWeights[ky - iy]; yWeight != 0 {
- for kx := ix; kx < jx; kx++ {
- if w := xWeights[kx - ix] * yWeight; w != 0 {
- p += $srcf[kx, ky] * w
- }
- }
- }
- }
- $clampToAlpha
- $outputf[dr.Min.X + int(dx), dr.Min.Y + int(dy), fffftou, p, 1]
- }
- }
- }
- `
-)
diff --git a/vendor/golang.org/x/image/tiff/lzw/reader.go b/vendor/golang.org/x/image/tiff/lzw/reader.go
index 51ae39f8a7..78204ba92d 100644
--- a/vendor/golang.org/x/image/tiff/lzw/reader.go
+++ b/vendor/golang.org/x/image/tiff/lzw/reader.go
@@ -178,7 +178,7 @@ loop:
break loop
case code <= d.hi:
c, i := code, len(d.output)-1
- if code == d.hi {
+ if code == d.hi && d.last != decoderInvalidCode {
// code == hi is a special case which expands to the last expansion
// followed by the head of the last expansion. To find the head, we walk
// the prefix chain until we find a literal code.
diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go
deleted file mode 100644
index 5d052781bc..0000000000
--- a/vendor/golang.org/x/net/html/atom/gen.go
+++ /dev/null
@@ -1,712 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-//go:generate go run gen.go
-//go:generate go run gen.go -test
-
-package main
-
-import (
- "bytes"
- "flag"
- "fmt"
- "go/format"
- "io/ioutil"
- "math/rand"
- "os"
- "sort"
- "strings"
-)
-
-// identifier converts s to a Go exported identifier.
-// It converts "div" to "Div" and "accept-charset" to "AcceptCharset".
-func identifier(s string) string {
- b := make([]byte, 0, len(s))
- cap := true
- for _, c := range s {
- if c == '-' {
- cap = true
- continue
- }
- if cap && 'a' <= c && c <= 'z' {
- c -= 'a' - 'A'
- }
- cap = false
- b = append(b, byte(c))
- }
- return string(b)
-}
-
-var test = flag.Bool("test", false, "generate table_test.go")
-
-func genFile(name string, buf *bytes.Buffer) {
- b, err := format.Source(buf.Bytes())
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := ioutil.WriteFile(name, b, 0644); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func main() {
- flag.Parse()
-
- var all []string
- all = append(all, elements...)
- all = append(all, attributes...)
- all = append(all, eventHandlers...)
- all = append(all, extra...)
- sort.Strings(all)
-
- // uniq - lists have dups
- w := 0
- for _, s := range all {
- if w == 0 || all[w-1] != s {
- all[w] = s
- w++
- }
- }
- all = all[:w]
-
- if *test {
- var buf bytes.Buffer
- fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n")
- fmt.Fprintln(&buf, "//go:generate go run gen.go -test\n")
- fmt.Fprintln(&buf, "package atom\n")
- fmt.Fprintln(&buf, "var testAtomList = []string{")
- for _, s := range all {
- fmt.Fprintf(&buf, "\t%q,\n", s)
- }
- fmt.Fprintln(&buf, "}")
-
- genFile("table_test.go", &buf)
- return
- }
-
- // Find hash that minimizes table size.
- var best *table
- for i := 0; i < 1000000; i++ {
- if best != nil && 1<<(best.k-1) < len(all) {
- break
- }
- h := rand.Uint32()
- for k := uint(0); k <= 16; k++ {
- if best != nil && k >= best.k {
- break
- }
- var t table
- if t.init(h, k, all) {
- best = &t
- break
- }
- }
- }
- if best == nil {
- fmt.Fprintf(os.Stderr, "failed to construct string table\n")
- os.Exit(1)
- }
-
- // Lay out strings, using overlaps when possible.
- layout := append([]string{}, all...)
-
- // Remove strings that are substrings of other strings
- for changed := true; changed; {
- changed = false
- for i, s := range layout {
- if s == "" {
- continue
- }
- for j, t := range layout {
- if i != j && t != "" && strings.Contains(s, t) {
- changed = true
- layout[j] = ""
- }
- }
- }
- }
-
- // Join strings where one suffix matches another prefix.
- for {
- // Find best i, j, k such that layout[i][len-k:] == layout[j][:k],
- // maximizing overlap length k.
- besti := -1
- bestj := -1
- bestk := 0
- for i, s := range layout {
- if s == "" {
- continue
- }
- for j, t := range layout {
- if i == j {
- continue
- }
- for k := bestk + 1; k <= len(s) && k <= len(t); k++ {
- if s[len(s)-k:] == t[:k] {
- besti = i
- bestj = j
- bestk = k
- }
- }
- }
- }
- if bestk > 0 {
- layout[besti] += layout[bestj][bestk:]
- layout[bestj] = ""
- continue
- }
- break
- }
-
- text := strings.Join(layout, "")
-
- atom := map[string]uint32{}
- for _, s := range all {
- off := strings.Index(text, s)
- if off < 0 {
- panic("lost string " + s)
- }
- atom[s] = uint32(off<<8 | len(s))
- }
-
- var buf bytes.Buffer
- // Generate the Go code.
- fmt.Fprintln(&buf, "// Code generated by go generate gen.go; DO NOT EDIT.\n")
- fmt.Fprintln(&buf, "//go:generate go run gen.go\n")
- fmt.Fprintln(&buf, "package atom\n\nconst (")
-
- // compute max len
- maxLen := 0
- for _, s := range all {
- if maxLen < len(s) {
- maxLen = len(s)
- }
- fmt.Fprintf(&buf, "\t%s Atom = %#x\n", identifier(s), atom[s])
- }
- fmt.Fprintln(&buf, ")\n")
-
- fmt.Fprintf(&buf, "const hash0 = %#x\n\n", best.h0)
- fmt.Fprintf(&buf, "const maxAtomLen = %d\n\n", maxLen)
-
- fmt.Fprintf(&buf, "var table = [1<<%d]Atom{\n", best.k)
- for i, s := range best.tab {
- if s == "" {
- continue
- }
- fmt.Fprintf(&buf, "\t%#x: %#x, // %s\n", i, atom[s], s)
- }
- fmt.Fprintf(&buf, "}\n")
- datasize := (1 << best.k) * 4
-
- fmt.Fprintln(&buf, "const atomText =")
- textsize := len(text)
- for len(text) > 60 {
- fmt.Fprintf(&buf, "\t%q +\n", text[:60])
- text = text[60:]
- }
- fmt.Fprintf(&buf, "\t%q\n\n", text)
-
- genFile("table.go", &buf)
-
- fmt.Fprintf(os.Stdout, "%d atoms; %d string bytes + %d tables = %d total data\n", len(all), textsize, datasize, textsize+datasize)
-}
-
-type byLen []string
-
-func (x byLen) Less(i, j int) bool { return len(x[i]) > len(x[j]) }
-func (x byLen) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-func (x byLen) Len() int { return len(x) }
-
-// fnv computes the FNV hash with an arbitrary starting value h.
-func fnv(h uint32, s string) uint32 {
- for i := 0; i < len(s); i++ {
- h ^= uint32(s[i])
- h *= 16777619
- }
- return h
-}
-
-// A table represents an attempt at constructing the lookup table.
-// The lookup table uses cuckoo hashing, meaning that each string
-// can be found in one of two positions.
-type table struct {
- h0 uint32
- k uint
- mask uint32
- tab []string
-}
-
-// hash returns the two hashes for s.
-func (t *table) hash(s string) (h1, h2 uint32) {
- h := fnv(t.h0, s)
- h1 = h & t.mask
- h2 = (h >> 16) & t.mask
- return
-}
-
-// init initializes the table with the given parameters.
-// h0 is the initial hash value,
-// k is the number of bits of hash value to use, and
-// x is the list of strings to store in the table.
-// init returns false if the table cannot be constructed.
-func (t *table) init(h0 uint32, k uint, x []string) bool {
- t.h0 = h0
- t.k = k
- t.tab = make([]string, 1< len(t.tab) {
- return false
- }
- s := t.tab[i]
- h1, h2 := t.hash(s)
- j := h1 + h2 - i
- if t.tab[j] != "" && !t.push(j, depth+1) {
- return false
- }
- t.tab[j] = s
- return true
-}
-
-// The lists of element names and attribute keys were taken from
-// https://html.spec.whatwg.org/multipage/indices.html#index
-// as of the "HTML Living Standard - Last Updated 16 April 2018" version.
-
-// "command", "keygen" and "menuitem" have been removed from the spec,
-// but are kept here for backwards compatibility.
-var elements = []string{
- "a",
- "abbr",
- "address",
- "area",
- "article",
- "aside",
- "audio",
- "b",
- "base",
- "bdi",
- "bdo",
- "blockquote",
- "body",
- "br",
- "button",
- "canvas",
- "caption",
- "cite",
- "code",
- "col",
- "colgroup",
- "command",
- "data",
- "datalist",
- "dd",
- "del",
- "details",
- "dfn",
- "dialog",
- "div",
- "dl",
- "dt",
- "em",
- "embed",
- "fieldset",
- "figcaption",
- "figure",
- "footer",
- "form",
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- "head",
- "header",
- "hgroup",
- "hr",
- "html",
- "i",
- "iframe",
- "img",
- "input",
- "ins",
- "kbd",
- "keygen",
- "label",
- "legend",
- "li",
- "link",
- "main",
- "map",
- "mark",
- "menu",
- "menuitem",
- "meta",
- "meter",
- "nav",
- "noscript",
- "object",
- "ol",
- "optgroup",
- "option",
- "output",
- "p",
- "param",
- "picture",
- "pre",
- "progress",
- "q",
- "rp",
- "rt",
- "ruby",
- "s",
- "samp",
- "script",
- "section",
- "select",
- "slot",
- "small",
- "source",
- "span",
- "strong",
- "style",
- "sub",
- "summary",
- "sup",
- "table",
- "tbody",
- "td",
- "template",
- "textarea",
- "tfoot",
- "th",
- "thead",
- "time",
- "title",
- "tr",
- "track",
- "u",
- "ul",
- "var",
- "video",
- "wbr",
-}
-
-// https://html.spec.whatwg.org/multipage/indices.html#attributes-3
-//
-// "challenge", "command", "contextmenu", "dropzone", "icon", "keytype", "mediagroup",
-// "radiogroup", "spellcheck", "scoped", "seamless", "sortable" and "sorted" have been removed from the spec,
-// but are kept here for backwards compatibility.
-var attributes = []string{
- "abbr",
- "accept",
- "accept-charset",
- "accesskey",
- "action",
- "allowfullscreen",
- "allowpaymentrequest",
- "allowusermedia",
- "alt",
- "as",
- "async",
- "autocomplete",
- "autofocus",
- "autoplay",
- "challenge",
- "charset",
- "checked",
- "cite",
- "class",
- "color",
- "cols",
- "colspan",
- "command",
- "content",
- "contenteditable",
- "contextmenu",
- "controls",
- "coords",
- "crossorigin",
- "data",
- "datetime",
- "default",
- "defer",
- "dir",
- "dirname",
- "disabled",
- "download",
- "draggable",
- "dropzone",
- "enctype",
- "for",
- "form",
- "formaction",
- "formenctype",
- "formmethod",
- "formnovalidate",
- "formtarget",
- "headers",
- "height",
- "hidden",
- "high",
- "href",
- "hreflang",
- "http-equiv",
- "icon",
- "id",
- "inputmode",
- "integrity",
- "is",
- "ismap",
- "itemid",
- "itemprop",
- "itemref",
- "itemscope",
- "itemtype",
- "keytype",
- "kind",
- "label",
- "lang",
- "list",
- "loop",
- "low",
- "manifest",
- "max",
- "maxlength",
- "media",
- "mediagroup",
- "method",
- "min",
- "minlength",
- "multiple",
- "muted",
- "name",
- "nomodule",
- "nonce",
- "novalidate",
- "open",
- "optimum",
- "pattern",
- "ping",
- "placeholder",
- "playsinline",
- "poster",
- "preload",
- "radiogroup",
- "readonly",
- "referrerpolicy",
- "rel",
- "required",
- "reversed",
- "rows",
- "rowspan",
- "sandbox",
- "spellcheck",
- "scope",
- "scoped",
- "seamless",
- "selected",
- "shape",
- "size",
- "sizes",
- "sortable",
- "sorted",
- "slot",
- "span",
- "spellcheck",
- "src",
- "srcdoc",
- "srclang",
- "srcset",
- "start",
- "step",
- "style",
- "tabindex",
- "target",
- "title",
- "translate",
- "type",
- "typemustmatch",
- "updateviacache",
- "usemap",
- "value",
- "width",
- "workertype",
- "wrap",
-}
-
-// "onautocomplete", "onautocompleteerror", "onmousewheel",
-// "onshow" and "onsort" have been removed from the spec,
-// but are kept here for backwards compatibility.
-var eventHandlers = []string{
- "onabort",
- "onautocomplete",
- "onautocompleteerror",
- "onauxclick",
- "onafterprint",
- "onbeforeprint",
- "onbeforeunload",
- "onblur",
- "oncancel",
- "oncanplay",
- "oncanplaythrough",
- "onchange",
- "onclick",
- "onclose",
- "oncontextmenu",
- "oncopy",
- "oncuechange",
- "oncut",
- "ondblclick",
- "ondrag",
- "ondragend",
- "ondragenter",
- "ondragexit",
- "ondragleave",
- "ondragover",
- "ondragstart",
- "ondrop",
- "ondurationchange",
- "onemptied",
- "onended",
- "onerror",
- "onfocus",
- "onhashchange",
- "oninput",
- "oninvalid",
- "onkeydown",
- "onkeypress",
- "onkeyup",
- "onlanguagechange",
- "onload",
- "onloadeddata",
- "onloadedmetadata",
- "onloadend",
- "onloadstart",
- "onmessage",
- "onmessageerror",
- "onmousedown",
- "onmouseenter",
- "onmouseleave",
- "onmousemove",
- "onmouseout",
- "onmouseover",
- "onmouseup",
- "onmousewheel",
- "onwheel",
- "onoffline",
- "ononline",
- "onpagehide",
- "onpageshow",
- "onpaste",
- "onpause",
- "onplay",
- "onplaying",
- "onpopstate",
- "onprogress",
- "onratechange",
- "onreset",
- "onresize",
- "onrejectionhandled",
- "onscroll",
- "onsecuritypolicyviolation",
- "onseeked",
- "onseeking",
- "onselect",
- "onshow",
- "onsort",
- "onstalled",
- "onstorage",
- "onsubmit",
- "onsuspend",
- "ontimeupdate",
- "ontoggle",
- "onunhandledrejection",
- "onunload",
- "onvolumechange",
- "onwaiting",
-}
-
-// extra are ad-hoc values not covered by any of the lists above.
-var extra = []string{
- "acronym",
- "align",
- "annotation",
- "annotation-xml",
- "applet",
- "basefont",
- "bgsound",
- "big",
- "blink",
- "center",
- "color",
- "desc",
- "face",
- "font",
- "foreignObject", // HTML is case-insensitive, but SVG-embedded-in-HTML is case-sensitive.
- "foreignobject",
- "frame",
- "frameset",
- "image",
- "isindex",
- "listing",
- "malignmark",
- "marquee",
- "math",
- "mglyph",
- "mi",
- "mn",
- "mo",
- "ms",
- "mtext",
- "nobr",
- "noembed",
- "noframes",
- "plaintext",
- "prompt",
- "public",
- "rb",
- "rtc",
- "spacer",
- "strike",
- "svg",
- "system",
- "tt",
- "xmp",
-}
diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go
index e3c01d7c90..ae0d1b05cd 100644
--- a/vendor/golang.org/x/net/html/token.go
+++ b/vendor/golang.org/x/net/html/token.go
@@ -347,6 +347,7 @@ loop:
break loop
}
if c != '/' {
+ z.raw.end--
continue loop
}
if z.readRawEndTag() || z.err != nil {
@@ -1067,6 +1068,11 @@ loop:
// Raw returns the unmodified text of the current token. Calling Next, Token,
// Text, TagName or TagAttr may change the contents of the returned slice.
+//
+// The token stream's raw bytes partition the byte stream (up until an
+// ErrorToken). There are no overlaps or gaps between two consecutive token's
+// raw bytes. One implication is that the byte offset of the current token is
+// the sum of the lengths of all previous tokens' raw bytes.
func (z *Tokenizer) Raw() []byte {
return z.buf[z.raw.start:z.raw.end]
}
diff --git a/vendor/golang.org/x/net/http2/hpack/encode.go b/vendor/golang.org/x/net/http2/hpack/encode.go
index 1565cf2702..97f17831fc 100644
--- a/vendor/golang.org/x/net/http2/hpack/encode.go
+++ b/vendor/golang.org/x/net/http2/hpack/encode.go
@@ -150,7 +150,7 @@ func appendIndexed(dst []byte, i uint64) []byte {
// extended buffer.
//
// If f.Sensitive is true, "Never Indexed" representation is used. If
-// f.Sensitive is false and indexing is true, "Inremental Indexing"
+// f.Sensitive is false and indexing is true, "Incremental Indexing"
// representation is used.
func appendNewName(dst []byte, f HeaderField, indexing bool) []byte {
dst = append(dst, encodeTypeByte(indexing, f.Sensitive))
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index 57334dc79b..b7524ba268 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -52,10 +52,11 @@ import (
)
const (
- prefaceTimeout = 10 * time.Second
- firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway
- handlerChunkWriteSize = 4 << 10
- defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to?
+ prefaceTimeout = 10 * time.Second
+ firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway
+ handlerChunkWriteSize = 4 << 10
+ defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to?
+ maxQueuedControlFrames = 10000
)
var (
@@ -163,6 +164,15 @@ func (s *Server) maxConcurrentStreams() uint32 {
return defaultMaxStreams
}
+// maxQueuedControlFrames is the maximum number of control frames like
+// SETTINGS, PING and RST_STREAM that will be queued for writing before
+// the connection is closed to prevent memory exhaustion attacks.
+func (s *Server) maxQueuedControlFrames() int {
+ // TODO: if anybody asks, add a Server field, and remember to define the
+ // behavior of negative values.
+ return maxQueuedControlFrames
+}
+
type serverInternalState struct {
mu sync.Mutex
activeConns map[*serverConn]struct{}
@@ -312,7 +322,7 @@ type ServeConnOpts struct {
}
func (o *ServeConnOpts) context() context.Context {
- if o.Context != nil {
+ if o != nil && o.Context != nil {
return o.Context
}
return context.Background()
@@ -506,6 +516,7 @@ type serverConn struct {
sawFirstSettings bool // got the initial SETTINGS frame after the preface
needToSendSettingsAck bool
unackedSettings int // how many SETTINGS have we sent without ACKs?
+ queuedControlFrames int // control frames in the writeSched queue
clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit)
advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client
curClientStreams uint32 // number of open streams initiated by the client
@@ -894,6 +905,14 @@ func (sc *serverConn) serve() {
}
}
+ // If the peer is causing us to generate a lot of control frames,
+ // but not reading them from us, assume they are trying to make us
+ // run out of memory.
+ if sc.queuedControlFrames > sc.srv.maxQueuedControlFrames() {
+ sc.vlogf("http2: too many control frames in send queue, closing connection")
+ return
+ }
+
// Start the shutdown timer after sending a GOAWAY. When sending GOAWAY
// with no error code (graceful shutdown), don't start the timer until
// all open streams have been completed.
@@ -1093,6 +1112,14 @@ func (sc *serverConn) writeFrame(wr FrameWriteRequest) {
}
if !ignoreWrite {
+ if wr.isControl() {
+ sc.queuedControlFrames++
+ // For extra safety, detect wraparounds, which should not happen,
+ // and pull the plug.
+ if sc.queuedControlFrames < 0 {
+ sc.conn.Close()
+ }
+ }
sc.writeSched.Push(wr)
}
sc.scheduleFrameWrite()
@@ -1210,10 +1237,8 @@ func (sc *serverConn) wroteFrame(res frameWriteResult) {
// If a frame is already being written, nothing happens. This will be called again
// when the frame is done being written.
//
-// If a frame isn't being written we need to send one, the best frame
-// to send is selected, preferring first things that aren't
-// stream-specific (e.g. ACKing settings), and then finding the
-// highest priority stream.
+// If a frame isn't being written and we need to send one, the best frame
+// to send is selected by writeSched.
//
// If a frame isn't being written and there's nothing else to send, we
// flush the write buffer.
@@ -1241,6 +1266,9 @@ func (sc *serverConn) scheduleFrameWrite() {
}
if !sc.inGoAway || sc.goAwayCode == ErrCodeNo {
if wr, ok := sc.writeSched.Pop(); ok {
+ if wr.isControl() {
+ sc.queuedControlFrames--
+ }
sc.startFrameWrite(wr)
continue
}
@@ -1533,6 +1561,8 @@ func (sc *serverConn) processSettings(f *SettingsFrame) error {
if err := f.ForeachSetting(sc.processSetting); err != nil {
return err
}
+ // TODO: judging by RFC 7540, Section 6.5.3 each SETTINGS frame should be
+ // acknowledged individually, even if multiple are received before the ACK.
sc.needToSendSettingsAck = true
sc.scheduleFrameWrite()
return nil
@@ -2494,7 +2524,7 @@ const TrailerPrefix = "Trailer:"
// trailers. That worked for a while, until we found the first major
// user of Trailers in the wild: gRPC (using them only over http2),
// and gRPC libraries permit setting trailers mid-stream without
-// predeclarnig them. So: change of plans. We still permit the old
+// predeclaring them. So: change of plans. We still permit the old
// way, but we also permit this hack: if a Header() key begins with
// "Trailer:", the suffix of that key is a Trailer. Because ':' is an
// invalid token byte anyway, there is no ambiguity. (And it's already
@@ -2794,7 +2824,7 @@ func (sc *serverConn) startPush(msg *startPushRequest) {
// PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that
// is in either the "open" or "half-closed (remote)" state.
if msg.parent.state != stateOpen && msg.parent.state != stateHalfClosedRemote {
- // responseWriter.Push checks that the stream is peer-initiaed.
+ // responseWriter.Push checks that the stream is peer-initiated.
msg.done <- errStreamClosed
return
}
diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go
index c0c80d8930..c51a73c069 100644
--- a/vendor/golang.org/x/net/http2/transport.go
+++ b/vendor/golang.org/x/net/http2/transport.go
@@ -992,7 +992,7 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf
req.Method != "HEAD" {
// Request gzip only, not deflate. Deflate is ambiguous and
// not as universally supported anyway.
- // See: http://www.gzip.org/zlib/zlib_faq.html#faq38
+ // See: https://zlib.net/zlib_faq.html#faq39
//
// Note that we don't request this for HEAD requests,
// due to a bug in nginx:
@@ -1216,6 +1216,8 @@ var (
// abort request body write, but send stream reset of cancel.
errStopReqBodyWriteAndCancel = errors.New("http2: canceling request")
+
+ errReqBodyTooLong = errors.New("http2: request body larger than specified content length")
)
func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (err error) {
@@ -1238,10 +1240,32 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (
req := cs.req
hasTrailers := req.Trailer != nil
+ remainLen := actualContentLength(req)
+ hasContentLen := remainLen != -1
var sawEOF bool
for !sawEOF {
- n, err := body.Read(buf)
+ n, err := body.Read(buf[:len(buf)-1])
+ if hasContentLen {
+ remainLen -= int64(n)
+ if remainLen == 0 && err == nil {
+ // The request body's Content-Length was predeclared and
+ // we just finished reading it all, but the underlying io.Reader
+ // returned the final chunk with a nil error (which is one of
+ // the two valid things a Reader can do at EOF). Because we'd prefer
+ // to send the END_STREAM bit early, double-check that we're actually
+ // at EOF. Subsequent reads should return (0, EOF) at this point.
+ // If either value is different, we return an error in one of two ways below.
+ var n1 int
+ n1, err = body.Read(buf[n:])
+ remainLen -= int64(n1)
+ }
+ if remainLen < 0 {
+ err = errReqBodyTooLong
+ cc.writeStreamReset(cs.ID, ErrCodeCancel, err)
+ return err
+ }
+ }
if err == io.EOF {
sawEOF = true
err = nil
diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go
index 4fe3073073..f24d2b1e7d 100644
--- a/vendor/golang.org/x/net/http2/writesched.go
+++ b/vendor/golang.org/x/net/http2/writesched.go
@@ -32,7 +32,7 @@ type WriteScheduler interface {
// Pop dequeues the next frame to write. Returns false if no frames can
// be written. Frames with a given wr.StreamID() are Pop'd in the same
- // order they are Push'd.
+ // order they are Push'd. No frames should be discarded except by CloseStream.
Pop() (wr FrameWriteRequest, ok bool)
}
@@ -76,6 +76,12 @@ func (wr FrameWriteRequest) StreamID() uint32 {
return wr.stream.id
}
+// isControl reports whether wr is a control frame for MaxQueuedControlFrames
+// purposes. That includes non-stream frames and RST_STREAM frames.
+func (wr FrameWriteRequest) isControl() bool {
+ return wr.stream == nil
+}
+
// DataSize returns the number of flow control bytes that must be consumed
// to write this entire frame. This is 0 for non-DATA frames.
func (wr FrameWriteRequest) DataSize() int {
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go
index 848fed6ec7..2618b2c11d 100644
--- a/vendor/golang.org/x/net/http2/writesched_priority.go
+++ b/vendor/golang.org/x/net/http2/writesched_priority.go
@@ -149,7 +149,7 @@ func (n *priorityNode) addBytes(b int64) {
}
// walkReadyInOrder iterates over the tree in priority order, calling f for each node
-// with a non-empty write queue. When f returns true, this funcion returns true and the
+// with a non-empty write queue. When f returns true, this function returns true and the
// walk halts. tmp is used as scratch space for sorting.
//
// f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true
diff --git a/vendor/golang.org/x/net/internal/iana/gen.go b/vendor/golang.org/x/net/internal/iana/gen.go
deleted file mode 100644
index 2a7661c27b..0000000000
--- a/vendor/golang.org/x/net/internal/iana/gen.go
+++ /dev/null
@@ -1,383 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-//go:generate go run gen.go
-
-// This program generates internet protocol constants and tables by
-// reading IANA protocol registries.
-package main
-
-import (
- "bytes"
- "encoding/xml"
- "fmt"
- "go/format"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "strconv"
- "strings"
-)
-
-var registries = []struct {
- url string
- parse func(io.Writer, io.Reader) error
-}{
- {
- "https://www.iana.org/assignments/dscp-registry/dscp-registry.xml",
- parseDSCPRegistry,
- },
- {
- "https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml",
- parseProtocolNumbers,
- },
- {
- "https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml",
- parseAddrFamilyNumbers,
- },
-}
-
-func main() {
- var bb bytes.Buffer
- fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
- fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n")
- fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n")
- for _, r := range registries {
- resp, err := http.Get(r.url)
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url)
- os.Exit(1)
- }
- if err := r.parse(&bb, resp.Body); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- fmt.Fprintf(&bb, "\n")
- }
- b, err := format.Source(bb.Bytes())
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := ioutil.WriteFile("const.go", b, 0644); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func parseDSCPRegistry(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var dr dscpRegistry
- if err := dec.Decode(&dr); err != nil {
- return err
- }
- fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, dr := range dr.escapeDSCP() {
- fmt.Fprintf(w, "DiffServ%s = %#02x", dr.Name, dr.Value)
- fmt.Fprintf(w, "// %s\n", dr.OrigName)
- }
- for _, er := range dr.escapeECN() {
- fmt.Fprintf(w, "%s = %#02x", er.Descr, er.Value)
- fmt.Fprintf(w, "// %s\n", er.OrigDescr)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type dscpRegistry struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- Note string `xml:"note"`
- Registries []struct {
- Title string `xml:"title"`
- Registries []struct {
- Title string `xml:"title"`
- Records []struct {
- Name string `xml:"name"`
- Space string `xml:"space"`
- } `xml:"record"`
- } `xml:"registry"`
- Records []struct {
- Value string `xml:"value"`
- Descr string `xml:"description"`
- } `xml:"record"`
- } `xml:"registry"`
-}
-
-type canonDSCPRecord struct {
- OrigName string
- Name string
- Value int
-}
-
-func (drr *dscpRegistry) escapeDSCP() []canonDSCPRecord {
- var drs []canonDSCPRecord
- for _, preg := range drr.Registries {
- if !strings.Contains(preg.Title, "Differentiated Services Field Codepoints") {
- continue
- }
- for _, reg := range preg.Registries {
- if !strings.Contains(reg.Title, "Pool 1 Codepoints") {
- continue
- }
- drs = make([]canonDSCPRecord, len(reg.Records))
- sr := strings.NewReplacer(
- "+", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, dr := range reg.Records {
- s := strings.TrimSpace(dr.Name)
- drs[i].OrigName = s
- drs[i].Name = sr.Replace(s)
- n, err := strconv.ParseUint(dr.Space, 2, 8)
- if err != nil {
- continue
- }
- drs[i].Value = int(n) << 2
- }
- }
- }
- return drs
-}
-
-type canonECNRecord struct {
- OrigDescr string
- Descr string
- Value int
-}
-
-func (drr *dscpRegistry) escapeECN() []canonECNRecord {
- var ers []canonECNRecord
- for _, reg := range drr.Registries {
- if !strings.Contains(reg.Title, "ECN Field") {
- continue
- }
- ers = make([]canonECNRecord, len(reg.Records))
- sr := strings.NewReplacer(
- "Capable", "",
- "Not-ECT", "",
- "ECT(1)", "",
- "ECT(0)", "",
- "CE", "",
- "(", "",
- ")", "",
- "+", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, er := range reg.Records {
- s := strings.TrimSpace(er.Descr)
- ers[i].OrigDescr = s
- ss := strings.Split(s, " ")
- if len(ss) > 1 {
- ers[i].Descr = strings.Join(ss[1:], " ")
- } else {
- ers[i].Descr = ss[0]
- }
- ers[i].Descr = sr.Replace(er.Descr)
- n, err := strconv.ParseUint(er.Value, 2, 8)
- if err != nil {
- continue
- }
- ers[i].Value = int(n)
- }
- }
- return ers
-}
-
-func parseProtocolNumbers(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var pn protocolNumbers
- if err := dec.Decode(&pn); err != nil {
- return err
- }
- prs := pn.escape()
- prs = append([]canonProtocolRecord{{
- Name: "IP",
- Descr: "IPv4 encapsulation, pseudo protocol number",
- Value: 0,
- }}, prs...)
- fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, pr := range prs {
- if pr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "Protocol%s = %d", pr.Name, pr.Value)
- s := pr.Descr
- if s == "" {
- s = pr.OrigName
- }
- fmt.Fprintf(w, "// %s\n", s)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type protocolNumbers struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- RegTitle string `xml:"registry>title"`
- Note string `xml:"registry>note"`
- Records []struct {
- Value string `xml:"value"`
- Name string `xml:"name"`
- Descr string `xml:"description"`
- } `xml:"registry>record"`
-}
-
-type canonProtocolRecord struct {
- OrigName string
- Name string
- Descr string
- Value int
-}
-
-func (pn *protocolNumbers) escape() []canonProtocolRecord {
- prs := make([]canonProtocolRecord, len(pn.Records))
- sr := strings.NewReplacer(
- "-in-", "in",
- "-within-", "within",
- "-over-", "over",
- "+", "P",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, pr := range pn.Records {
- if strings.Contains(pr.Name, "Deprecated") ||
- strings.Contains(pr.Name, "deprecated") {
- continue
- }
- prs[i].OrigName = pr.Name
- s := strings.TrimSpace(pr.Name)
- switch pr.Name {
- case "ISIS over IPv4":
- prs[i].Name = "ISIS"
- case "manet":
- prs[i].Name = "MANET"
- default:
- prs[i].Name = sr.Replace(s)
- }
- ss := strings.Split(pr.Descr, "\n")
- for i := range ss {
- ss[i] = strings.TrimSpace(ss[i])
- }
- if len(ss) > 1 {
- prs[i].Descr = strings.Join(ss, " ")
- } else {
- prs[i].Descr = ss[0]
- }
- prs[i].Value, _ = strconv.Atoi(pr.Value)
- }
- return prs
-}
-
-func parseAddrFamilyNumbers(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var afn addrFamilylNumbers
- if err := dec.Decode(&afn); err != nil {
- return err
- }
- afrs := afn.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", afn.Title, afn.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, afr := range afrs {
- if afr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "AddrFamily%s = %d", afr.Name, afr.Value)
- fmt.Fprintf(w, "// %s\n", afr.Descr)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type addrFamilylNumbers struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- RegTitle string `xml:"registry>title"`
- Note string `xml:"registry>note"`
- Records []struct {
- Value string `xml:"value"`
- Descr string `xml:"description"`
- } `xml:"registry>record"`
-}
-
-type canonAddrFamilyRecord struct {
- Name string
- Descr string
- Value int
-}
-
-func (afn *addrFamilylNumbers) escape() []canonAddrFamilyRecord {
- afrs := make([]canonAddrFamilyRecord, len(afn.Records))
- sr := strings.NewReplacer(
- "IP version 4", "IPv4",
- "IP version 6", "IPv6",
- "Identifier", "ID",
- "-", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, afr := range afn.Records {
- if strings.Contains(afr.Descr, "Unassigned") ||
- strings.Contains(afr.Descr, "Reserved") {
- continue
- }
- afrs[i].Descr = afr.Descr
- s := strings.TrimSpace(afr.Descr)
- switch s {
- case "IP (IP version 4)":
- afrs[i].Name = "IPv4"
- case "IP6 (IP version 6)":
- afrs[i].Name = "IPv6"
- case "AFI for L2VPN information":
- afrs[i].Name = "L2VPN"
- case "E.164 with NSAP format subaddress":
- afrs[i].Name = "E164withSubaddress"
- case "MT IP: Multi-Topology IP version 4":
- afrs[i].Name = "MTIPv4"
- case "MAC/24":
- afrs[i].Name = "MACFinal24bits"
- case "MAC/40":
- afrs[i].Name = "MACFinal40bits"
- case "IPv6/64":
- afrs[i].Name = "IPv6Initial64bits"
- default:
- n := strings.Index(s, "(")
- if n > 0 {
- s = s[:n]
- }
- n = strings.Index(s, ":")
- if n > 0 {
- s = s[:n]
- }
- afrs[i].Name = sr.Replace(s)
- }
- afrs[i].Value, _ = strconv.Atoi(afr.Value)
- }
- return afrs
-}
diff --git a/vendor/golang.org/x/net/internal/socket/defs_aix.go b/vendor/golang.org/x/net/internal/socket/defs_aix.go
deleted file mode 100644
index c9d05b2619..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_aix.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type mmsghdr C.struct_mmsghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofMmsghdr = C.sizeof_struct_mmsghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_darwin.go b/vendor/golang.org/x/net/internal/socket/defs_darwin.go
deleted file mode 100644
index b780bc67ab..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_darwin.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go b/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go
deleted file mode 100644
index b780bc67ab..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_freebsd.go b/vendor/golang.org/x/net/internal/socket/defs_freebsd.go
deleted file mode 100644
index b780bc67ab..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_freebsd.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_linux.go b/vendor/golang.org/x/net/internal/socket/defs_linux.go
deleted file mode 100644
index 6c5c11dcc4..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_linux.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-#include
-
-#define _GNU_SOURCE
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type mmsghdr C.struct_mmsghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofMmsghdr = C.sizeof_struct_mmsghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_netbsd.go b/vendor/golang.org/x/net/internal/socket/defs_netbsd.go
deleted file mode 100644
index 3d3b776395..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_netbsd.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type mmsghdr C.struct_mmsghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofMmsghdr = C.sizeof_struct_mmsghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_openbsd.go b/vendor/golang.org/x/net/internal/socket/defs_openbsd.go
deleted file mode 100644
index b780bc67ab..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_openbsd.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/defs_solaris.go b/vendor/golang.org/x/net/internal/socket/defs_solaris.go
deleted file mode 100644
index b780bc67ab..0000000000
--- a/vendor/golang.org/x/net/internal/socket/defs_solaris.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package socket
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-type iovec C.struct_iovec
-
-type msghdr C.struct_msghdr
-
-type cmsghdr C.struct_cmsghdr
-
-type sockaddrInet C.struct_sockaddr_in
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-const (
- sizeofIovec = C.sizeof_struct_iovec
- sizeofMsghdr = C.sizeof_struct_msghdr
- sizeofCmsghdr = C.sizeof_struct_cmsghdr
-
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
-)
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go
index 813385a98b..e740c8f024 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go
@@ -53,7 +53,6 @@ type sockaddrInet6 struct {
const (
sizeofIovec = 0x10
sizeofMsghdr = 0x30
- sizeofMmsghdr = 0x38
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go
index 72d8b25421..d33025b70d 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go
@@ -47,7 +47,6 @@ type sockaddrInet6 struct {
const (
sizeofIovec = 0x8
sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go
index 3545319ae9..b20d216774 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go
@@ -50,7 +50,6 @@ type sockaddrInet6 struct {
const (
sizeofIovec = 0x10
sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go
index 72d8b25421..1bb10a4289 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go
@@ -45,9 +45,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x8
- sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
+ sizeofIovec = 0x8
+ sizeofMsghdr = 0x1c
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go
index 72d8b25421..1bb10a4289 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go
@@ -45,9 +45,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x8
- sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
+ sizeofIovec = 0x8
+ sizeofMsghdr = 0x1c
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go
index 72d8b25421..1bb10a4289 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go
@@ -45,9 +45,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x8
- sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
+ sizeofIovec = 0x8
+ sizeofMsghdr = 0x1c
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go
index dbff234fbd..f12a1d7682 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go
@@ -49,9 +49,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go
index 3545319ae9..7f6e8a7fa4 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go
@@ -48,9 +48,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x38
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x38
+
sizeofCmsghdr = 0x10
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go
index bf8f47c88c..7e258cec29 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go
@@ -47,9 +47,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x8
- sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
+ sizeofIovec = 0x8
+ sizeofMsghdr = 0x1c
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go
index a46eff9912..b3f9c0d7e5 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go
@@ -50,9 +50,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x10
- sizeofMsghdr = 0x30
- sizeofMmsghdr = 0x40
+ sizeofIovec = 0x10
+ sizeofMsghdr = 0x30
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
index bf8f47c88c..7e258cec29 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
@@ -47,9 +47,9 @@ type sockaddrInet6 struct {
}
const (
- sizeofIovec = 0x8
- sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
+ sizeofIovec = 0x8
+ sizeofMsghdr = 0x1c
+
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go
index a46eff9912..da26ef019c 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go
@@ -52,7 +52,6 @@ type sockaddrInet6 struct {
const (
sizeofIovec = 0x10
sizeofMsghdr = 0x30
- sizeofMmsghdr = 0x40
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/ipv4/defs_aix.go b/vendor/golang.org/x/net/ipv4/defs_aix.go
deleted file mode 100644
index 0f37211c64..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_aix.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- // IP_RECVIF is defined on AIX but doesn't work.
- // IP_RECVINTERFACE must be used instead.
- sysIP_RECVIF = C.IP_RECVINTERFACE
- sysIP_RECVTTL = C.IP_RECVTTL
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
-)
-
-type ipMreq C.struct_ip_mreq
diff --git a/vendor/golang.org/x/net/ipv4/defs_darwin.go b/vendor/golang.org/x/net/ipv4/defs_darwin.go
deleted file mode 100644
index c8f2e05b81..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_darwin.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_STRIPHDR = C.IP_STRIPHDR
- sysIP_RECVTTL = C.IP_RECVTTL
- sysIP_BOUND_IF = C.IP_BOUND_IF
- sysIP_PKTINFO = C.IP_PKTINFO
- sysIP_RECVPKTINFO = C.IP_RECVPKTINFO
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
- sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF
- sysIP_MULTICAST_IFINDEX = C.IP_MULTICAST_IFINDEX
- sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP
- sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
- sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE
- sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
- sizeofIPMreqn = C.sizeof_struct_ip_mreqn
- sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet C.struct_sockaddr_in
-
-type inetPktinfo C.struct_in_pktinfo
-
-type ipMreq C.struct_ip_mreq
-
-type ipMreqn C.struct_ip_mreqn
-
-type ipMreqSource C.struct_ip_mreq_source
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
diff --git a/vendor/golang.org/x/net/ipv4/defs_dragonfly.go b/vendor/golang.org/x/net/ipv4/defs_dragonfly.go
deleted file mode 100644
index f30544ea24..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_dragonfly.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_RECVTTL = C.IP_RECVTTL
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
-)
-
-type ipMreq C.struct_ip_mreq
diff --git a/vendor/golang.org/x/net/ipv4/defs_freebsd.go b/vendor/golang.org/x/net/ipv4/defs_freebsd.go
deleted file mode 100644
index 4dd57d8653..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_freebsd.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_SENDSRCADDR = C.IP_SENDSRCADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_ONESBCAST = C.IP_ONESBCAST
- sysIP_BINDANY = C.IP_BINDANY
- sysIP_RECVTTL = C.IP_RECVTTL
- sysIP_MINTTL = C.IP_MINTTL
- sysIP_DONTFRAG = C.IP_DONTFRAG
- sysIP_RECVTOS = C.IP_RECVTOS
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
- sysIP_MULTICAST_VIF = C.IP_MULTICAST_VIF
- sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP
- sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
- sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE
- sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
- sizeofIPMreqn = C.sizeof_struct_ip_mreqn
- sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet C.struct_sockaddr_in
-
-type ipMreq C.struct_ip_mreq
-
-type ipMreqn C.struct_ip_mreqn
-
-type ipMreqSource C.struct_ip_mreq_source
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
diff --git a/vendor/golang.org/x/net/ipv4/defs_linux.go b/vendor/golang.org/x/net/ipv4/defs_linux.go
deleted file mode 100644
index beb11071ad..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_linux.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-
-#include
-#include
-#include
-#include
-#include
-*/
-import "C"
-
-const (
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_ROUTER_ALERT = C.IP_ROUTER_ALERT
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_PKTINFO = C.IP_PKTINFO
- sysIP_PKTOPTIONS = C.IP_PKTOPTIONS
- sysIP_MTU_DISCOVER = C.IP_MTU_DISCOVER
- sysIP_RECVERR = C.IP_RECVERR
- sysIP_RECVTTL = C.IP_RECVTTL
- sysIP_RECVTOS = C.IP_RECVTOS
- sysIP_MTU = C.IP_MTU
- sysIP_FREEBIND = C.IP_FREEBIND
- sysIP_TRANSPARENT = C.IP_TRANSPARENT
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_ORIGDSTADDR = C.IP_ORIGDSTADDR
- sysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR
- sysIP_MINTTL = C.IP_MINTTL
- sysIP_NODEFRAG = C.IP_NODEFRAG
- sysIP_UNICAST_IF = C.IP_UNICAST_IF
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
- sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE
- sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE
- sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP
- sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
- sysIP_MSFILTER = C.IP_MSFILTER
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
- sysMCAST_MSFILTER = C.MCAST_MSFILTER
- sysIP_MULTICAST_ALL = C.IP_MULTICAST_ALL
-
- //sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT
- //sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT
- //sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO
- //sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE
- //sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE
- //sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT
-
- sysICMP_FILTER = C.ICMP_FILTER
-
- sysSO_EE_ORIGIN_NONE = C.SO_EE_ORIGIN_NONE
- sysSO_EE_ORIGIN_LOCAL = C.SO_EE_ORIGIN_LOCAL
- sysSO_EE_ORIGIN_ICMP = C.SO_EE_ORIGIN_ICMP
- sysSO_EE_ORIGIN_ICMP6 = C.SO_EE_ORIGIN_ICMP6
- sysSO_EE_ORIGIN_TXSTATUS = C.SO_EE_ORIGIN_TXSTATUS
- sysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING
-
- sysSOL_SOCKET = C.SOL_SOCKET
- sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER
-
- sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
- sizeofSockExtendedErr = C.sizeof_struct_sock_extended_err
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
- sizeofIPMreqn = C.sizeof_struct_ip_mreqn
- sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPFilter = C.sizeof_struct_icmp_filter
-
- sizeofSockFprog = C.sizeof_struct_sock_fprog
-)
-
-type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
-
-type sockaddrInet C.struct_sockaddr_in
-
-type inetPktinfo C.struct_in_pktinfo
-
-type sockExtendedErr C.struct_sock_extended_err
-
-type ipMreq C.struct_ip_mreq
-
-type ipMreqn C.struct_ip_mreqn
-
-type ipMreqSource C.struct_ip_mreq_source
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
-
-type icmpFilter C.struct_icmp_filter
-
-type sockFProg C.struct_sock_fprog
-
-type sockFilter C.struct_sock_filter
diff --git a/vendor/golang.org/x/net/ipv4/defs_netbsd.go b/vendor/golang.org/x/net/ipv4/defs_netbsd.go
deleted file mode 100644
index 8f8af1b899..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_netbsd.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_RECVTTL = C.IP_RECVTTL
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
-)
-
-type ipMreq C.struct_ip_mreq
diff --git a/vendor/golang.org/x/net/ipv4/defs_openbsd.go b/vendor/golang.org/x/net/ipv4/defs_openbsd.go
deleted file mode 100644
index 8f8af1b899..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_openbsd.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_RECVTTL = C.IP_RECVTTL
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
-)
-
-type ipMreq C.struct_ip_mreq
diff --git a/vendor/golang.org/x/net/ipv4/defs_solaris.go b/vendor/golang.org/x/net/ipv4/defs_solaris.go
deleted file mode 100644
index aeb33e9c8f..0000000000
--- a/vendor/golang.org/x/net/ipv4/defs_solaris.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-
-package ipv4
-
-/*
-#include
-
-#include
-*/
-import "C"
-
-const (
- sysIP_OPTIONS = C.IP_OPTIONS
- sysIP_HDRINCL = C.IP_HDRINCL
- sysIP_TOS = C.IP_TOS
- sysIP_TTL = C.IP_TTL
- sysIP_RECVOPTS = C.IP_RECVOPTS
- sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
- sysIP_RECVDSTADDR = C.IP_RECVDSTADDR
- sysIP_RETOPTS = C.IP_RETOPTS
- sysIP_RECVIF = C.IP_RECVIF
- sysIP_RECVSLLA = C.IP_RECVSLLA
- sysIP_RECVTTL = C.IP_RECVTTL
-
- sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
- sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
- sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
- sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
- sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
- sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE
- sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE
- sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP
- sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
- sysIP_NEXTHOP = C.IP_NEXTHOP
-
- sysIP_PKTINFO = C.IP_PKTINFO
- sysIP_RECVPKTINFO = C.IP_RECVPKTINFO
- sysIP_DONTFRAG = C.IP_DONTFRAG
-
- sysIP_BOUND_IF = C.IP_BOUND_IF
- sysIP_UNSPEC_SRC = C.IP_UNSPEC_SRC
- sysIP_BROADCAST_TTL = C.IP_BROADCAST_TTL
- sysIP_DHCPINIT_IF = C.IP_DHCPINIT_IF
-
- sysIP_REUSEADDR = C.IP_REUSEADDR
- sysIP_DONTROUTE = C.IP_DONTROUTE
- sysIP_BROADCAST = C.IP_BROADCAST
-
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
- sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
-
- sizeofIPMreq = C.sizeof_struct_ip_mreq
- sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet C.struct_sockaddr_in
-
-type inetPktinfo C.struct_in_pktinfo
-
-type ipMreq C.struct_ip_mreq
-
-type ipMreqSource C.struct_ip_mreq_source
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
diff --git a/vendor/golang.org/x/net/ipv4/gen.go b/vendor/golang.org/x/net/ipv4/gen.go
deleted file mode 100644
index 1bb1737f67..0000000000
--- a/vendor/golang.org/x/net/ipv4/gen.go
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-//go:generate go run gen.go
-
-// This program generates system adaptation constants and types,
-// internet protocol constants and tables by reading template files
-// and IANA protocol registries.
-package main
-
-import (
- "bytes"
- "encoding/xml"
- "fmt"
- "go/format"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "os/exec"
- "runtime"
- "strconv"
- "strings"
-)
-
-func main() {
- if err := genzsys(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := geniana(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func genzsys() error {
- defs := "defs_" + runtime.GOOS + ".go"
- f, err := os.Open(defs)
- if err != nil {
- if os.IsNotExist(err) {
- return nil
- }
- return err
- }
- f.Close()
- cmd := exec.Command("go", "tool", "cgo", "-godefs", defs)
- b, err := cmd.Output()
- if err != nil {
- return err
- }
- b, err = format.Source(b)
- if err != nil {
- return err
- }
- zsys := "zsys_" + runtime.GOOS + ".go"
- switch runtime.GOOS {
- case "freebsd", "linux":
- zsys = "zsys_" + runtime.GOOS + "_" + runtime.GOARCH + ".go"
- }
- if err := ioutil.WriteFile(zsys, b, 0644); err != nil {
- return err
- }
- return nil
-}
-
-var registries = []struct {
- url string
- parse func(io.Writer, io.Reader) error
-}{
- {
- "https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml",
- parseICMPv4Parameters,
- },
-}
-
-func geniana() error {
- var bb bytes.Buffer
- fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
- fmt.Fprintf(&bb, "package ipv4\n\n")
- for _, r := range registries {
- resp, err := http.Get(r.url)
- if err != nil {
- return err
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("got HTTP status code %v for %v\n", resp.StatusCode, r.url)
- }
- if err := r.parse(&bb, resp.Body); err != nil {
- return err
- }
- fmt.Fprintf(&bb, "\n")
- }
- b, err := format.Source(bb.Bytes())
- if err != nil {
- return err
- }
- if err := ioutil.WriteFile("iana.go", b, 0644); err != nil {
- return err
- }
- return nil
-}
-
-func parseICMPv4Parameters(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var icp icmpv4Parameters
- if err := dec.Decode(&icp); err != nil {
- return err
- }
- prs := icp.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, pr := range prs {
- if pr.Descr == "" {
- continue
- }
- fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Descr, pr.Value)
- fmt.Fprintf(w, "// %s\n", pr.OrigDescr)
- }
- fmt.Fprintf(w, ")\n\n")
- fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
- fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n")
- for _, pr := range prs {
- if pr.Descr == "" {
- continue
- }
- fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigDescr))
- }
- fmt.Fprintf(w, "}\n")
- return nil
-}
-
-type icmpv4Parameters struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- Registries []struct {
- Title string `xml:"title"`
- Records []struct {
- Value string `xml:"value"`
- Descr string `xml:"description"`
- } `xml:"record"`
- } `xml:"registry"`
-}
-
-type canonICMPv4ParamRecord struct {
- OrigDescr string
- Descr string
- Value int
-}
-
-func (icp *icmpv4Parameters) escape() []canonICMPv4ParamRecord {
- id := -1
- for i, r := range icp.Registries {
- if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") {
- id = i
- break
- }
- }
- if id < 0 {
- return nil
- }
- prs := make([]canonICMPv4ParamRecord, len(icp.Registries[id].Records))
- sr := strings.NewReplacer(
- "Messages", "",
- "Message", "",
- "ICMP", "",
- "+", "P",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, pr := range icp.Registries[id].Records {
- if strings.Contains(pr.Descr, "Reserved") ||
- strings.Contains(pr.Descr, "Unassigned") ||
- strings.Contains(pr.Descr, "Deprecated") ||
- strings.Contains(pr.Descr, "Experiment") ||
- strings.Contains(pr.Descr, "experiment") {
- continue
- }
- ss := strings.Split(pr.Descr, "\n")
- if len(ss) > 1 {
- prs[i].Descr = strings.Join(ss, " ")
- } else {
- prs[i].Descr = ss[0]
- }
- s := strings.TrimSpace(prs[i].Descr)
- prs[i].OrigDescr = s
- prs[i].Descr = sr.Replace(s)
- prs[i].Value, _ = strconv.Atoi(pr.Value)
- }
- return prs
-}
diff --git a/vendor/golang.org/x/net/ipv6/defs_aix.go b/vendor/golang.org/x/net/ipv6/defs_aix.go
deleted file mode 100644
index ea396a3cb8..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_aix.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
-
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type icmpv6Filter C.struct_icmp6_filter
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
diff --git a/vendor/golang.org/x/net/ipv6/defs_darwin.go b/vendor/golang.org/x/net/ipv6/defs_darwin.go
deleted file mode 100644
index 55ddc116fc..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_darwin.go
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#define __APPLE_USE_RFC_3542
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
-
- sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
- sysICMP6_FILTER = C.ICMP6_FILTER
- sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO
- sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT
- sysIPV6_2292NEXTHOP = C.IPV6_2292NEXTHOP
- sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS
- sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS
- sysIPV6_2292RTHDR = C.IPV6_2292RTHDR
-
- sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
- sysIPV6_TCLASS = C.IPV6_TCLASS
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
-
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
-
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
-
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
-
- sysIPV6_MSFILTER = C.IPV6_MSFILTER
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
-
- sysIPV6_BOUND_IF = C.IPV6_BOUND_IF
-
- sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
- sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
- sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type icmpv6Filter C.struct_icmp6_filter
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
diff --git a/vendor/golang.org/x/net/ipv6/defs_dragonfly.go b/vendor/golang.org/x/net/ipv6/defs_dragonfly.go
deleted file mode 100644
index a4c383a515..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_dragonfly.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
- sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
-
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
-
- sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
-
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
-
- sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
- sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
- sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
-
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type icmpv6Filter C.struct_icmp6_filter
diff --git a/vendor/golang.org/x/net/ipv6/defs_freebsd.go b/vendor/golang.org/x/net/ipv6/defs_freebsd.go
deleted file mode 100644
index 53e625389a..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_freebsd.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
- sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
-
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
-
- sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
-
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sysIPV6_PREFER_TEMPADDR = C.IPV6_PREFER_TEMPADDR
-
- sysIPV6_BINDANY = C.IPV6_BINDANY
-
- sysIPV6_MSFILTER = C.IPV6_MSFILTER
-
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
-
- sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
- sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
- sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
-
-type icmpv6Filter C.struct_icmp6_filter
diff --git a/vendor/golang.org/x/net/ipv6/defs_linux.go b/vendor/golang.org/x/net/ipv6/defs_linux.go
deleted file mode 100644
index 3308cb2c38..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_linux.go
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-#include
-#include
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_ADDRFORM = C.IPV6_ADDRFORM
- sysIPV6_2292PKTINFO = C.IPV6_2292PKTINFO
- sysIPV6_2292HOPOPTS = C.IPV6_2292HOPOPTS
- sysIPV6_2292DSTOPTS = C.IPV6_2292DSTOPTS
- sysIPV6_2292RTHDR = C.IPV6_2292RTHDR
- sysIPV6_2292PKTOPTIONS = C.IPV6_2292PKTOPTIONS
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_2292HOPLIMIT = C.IPV6_2292HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_FLOWINFO = C.IPV6_FLOWINFO
-
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_ADD_MEMBERSHIP = C.IPV6_ADD_MEMBERSHIP
- sysIPV6_DROP_MEMBERSHIP = C.IPV6_DROP_MEMBERSHIP
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
- sysMCAST_MSFILTER = C.MCAST_MSFILTER
- sysIPV6_ROUTER_ALERT = C.IPV6_ROUTER_ALERT
- sysIPV6_MTU_DISCOVER = C.IPV6_MTU_DISCOVER
- sysIPV6_MTU = C.IPV6_MTU
- sysIPV6_RECVERR = C.IPV6_RECVERR
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
- sysIPV6_JOIN_ANYCAST = C.IPV6_JOIN_ANYCAST
- sysIPV6_LEAVE_ANYCAST = C.IPV6_LEAVE_ANYCAST
-
- //sysIPV6_PMTUDISC_DONT = C.IPV6_PMTUDISC_DONT
- //sysIPV6_PMTUDISC_WANT = C.IPV6_PMTUDISC_WANT
- //sysIPV6_PMTUDISC_DO = C.IPV6_PMTUDISC_DO
- //sysIPV6_PMTUDISC_PROBE = C.IPV6_PMTUDISC_PROBE
- //sysIPV6_PMTUDISC_INTERFACE = C.IPV6_PMTUDISC_INTERFACE
- //sysIPV6_PMTUDISC_OMIT = C.IPV6_PMTUDISC_OMIT
-
- sysIPV6_FLOWLABEL_MGR = C.IPV6_FLOWLABEL_MGR
- sysIPV6_FLOWINFO_SEND = C.IPV6_FLOWINFO_SEND
-
- sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
- sysIPV6_XFRM_POLICY = C.IPV6_XFRM_POLICY
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RTHDR = C.IPV6_RTHDR
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
- sysIPV6_TCLASS = C.IPV6_TCLASS
-
- sysIPV6_ADDR_PREFERENCES = C.IPV6_ADDR_PREFERENCES
-
- sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP
- sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC
- sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = C.IPV6_PREFER_SRC_PUBTMP_DEFAULT
- sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA
- sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME
- sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA
- sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA
-
- sysIPV6_MINHOPCOUNT = C.IPV6_MINHOPCOUNT
-
- sysIPV6_ORIGDSTADDR = C.IPV6_ORIGDSTADDR
- sysIPV6_RECVORIGDSTADDR = C.IPV6_RECVORIGDSTADDR
- sysIPV6_TRANSPARENT = C.IPV6_TRANSPARENT
- sysIPV6_UNICAST_IF = C.IPV6_UNICAST_IF
-
- sysICMPV6_FILTER = C.ICMPV6_FILTER
-
- sysICMPV6_FILTER_BLOCK = C.ICMPV6_FILTER_BLOCK
- sysICMPV6_FILTER_PASS = C.ICMPV6_FILTER_PASS
- sysICMPV6_FILTER_BLOCKOTHERS = C.ICMPV6_FILTER_BLOCKOTHERS
- sysICMPV6_FILTER_PASSONLY = C.ICMPV6_FILTER_PASSONLY
-
- sysSOL_SOCKET = C.SOL_SOCKET
- sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER
-
- sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
- sizeofIPv6FlowlabelReq = C.sizeof_struct_in6_flowlabel_req
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-
- sizeofSockFprog = C.sizeof_struct_sock_fprog
-)
-
-type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6FlowlabelReq C.struct_in6_flowlabel_req
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
-
-type icmpv6Filter C.struct_icmp6_filter
-
-type sockFProg C.struct_sock_fprog
-
-type sockFilter C.struct_sock_filter
diff --git a/vendor/golang.org/x/net/ipv6/defs_netbsd.go b/vendor/golang.org/x/net/ipv6/defs_netbsd.go
deleted file mode 100644
index be9ceb9cc0..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_netbsd.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
- sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_IPSEC_POLICY = C.IPV6_IPSEC_POLICY
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
-
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
-
- sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
- sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
- sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
-
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type icmpv6Filter C.struct_icmp6_filter
diff --git a/vendor/golang.org/x/net/ipv6/defs_openbsd.go b/vendor/golang.org/x/net/ipv6/defs_openbsd.go
deleted file mode 100644
index 177ddf87d2..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_openbsd.go
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
- sysIPV6_PORTRANGE = C.IPV6_PORTRANGE
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
-
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
- sysIPV6_RTHDR = C.IPV6_RTHDR
-
- sysIPV6_AUTH_LEVEL = C.IPV6_AUTH_LEVEL
- sysIPV6_ESP_TRANS_LEVEL = C.IPV6_ESP_TRANS_LEVEL
- sysIPV6_ESP_NETWORK_LEVEL = C.IPV6_ESP_NETWORK_LEVEL
- sysIPSEC6_OUTSA = C.IPSEC6_OUTSA
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
-
- sysIPV6_AUTOFLOWLABEL = C.IPV6_AUTOFLOWLABEL
- sysIPV6_IPCOMP_LEVEL = C.IPV6_IPCOMP_LEVEL
-
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
- sysIPV6_PIPEX = C.IPV6_PIPEX
-
- sysIPV6_RTABLE = C.IPV6_RTABLE
-
- sysIPV6_PORTRANGE_DEFAULT = C.IPV6_PORTRANGE_DEFAULT
- sysIPV6_PORTRANGE_HIGH = C.IPV6_PORTRANGE_HIGH
- sysIPV6_PORTRANGE_LOW = C.IPV6_PORTRANGE_LOW
-
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type icmpv6Filter C.struct_icmp6_filter
diff --git a/vendor/golang.org/x/net/ipv6/defs_solaris.go b/vendor/golang.org/x/net/ipv6/defs_solaris.go
deleted file mode 100644
index 0f8ce2b46a..0000000000
--- a/vendor/golang.org/x/net/ipv6/defs_solaris.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package ipv6
-
-/*
-#include
-
-#include
-#include
-*/
-import "C"
-
-const (
- sysIPV6_UNICAST_HOPS = C.IPV6_UNICAST_HOPS
- sysIPV6_MULTICAST_IF = C.IPV6_MULTICAST_IF
- sysIPV6_MULTICAST_HOPS = C.IPV6_MULTICAST_HOPS
- sysIPV6_MULTICAST_LOOP = C.IPV6_MULTICAST_LOOP
- sysIPV6_JOIN_GROUP = C.IPV6_JOIN_GROUP
- sysIPV6_LEAVE_GROUP = C.IPV6_LEAVE_GROUP
-
- sysIPV6_PKTINFO = C.IPV6_PKTINFO
-
- sysIPV6_HOPLIMIT = C.IPV6_HOPLIMIT
- sysIPV6_NEXTHOP = C.IPV6_NEXTHOP
- sysIPV6_HOPOPTS = C.IPV6_HOPOPTS
- sysIPV6_DSTOPTS = C.IPV6_DSTOPTS
-
- sysIPV6_RTHDR = C.IPV6_RTHDR
- sysIPV6_RTHDRDSTOPTS = C.IPV6_RTHDRDSTOPTS
-
- sysIPV6_RECVPKTINFO = C.IPV6_RECVPKTINFO
- sysIPV6_RECVHOPLIMIT = C.IPV6_RECVHOPLIMIT
- sysIPV6_RECVHOPOPTS = C.IPV6_RECVHOPOPTS
-
- sysIPV6_RECVRTHDR = C.IPV6_RECVRTHDR
-
- sysIPV6_RECVRTHDRDSTOPTS = C.IPV6_RECVRTHDRDSTOPTS
-
- sysIPV6_CHECKSUM = C.IPV6_CHECKSUM
- sysIPV6_RECVTCLASS = C.IPV6_RECVTCLASS
- sysIPV6_USE_MIN_MTU = C.IPV6_USE_MIN_MTU
- sysIPV6_DONTFRAG = C.IPV6_DONTFRAG
- sysIPV6_SEC_OPT = C.IPV6_SEC_OPT
- sysIPV6_SRC_PREFERENCES = C.IPV6_SRC_PREFERENCES
- sysIPV6_RECVPATHMTU = C.IPV6_RECVPATHMTU
- sysIPV6_PATHMTU = C.IPV6_PATHMTU
- sysIPV6_TCLASS = C.IPV6_TCLASS
- sysIPV6_V6ONLY = C.IPV6_V6ONLY
-
- sysIPV6_RECVDSTOPTS = C.IPV6_RECVDSTOPTS
-
- sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
- sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
- sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
- sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
- sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
- sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
-
- sysIPV6_PREFER_SRC_HOME = C.IPV6_PREFER_SRC_HOME
- sysIPV6_PREFER_SRC_COA = C.IPV6_PREFER_SRC_COA
- sysIPV6_PREFER_SRC_PUBLIC = C.IPV6_PREFER_SRC_PUBLIC
- sysIPV6_PREFER_SRC_TMP = C.IPV6_PREFER_SRC_TMP
- sysIPV6_PREFER_SRC_NONCGA = C.IPV6_PREFER_SRC_NONCGA
- sysIPV6_PREFER_SRC_CGA = C.IPV6_PREFER_SRC_CGA
-
- sysIPV6_PREFER_SRC_MIPMASK = C.IPV6_PREFER_SRC_MIPMASK
- sysIPV6_PREFER_SRC_MIPDEFAULT = C.IPV6_PREFER_SRC_MIPDEFAULT
- sysIPV6_PREFER_SRC_TMPMASK = C.IPV6_PREFER_SRC_TMPMASK
- sysIPV6_PREFER_SRC_TMPDEFAULT = C.IPV6_PREFER_SRC_TMPDEFAULT
- sysIPV6_PREFER_SRC_CGAMASK = C.IPV6_PREFER_SRC_CGAMASK
- sysIPV6_PREFER_SRC_CGADEFAULT = C.IPV6_PREFER_SRC_CGADEFAULT
-
- sysIPV6_PREFER_SRC_MASK = C.IPV6_PREFER_SRC_MASK
-
- sysIPV6_PREFER_SRC_DEFAULT = C.IPV6_PREFER_SRC_DEFAULT
-
- sysIPV6_BOUND_IF = C.IPV6_BOUND_IF
- sysIPV6_UNSPEC_SRC = C.IPV6_UNSPEC_SRC
-
- sysICMP6_FILTER = C.ICMP6_FILTER
-
- sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
- sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- sizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- sizeofIPv6Mtuinfo = C.sizeof_struct_ip6_mtuinfo
-
- sizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- sizeofGroupReq = C.sizeof_struct_group_req
- sizeofGroupSourceReq = C.sizeof_struct_group_source_req
-
- sizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-type sockaddrStorage C.struct_sockaddr_storage
-
-type sockaddrInet6 C.struct_sockaddr_in6
-
-type inet6Pktinfo C.struct_in6_pktinfo
-
-type ipv6Mtuinfo C.struct_ip6_mtuinfo
-
-type ipv6Mreq C.struct_ipv6_mreq
-
-type groupReq C.struct_group_req
-
-type groupSourceReq C.struct_group_source_req
-
-type icmpv6Filter C.struct_icmp6_filter
diff --git a/vendor/golang.org/x/net/ipv6/gen.go b/vendor/golang.org/x/net/ipv6/gen.go
deleted file mode 100644
index 5885664fbc..0000000000
--- a/vendor/golang.org/x/net/ipv6/gen.go
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-//go:generate go run gen.go
-
-// This program generates system adaptation constants and types,
-// internet protocol constants and tables by reading template files
-// and IANA protocol registries.
-package main
-
-import (
- "bytes"
- "encoding/xml"
- "fmt"
- "go/format"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "os/exec"
- "runtime"
- "strconv"
- "strings"
-)
-
-func main() {
- if err := genzsys(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
- if err := geniana(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func genzsys() error {
- defs := "defs_" + runtime.GOOS + ".go"
- f, err := os.Open(defs)
- if err != nil {
- if os.IsNotExist(err) {
- return nil
- }
- return err
- }
- f.Close()
- cmd := exec.Command("go", "tool", "cgo", "-godefs", defs)
- b, err := cmd.Output()
- if err != nil {
- return err
- }
- b, err = format.Source(b)
- if err != nil {
- return err
- }
- zsys := "zsys_" + runtime.GOOS + ".go"
- switch runtime.GOOS {
- case "freebsd", "linux":
- zsys = "zsys_" + runtime.GOOS + "_" + runtime.GOARCH + ".go"
- }
- if err := ioutil.WriteFile(zsys, b, 0644); err != nil {
- return err
- }
- return nil
-}
-
-var registries = []struct {
- url string
- parse func(io.Writer, io.Reader) error
-}{
- {
- "https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml",
- parseICMPv6Parameters,
- },
-}
-
-func geniana() error {
- var bb bytes.Buffer
- fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
- fmt.Fprintf(&bb, "package ipv6\n\n")
- for _, r := range registries {
- resp, err := http.Get(r.url)
- if err != nil {
- return err
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("got HTTP status code %v for %v\n", resp.StatusCode, r.url)
- }
- if err := r.parse(&bb, resp.Body); err != nil {
- return err
- }
- fmt.Fprintf(&bb, "\n")
- }
- b, err := format.Source(bb.Bytes())
- if err != nil {
- return err
- }
- if err := ioutil.WriteFile("iana.go", b, 0644); err != nil {
- return err
- }
- return nil
-}
-
-func parseICMPv6Parameters(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var icp icmpv6Parameters
- if err := dec.Decode(&icp); err != nil {
- return err
- }
- prs := icp.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, pr := range prs {
- if pr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Name, pr.Value)
- fmt.Fprintf(w, "// %s\n", pr.OrigName)
- }
- fmt.Fprintf(w, ")\n\n")
- fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated)
- fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n")
- for _, pr := range prs {
- if pr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigName))
- }
- fmt.Fprintf(w, "}\n")
- return nil
-}
-
-type icmpv6Parameters struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- Registries []struct {
- Title string `xml:"title"`
- Records []struct {
- Value string `xml:"value"`
- Name string `xml:"name"`
- } `xml:"record"`
- } `xml:"registry"`
-}
-
-type canonICMPv6ParamRecord struct {
- OrigName string
- Name string
- Value int
-}
-
-func (icp *icmpv6Parameters) escape() []canonICMPv6ParamRecord {
- id := -1
- for i, r := range icp.Registries {
- if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") {
- id = i
- break
- }
- }
- if id < 0 {
- return nil
- }
- prs := make([]canonICMPv6ParamRecord, len(icp.Registries[id].Records))
- sr := strings.NewReplacer(
- "Messages", "",
- "Message", "",
- "ICMP", "",
- "+", "P",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, pr := range icp.Registries[id].Records {
- if strings.Contains(pr.Name, "Reserved") ||
- strings.Contains(pr.Name, "Unassigned") ||
- strings.Contains(pr.Name, "Deprecated") ||
- strings.Contains(pr.Name, "Experiment") ||
- strings.Contains(pr.Name, "experiment") {
- continue
- }
- ss := strings.Split(pr.Name, "\n")
- if len(ss) > 1 {
- prs[i].Name = strings.Join(ss, " ")
- } else {
- prs[i].Name = ss[0]
- }
- s := strings.TrimSpace(prs[i].Name)
- prs[i].OrigName = s
- prs[i].Name = sr.Replace(s)
- prs[i].Value, _ = strconv.Atoi(pr.Value)
- }
- return prs
-}
diff --git a/vendor/golang.org/x/net/publicsuffix/gen.go b/vendor/golang.org/x/net/publicsuffix/gen.go
deleted file mode 100644
index 372ffbb24c..0000000000
--- a/vendor/golang.org/x/net/publicsuffix/gen.go
+++ /dev/null
@@ -1,717 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-// This program generates table.go and table_test.go based on the authoritative
-// public suffix list at https://publicsuffix.org/list/effective_tld_names.dat
-//
-// The version is derived from
-// https://api.github.com/repos/publicsuffix/list/commits?path=public_suffix_list.dat
-// and a human-readable form is at
-// https://github.com/publicsuffix/list/commits/master/public_suffix_list.dat
-//
-// To fetch a particular git revision, such as 5c70ccd250, pass
-// -url "https://raw.githubusercontent.com/publicsuffix/list/5c70ccd250/public_suffix_list.dat"
-// and -version "an explicit version string".
-
-import (
- "bufio"
- "bytes"
- "flag"
- "fmt"
- "go/format"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "regexp"
- "sort"
- "strings"
-
- "golang.org/x/net/idna"
-)
-
-const (
- // These sum of these four values must be no greater than 32.
- nodesBitsChildren = 10
- nodesBitsICANN = 1
- nodesBitsTextOffset = 15
- nodesBitsTextLength = 6
-
- // These sum of these four values must be no greater than 32.
- childrenBitsWildcard = 1
- childrenBitsNodeType = 2
- childrenBitsHi = 14
- childrenBitsLo = 14
-)
-
-var (
- maxChildren int
- maxTextOffset int
- maxTextLength int
- maxHi uint32
- maxLo uint32
-)
-
-func max(a, b int) int {
- if a < b {
- return b
- }
- return a
-}
-
-func u32max(a, b uint32) uint32 {
- if a < b {
- return b
- }
- return a
-}
-
-const (
- nodeTypeNormal = 0
- nodeTypeException = 1
- nodeTypeParentOnly = 2
- numNodeType = 3
-)
-
-func nodeTypeStr(n int) string {
- switch n {
- case nodeTypeNormal:
- return "+"
- case nodeTypeException:
- return "!"
- case nodeTypeParentOnly:
- return "o"
- }
- panic("unreachable")
-}
-
-const (
- defaultURL = "https://publicsuffix.org/list/effective_tld_names.dat"
- gitCommitURL = "https://api.github.com/repos/publicsuffix/list/commits?path=public_suffix_list.dat"
-)
-
-var (
- labelEncoding = map[string]uint32{}
- labelsList = []string{}
- labelsMap = map[string]bool{}
- rules = []string{}
- numICANNRules = 0
-
- // validSuffixRE is used to check that the entries in the public suffix
- // list are in canonical form (after Punycode encoding). Specifically,
- // capital letters are not allowed.
- validSuffixRE = regexp.MustCompile(`^[a-z0-9_\!\*\-\.]+$`)
-
- shaRE = regexp.MustCompile(`"sha":"([^"]+)"`)
- dateRE = regexp.MustCompile(`"committer":{[^{]+"date":"([^"]+)"`)
-
- comments = flag.Bool("comments", false, "generate table.go comments, for debugging")
- subset = flag.Bool("subset", false, "generate only a subset of the full table, for debugging")
- url = flag.String("url", defaultURL, "URL of the publicsuffix.org list. If empty, stdin is read instead")
- v = flag.Bool("v", false, "verbose output (to stderr)")
- version = flag.String("version", "", "the effective_tld_names.dat version")
-)
-
-func main() {
- if err := main1(); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-}
-
-func main1() error {
- flag.Parse()
- if nodesBitsTextLength+nodesBitsTextOffset+nodesBitsICANN+nodesBitsChildren > 32 {
- return fmt.Errorf("not enough bits to encode the nodes table")
- }
- if childrenBitsLo+childrenBitsHi+childrenBitsNodeType+childrenBitsWildcard > 32 {
- return fmt.Errorf("not enough bits to encode the children table")
- }
- if *version == "" {
- if *url != defaultURL {
- return fmt.Errorf("-version was not specified, and the -url is not the default one")
- }
- sha, date, err := gitCommit()
- if err != nil {
- return err
- }
- *version = fmt.Sprintf("publicsuffix.org's public_suffix_list.dat, git revision %s (%s)", sha, date)
- }
- var r io.Reader = os.Stdin
- if *url != "" {
- res, err := http.Get(*url)
- if err != nil {
- return err
- }
- if res.StatusCode != http.StatusOK {
- return fmt.Errorf("bad GET status for %s: %d", *url, res.Status)
- }
- r = res.Body
- defer res.Body.Close()
- }
-
- var root node
- icann := false
- br := bufio.NewReader(r)
- for {
- s, err := br.ReadString('\n')
- if err != nil {
- if err == io.EOF {
- break
- }
- return err
- }
- s = strings.TrimSpace(s)
- if strings.Contains(s, "BEGIN ICANN DOMAINS") {
- if len(rules) != 0 {
- return fmt.Errorf(`expected no rules before "BEGIN ICANN DOMAINS"`)
- }
- icann = true
- continue
- }
- if strings.Contains(s, "END ICANN DOMAINS") {
- icann, numICANNRules = false, len(rules)
- continue
- }
- if s == "" || strings.HasPrefix(s, "//") {
- continue
- }
- s, err = idna.ToASCII(s)
- if err != nil {
- return err
- }
- if !validSuffixRE.MatchString(s) {
- return fmt.Errorf("bad publicsuffix.org list data: %q", s)
- }
-
- if *subset {
- switch {
- case s == "ac.jp" || strings.HasSuffix(s, ".ac.jp"):
- case s == "ak.us" || strings.HasSuffix(s, ".ak.us"):
- case s == "ao" || strings.HasSuffix(s, ".ao"):
- case s == "ar" || strings.HasSuffix(s, ".ar"):
- case s == "arpa" || strings.HasSuffix(s, ".arpa"):
- case s == "cy" || strings.HasSuffix(s, ".cy"):
- case s == "dyndns.org" || strings.HasSuffix(s, ".dyndns.org"):
- case s == "jp":
- case s == "kobe.jp" || strings.HasSuffix(s, ".kobe.jp"):
- case s == "kyoto.jp" || strings.HasSuffix(s, ".kyoto.jp"):
- case s == "om" || strings.HasSuffix(s, ".om"):
- case s == "uk" || strings.HasSuffix(s, ".uk"):
- case s == "uk.com" || strings.HasSuffix(s, ".uk.com"):
- case s == "tw" || strings.HasSuffix(s, ".tw"):
- case s == "zw" || strings.HasSuffix(s, ".zw"):
- case s == "xn--p1ai" || strings.HasSuffix(s, ".xn--p1ai"):
- // xn--p1ai is Russian-Cyrillic "рф".
- default:
- continue
- }
- }
-
- rules = append(rules, s)
-
- nt, wildcard := nodeTypeNormal, false
- switch {
- case strings.HasPrefix(s, "*."):
- s, nt = s[2:], nodeTypeParentOnly
- wildcard = true
- case strings.HasPrefix(s, "!"):
- s, nt = s[1:], nodeTypeException
- }
- labels := strings.Split(s, ".")
- for n, i := &root, len(labels)-1; i >= 0; i-- {
- label := labels[i]
- n = n.child(label)
- if i == 0 {
- if nt != nodeTypeParentOnly && n.nodeType == nodeTypeParentOnly {
- n.nodeType = nt
- }
- n.icann = n.icann && icann
- n.wildcard = n.wildcard || wildcard
- }
- labelsMap[label] = true
- }
- }
- labelsList = make([]string, 0, len(labelsMap))
- for label := range labelsMap {
- labelsList = append(labelsList, label)
- }
- sort.Strings(labelsList)
-
- if err := generate(printReal, &root, "table.go"); err != nil {
- return err
- }
- if err := generate(printTest, &root, "table_test.go"); err != nil {
- return err
- }
- return nil
-}
-
-func generate(p func(io.Writer, *node) error, root *node, filename string) error {
- buf := new(bytes.Buffer)
- if err := p(buf, root); err != nil {
- return err
- }
- b, err := format.Source(buf.Bytes())
- if err != nil {
- return err
- }
- return ioutil.WriteFile(filename, b, 0644)
-}
-
-func gitCommit() (sha, date string, retErr error) {
- res, err := http.Get(gitCommitURL)
- if err != nil {
- return "", "", err
- }
- if res.StatusCode != http.StatusOK {
- return "", "", fmt.Errorf("bad GET status for %s: %d", gitCommitURL, res.Status)
- }
- defer res.Body.Close()
- b, err := ioutil.ReadAll(res.Body)
- if err != nil {
- return "", "", err
- }
- if m := shaRE.FindSubmatch(b); m != nil {
- sha = string(m[1])
- }
- if m := dateRE.FindSubmatch(b); m != nil {
- date = string(m[1])
- }
- if sha == "" || date == "" {
- retErr = fmt.Errorf("could not find commit SHA and date in %s", gitCommitURL)
- }
- return sha, date, retErr
-}
-
-func printTest(w io.Writer, n *node) error {
- fmt.Fprintf(w, "// generated by go run gen.go; DO NOT EDIT\n\n")
- fmt.Fprintf(w, "package publicsuffix\n\nconst numICANNRules = %d\n\nvar rules = [...]string{\n", numICANNRules)
- for _, rule := range rules {
- fmt.Fprintf(w, "%q,\n", rule)
- }
- fmt.Fprintf(w, "}\n\nvar nodeLabels = [...]string{\n")
- if err := n.walk(w, printNodeLabel); err != nil {
- return err
- }
- fmt.Fprintf(w, "}\n")
- return nil
-}
-
-func printReal(w io.Writer, n *node) error {
- const header = `// generated by go run gen.go; DO NOT EDIT
-
-package publicsuffix
-
-const version = %q
-
-const (
- nodesBitsChildren = %d
- nodesBitsICANN = %d
- nodesBitsTextOffset = %d
- nodesBitsTextLength = %d
-
- childrenBitsWildcard = %d
- childrenBitsNodeType = %d
- childrenBitsHi = %d
- childrenBitsLo = %d
-)
-
-const (
- nodeTypeNormal = %d
- nodeTypeException = %d
- nodeTypeParentOnly = %d
-)
-
-// numTLD is the number of top level domains.
-const numTLD = %d
-
-`
- fmt.Fprintf(w, header, *version,
- nodesBitsChildren, nodesBitsICANN, nodesBitsTextOffset, nodesBitsTextLength,
- childrenBitsWildcard, childrenBitsNodeType, childrenBitsHi, childrenBitsLo,
- nodeTypeNormal, nodeTypeException, nodeTypeParentOnly, len(n.children))
-
- text := combineText(labelsList)
- if text == "" {
- return fmt.Errorf("internal error: makeText returned no text")
- }
- for _, label := range labelsList {
- offset, length := strings.Index(text, label), len(label)
- if offset < 0 {
- return fmt.Errorf("internal error: could not find %q in text %q", label, text)
- }
- maxTextOffset, maxTextLength = max(maxTextOffset, offset), max(maxTextLength, length)
- if offset >= 1<= 1< 64 {
- n, plus = 64, " +"
- }
- fmt.Fprintf(w, "%q%s\n", text[:n], plus)
- text = text[n:]
- }
-
- if err := n.walk(w, assignIndexes); err != nil {
- return err
- }
-
- fmt.Fprintf(w, `
-
-// nodes is the list of nodes. Each node is represented as a uint32, which
-// encodes the node's children, wildcard bit and node type (as an index into
-// the children array), ICANN bit and text.
-//
-// If the table was generated with the -comments flag, there is a //-comment
-// after each node's data. In it is the nodes-array indexes of the children,
-// formatted as (n0x1234-n0x1256), with * denoting the wildcard bit. The
-// nodeType is printed as + for normal, ! for exception, and o for parent-only
-// nodes that have children but don't match a domain label in their own right.
-// An I denotes an ICANN domain.
-//
-// The layout within the uint32, from MSB to LSB, is:
-// [%2d bits] unused
-// [%2d bits] children index
-// [%2d bits] ICANN bit
-// [%2d bits] text index
-// [%2d bits] text length
-var nodes = [...]uint32{
-`,
- 32-nodesBitsChildren-nodesBitsICANN-nodesBitsTextOffset-nodesBitsTextLength,
- nodesBitsChildren, nodesBitsICANN, nodesBitsTextOffset, nodesBitsTextLength)
- if err := n.walk(w, printNode); err != nil {
- return err
- }
- fmt.Fprintf(w, `}
-
-// children is the list of nodes' children, the parent's wildcard bit and the
-// parent's node type. If a node has no children then their children index
-// will be in the range [0, 6), depending on the wildcard bit and node type.
-//
-// The layout within the uint32, from MSB to LSB, is:
-// [%2d bits] unused
-// [%2d bits] wildcard bit
-// [%2d bits] node type
-// [%2d bits] high nodes index (exclusive) of children
-// [%2d bits] low nodes index (inclusive) of children
-var children=[...]uint32{
-`,
- 32-childrenBitsWildcard-childrenBitsNodeType-childrenBitsHi-childrenBitsLo,
- childrenBitsWildcard, childrenBitsNodeType, childrenBitsHi, childrenBitsLo)
- for i, c := range childrenEncoding {
- s := "---------------"
- lo := c & (1<> childrenBitsLo) & (1<>(childrenBitsLo+childrenBitsHi)) & (1<>(childrenBitsLo+childrenBitsHi+childrenBitsNodeType) != 0
- if *comments {
- fmt.Fprintf(w, "0x%08x, // c0x%04x (%s)%s %s\n",
- c, i, s, wildcardStr(wildcard), nodeTypeStr(nodeType))
- } else {
- fmt.Fprintf(w, "0x%x,\n", c)
- }
- }
- fmt.Fprintf(w, "}\n\n")
- fmt.Fprintf(w, "// max children %d (capacity %d)\n", maxChildren, 1<= 1<= 1<= 1< 0 && ss[0] == "" {
- ss = ss[1:]
- }
- return ss
-}
-
-// crush combines a list of strings, taking advantage of overlaps. It returns a
-// single string that contains each input string as a substring.
-func crush(ss []string) string {
- maxLabelLen := 0
- for _, s := range ss {
- if maxLabelLen < len(s) {
- maxLabelLen = len(s)
- }
- }
-
- for prefixLen := maxLabelLen; prefixLen > 0; prefixLen-- {
- prefixes := makePrefixMap(ss, prefixLen)
- for i, s := range ss {
- if len(s) <= prefixLen {
- continue
- }
- mergeLabel(ss, i, prefixLen, prefixes)
- }
- }
-
- return strings.Join(ss, "")
-}
-
-// mergeLabel merges the label at ss[i] with the first available matching label
-// in prefixMap, where the last "prefixLen" characters in ss[i] match the first
-// "prefixLen" characters in the matching label.
-// It will merge ss[i] repeatedly until no more matches are available.
-// All matching labels merged into ss[i] are replaced by "".
-func mergeLabel(ss []string, i, prefixLen int, prefixes prefixMap) {
- s := ss[i]
- suffix := s[len(s)-prefixLen:]
- for _, j := range prefixes[suffix] {
- // Empty strings mean "already used." Also avoid merging with self.
- if ss[j] == "" || i == j {
- continue
- }
- if *v {
- fmt.Fprintf(os.Stderr, "%d-length overlap at (%4d,%4d): %q and %q share %q\n",
- prefixLen, i, j, ss[i], ss[j], suffix)
- }
- ss[i] += ss[j][prefixLen:]
- ss[j] = ""
- // ss[i] has a new suffix, so merge again if possible.
- // Note: we only have to merge again at the same prefix length. Shorter
- // prefix lengths will be handled in the next iteration of crush's for loop.
- // Can there be matches for longer prefix lengths, introduced by the merge?
- // I believe that any such matches would by necessity have been eliminated
- // during substring removal or merged at a higher prefix length. For
- // instance, in crush("abc", "cde", "bcdef"), combining "abc" and "cde"
- // would yield "abcde", which could be merged with "bcdef." However, in
- // practice "cde" would already have been elimintated by removeSubstrings.
- mergeLabel(ss, i, prefixLen, prefixes)
- return
- }
-}
-
-// prefixMap maps from a prefix to a list of strings containing that prefix. The
-// list of strings is represented as indexes into a slice of strings stored
-// elsewhere.
-type prefixMap map[string][]int
-
-// makePrefixMap constructs a prefixMap from a slice of strings.
-func makePrefixMap(ss []string, prefixLen int) prefixMap {
- prefixes := make(prefixMap)
- for i, s := range ss {
- // We use < rather than <= because if a label matches on a prefix equal to
- // its full length, that's actually a substring match handled by
- // removeSubstrings.
- if prefixLen < len(s) {
- prefix := s[:prefixLen]
- prefixes[prefix] = append(prefixes[prefix], i)
- }
- }
-
- return prefixes
-}
diff --git a/vendor/golang.org/x/sys/cpu/byteorder.go b/vendor/golang.org/x/sys/cpu/byteorder.go
index da6b9e4363..ed8da8deac 100644
--- a/vendor/golang.org/x/sys/cpu/byteorder.go
+++ b/vendor/golang.org/x/sys/cpu/byteorder.go
@@ -5,26 +5,56 @@
package cpu
import (
- "encoding/binary"
"runtime"
)
+// byteOrder is a subset of encoding/binary.ByteOrder.
+type byteOrder interface {
+ Uint32([]byte) uint32
+ Uint64([]byte) uint64
+}
+
+type littleEndian struct{}
+type bigEndian struct{}
+
+func (littleEndian) Uint32(b []byte) uint32 {
+ _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+}
+
+func (littleEndian) Uint64(b []byte) uint64 {
+ _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
+ uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+}
+
+func (bigEndian) Uint32(b []byte) uint32 {
+ _ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24
+}
+
+func (bigEndian) Uint64(b []byte) uint64 {
+ _ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
+ return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
+ uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
+}
+
// hostByteOrder returns binary.LittleEndian on little-endian machines and
// binary.BigEndian on big-endian machines.
-func hostByteOrder() binary.ByteOrder {
+func hostByteOrder() byteOrder {
switch runtime.GOARCH {
case "386", "amd64", "amd64p32",
"arm", "arm64",
"mipsle", "mips64le", "mips64p32le",
"ppc64le",
"riscv", "riscv64":
- return binary.LittleEndian
+ return littleEndian{}
case "armbe", "arm64be",
"mips", "mips64", "mips64p32",
"ppc", "ppc64",
"s390", "s390x",
"sparc", "sparc64":
- return binary.BigEndian
+ return bigEndian{}
}
panic("unknown architecture")
}
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
index 679e78c2ce..b4e6ecb2dc 100644
--- a/vendor/golang.org/x/sys/cpu/cpu.go
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -78,6 +78,42 @@ var ARM64 struct {
_ CacheLinePad
}
+// ARM contains the supported CPU features of the current ARM (32-bit) platform.
+// All feature flags are false if:
+// 1. the current platform is not arm, or
+// 2. the current operating system is not Linux.
+var ARM struct {
+ _ CacheLinePad
+ HasSWP bool // SWP instruction support
+ HasHALF bool // Half-word load and store support
+ HasTHUMB bool // ARM Thumb instruction set
+ Has26BIT bool // Address space limited to 26-bits
+ HasFASTMUL bool // 32-bit operand, 64-bit result multiplication support
+ HasFPA bool // Floating point arithmetic support
+ HasVFP bool // Vector floating point support
+ HasEDSP bool // DSP Extensions support
+ HasJAVA bool // Java instruction set
+ HasIWMMXT bool // Intel Wireless MMX technology support
+ HasCRUNCH bool // MaverickCrunch context switching and handling
+ HasTHUMBEE bool // Thumb EE instruction set
+ HasNEON bool // NEON instruction set
+ HasVFPv3 bool // Vector floating point version 3 support
+ HasVFPv3D16 bool // Vector floating point version 3 D8-D15
+ HasTLS bool // Thread local storage support
+ HasVFPv4 bool // Vector floating point version 4 support
+ HasIDIVA bool // Integer divide instruction support in ARM mode
+ HasIDIVT bool // Integer divide instruction support in Thumb mode
+ HasVFPD32 bool // Vector floating point version 3 D15-D31
+ HasLPAE bool // Large Physical Address Extensions
+ HasEVTSTRM bool // Event stream support
+ HasAES bool // AES hardware implementation
+ HasPMULL bool // Polynomial multiplication instruction set
+ HasSHA1 bool // SHA1 hardware implementation
+ HasSHA2 bool // SHA2 hardware implementation
+ HasCRC32 bool // CRC32 hardware implementation
+ _ CacheLinePad
+}
+
// PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms.
// If the current platform is not ppc64/ppc64le then all feature flags are false.
//
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm.go b/vendor/golang.org/x/sys/cpu/cpu_arm.go
index 7f2348b7d4..981af6818c 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_arm.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm.go
@@ -6,4 +6,35 @@ package cpu
const cacheLineSize = 32
-func doinit() {}
+// HWCAP/HWCAP2 bits.
+// These are specific to Linux.
+const (
+ hwcap_SWP = 1 << 0
+ hwcap_HALF = 1 << 1
+ hwcap_THUMB = 1 << 2
+ hwcap_26BIT = 1 << 3
+ hwcap_FAST_MULT = 1 << 4
+ hwcap_FPA = 1 << 5
+ hwcap_VFP = 1 << 6
+ hwcap_EDSP = 1 << 7
+ hwcap_JAVA = 1 << 8
+ hwcap_IWMMXT = 1 << 9
+ hwcap_CRUNCH = 1 << 10
+ hwcap_THUMBEE = 1 << 11
+ hwcap_NEON = 1 << 12
+ hwcap_VFPv3 = 1 << 13
+ hwcap_VFPv3D16 = 1 << 14
+ hwcap_TLS = 1 << 15
+ hwcap_VFPv4 = 1 << 16
+ hwcap_IDIVA = 1 << 17
+ hwcap_IDIVT = 1 << 18
+ hwcap_VFPD32 = 1 << 19
+ hwcap_LPAE = 1 << 20
+ hwcap_EVTSTRM = 1 << 21
+
+ hwcap2_AES = 1 << 0
+ hwcap2_PMULL = 1 << 1
+ hwcap2_SHA1 = 1 << 2
+ hwcap2_SHA2 = 1 << 3
+ hwcap2_CRC32 = 1 << 4
+)
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go
index 76b5f507fa..10e712dc5d 100644
--- a/vendor/golang.org/x/sys/cpu/cpu_linux.go
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//+build !amd64,!amd64p32,!386
+// +build !amd64,!amd64p32,!386
package cpu
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go
new file mode 100644
index 0000000000..2057006dce
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm.go
@@ -0,0 +1,39 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+func doinit() {
+ ARM.HasSWP = isSet(hwCap, hwcap_SWP)
+ ARM.HasHALF = isSet(hwCap, hwcap_HALF)
+ ARM.HasTHUMB = isSet(hwCap, hwcap_THUMB)
+ ARM.Has26BIT = isSet(hwCap, hwcap_26BIT)
+ ARM.HasFASTMUL = isSet(hwCap, hwcap_FAST_MULT)
+ ARM.HasFPA = isSet(hwCap, hwcap_FPA)
+ ARM.HasVFP = isSet(hwCap, hwcap_VFP)
+ ARM.HasEDSP = isSet(hwCap, hwcap_EDSP)
+ ARM.HasJAVA = isSet(hwCap, hwcap_JAVA)
+ ARM.HasIWMMXT = isSet(hwCap, hwcap_IWMMXT)
+ ARM.HasCRUNCH = isSet(hwCap, hwcap_CRUNCH)
+ ARM.HasTHUMBEE = isSet(hwCap, hwcap_THUMBEE)
+ ARM.HasNEON = isSet(hwCap, hwcap_NEON)
+ ARM.HasVFPv3 = isSet(hwCap, hwcap_VFPv3)
+ ARM.HasVFPv3D16 = isSet(hwCap, hwcap_VFPv3D16)
+ ARM.HasTLS = isSet(hwCap, hwcap_TLS)
+ ARM.HasVFPv4 = isSet(hwCap, hwcap_VFPv4)
+ ARM.HasIDIVA = isSet(hwCap, hwcap_IDIVA)
+ ARM.HasIDIVT = isSet(hwCap, hwcap_IDIVT)
+ ARM.HasVFPD32 = isSet(hwCap, hwcap_VFPD32)
+ ARM.HasLPAE = isSet(hwCap, hwcap_LPAE)
+ ARM.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM)
+ ARM.HasAES = isSet(hwCap2, hwcap2_AES)
+ ARM.HasPMULL = isSet(hwCap2, hwcap2_PMULL)
+ ARM.HasSHA1 = isSet(hwCap2, hwcap2_SHA1)
+ ARM.HasSHA2 = isSet(hwCap2, hwcap2_SHA2)
+ ARM.HasCRC32 = isSet(hwCap2, hwcap2_CRC32)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go
index 72afe3338c..6e5c81acd0 100644
--- a/vendor/golang.org/x/sys/unix/affinity_linux.go
+++ b/vendor/golang.org/x/sys/unix/affinity_linux.go
@@ -7,6 +7,7 @@
package unix
import (
+ "math/bits"
"unsafe"
)
@@ -79,46 +80,7 @@ func (s *CPUSet) IsSet(cpu int) bool {
func (s *CPUSet) Count() int {
c := 0
for _, b := range s {
- c += onesCount64(uint64(b))
+ c += bits.OnesCount64(uint64(b))
}
return c
}
-
-// onesCount64 is a copy of Go 1.9's math/bits.OnesCount64.
-// Once this package can require Go 1.9, we can delete this
-// and update the caller to use bits.OnesCount64.
-func onesCount64(x uint64) int {
- const m0 = 0x5555555555555555 // 01010101 ...
- const m1 = 0x3333333333333333 // 00110011 ...
- const m2 = 0x0f0f0f0f0f0f0f0f // 00001111 ...
- const m3 = 0x00ff00ff00ff00ff // etc.
- const m4 = 0x0000ffff0000ffff
-
- // Implementation: Parallel summing of adjacent bits.
- // See "Hacker's Delight", Chap. 5: Counting Bits.
- // The following pattern shows the general approach:
- //
- // x = x>>1&(m0&m) + x&(m0&m)
- // x = x>>2&(m1&m) + x&(m1&m)
- // x = x>>4&(m2&m) + x&(m2&m)
- // x = x>>8&(m3&m) + x&(m3&m)
- // x = x>>16&(m4&m) + x&(m4&m)
- // x = x>>32&(m5&m) + x&(m5&m)
- // return int(x)
- //
- // Masking (& operations) can be left away when there's no
- // danger that a field's sum will carry over into the next
- // field: Since the result cannot be > 64, 8 bits is enough
- // and we can ignore the masks for the shifts by 8 and up.
- // Per "Hacker's Delight", the first line can be simplified
- // more, but it saves at best one instruction, so we leave
- // it alone for clarity.
- const m = 1<<64 - 1
- x = x>>1&(m0&m) + x&(m0&m)
- x = x>>2&(m1&m) + x&(m1&m)
- x = (x>>4 + x) & (m2 & m)
- x += x >> 8
- x += x >> 16
- x += x >> 32
- return int(x) & (1<<7 - 1)
-}
diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go
index 6f3460e69c..304016b688 100644
--- a/vendor/golang.org/x/sys/unix/dirent.go
+++ b/vendor/golang.org/x/sys/unix/dirent.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package unix
diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go
index 085df2d8dd..bcdb5d30eb 100644
--- a/vendor/golang.org/x/sys/unix/endian_little.go
+++ b/vendor/golang.org/x/sys/unix/endian_little.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
-// +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le
+// +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64
package unix
diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go
index f121a8d64b..3559e5dcb2 100644
--- a/vendor/golang.org/x/sys/unix/ioctl.go
+++ b/vendor/golang.org/x/sys/unix/ioctl.go
@@ -6,7 +6,19 @@
package unix
-import "runtime"
+import (
+ "runtime"
+ "unsafe"
+)
+
+// ioctl itself should not be exposed directly, but additional get/set
+// functions for specific types are permissible.
+
+// IoctlSetInt performs an ioctl operation which sets an integer value
+// on fd, using the specified request number.
+func IoctlSetInt(fd int, req uint, value int) error {
+ return ioctl(fd, req, uintptr(value))
+}
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
//
@@ -14,7 +26,7 @@ import "runtime"
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
// TODO: if we get the chance, remove the req parameter and
// hardcode TIOCSWINSZ.
- err := ioctlSetWinsize(fd, req, value)
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(value)))
runtime.KeepAlive(value)
return err
}
@@ -24,7 +36,30 @@ func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
// The req value will usually be TCSETA or TIOCSETA.
func IoctlSetTermios(fd int, req uint, value *Termios) error {
// TODO: if we get the chance, remove the req parameter.
- err := ioctlSetTermios(fd, req, value)
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(value)))
runtime.KeepAlive(value)
return err
}
+
+// IoctlGetInt performs an ioctl operation which gets an integer value
+// from fd, using the specified request number.
+//
+// A few ioctl requests use the return value as an output parameter;
+// for those, IoctlRetInt should be used instead of this function.
+func IoctlGetInt(fd int, req uint) (int, error) {
+ var value int
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
+ return value, err
+}
+
+func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
+ var value Winsize
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
+ return &value, err
+}
+
+func IoctlGetTermios(fd int, req uint) (*Termios, error) {
+ var value Termios
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
+ return &value, err
+}
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
index 5a22eca967..890ec464c7 100644
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/vendor/golang.org/x/sys/unix/mkall.sh
@@ -212,9 +212,11 @@ esac
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
elif [ "$GOOS" == "darwin" ]; then
# pre-1.12, direct syscalls
- echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go";
+ echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos syscall_darwin_${GOARCH}.1_11.go $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go";
# 1.12 and later, syscalls via libSystem
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
+ # 1.13 and later, syscalls via libSystem (including syscallPtr)
+ echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go";
else
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
fi
diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go
deleted file mode 100644
index 4548b993db..0000000000
--- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go.
-//This program must be run after mksyscall.go.
-package main
-
-import (
- "bytes"
- "fmt"
- "io/ioutil"
- "log"
- "os"
- "strings"
-)
-
-func main() {
- in1, err := ioutil.ReadFile("syscall_darwin.go")
- if err != nil {
- log.Fatalf("can't open syscall_darwin.go: %s", err)
- }
- arch := os.Args[1]
- in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
- if err != nil {
- log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
- }
- in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
- if err != nil {
- log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
- }
- in := string(in1) + string(in2) + string(in3)
-
- trampolines := map[string]bool{}
-
- var out bytes.Buffer
-
- fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " "))
- fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
- fmt.Fprintf(&out, "\n")
- fmt.Fprintf(&out, "// +build go1.12\n")
- fmt.Fprintf(&out, "\n")
- fmt.Fprintf(&out, "#include \"textflag.h\"\n")
- for _, line := range strings.Split(in, "\n") {
- if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") {
- continue
- }
- fn := line[5 : len(line)-13]
- if !trampolines[fn] {
- trampolines[fn] = true
- fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn)
- fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn)
- }
- }
- err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
- if err != nil {
- log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err)
- }
-}
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 14624b9531..67b84828ac 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -60,6 +60,7 @@ includes_Darwin='
#include
#include
#include
+#include
#include
#include
#include
@@ -80,6 +81,7 @@ includes_Darwin='
includes_DragonFly='
#include
#include
+#include
#include
#include
#include
@@ -103,6 +105,7 @@ includes_FreeBSD='
#include
#include
#include
+#include
#include
#include
#include
@@ -179,24 +182,31 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
#include
+#include
#include
+#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
+#include
#include
#include
#include
#include
#include
#include
-#include
-#include
-#include
-#include
-#include
+#include
#include
#include
#include
@@ -206,26 +216,23 @@ struct ltchars {
#include
#include
#include
+#include
#include
+#include
#include
#include
+#include
#include
-#include
#include
#include
-#include
-#include
-#include
#include
-#include
-#include
+#include
#include
-#include
+#include
+#include
+#include
#include
-#include
-#include
-#include
-#include
+
#include
#include
@@ -264,6 +271,11 @@ struct ltchars {
#define FS_KEY_DESC_PREFIX "fscrypt:"
#define FS_KEY_DESC_PREFIX_SIZE 8
#define FS_MAX_KEY_SIZE 64
+
+// The code generator produces -0x1 for (~0), but an unsigned value is necessary
+// for the tipc_subscr timeout __u32 field.
+#undef TIPC_WAIT_FOREVER
+#define TIPC_WAIT_FOREVER 0xffffffff
'
includes_NetBSD='
@@ -273,6 +285,7 @@ includes_NetBSD='
#include
#include
#include
+#include
#include
#include
#include
@@ -299,6 +312,7 @@ includes_OpenBSD='
#include
#include
#include
+#include
#include
#include
#include
@@ -335,6 +349,7 @@ includes_OpenBSD='
includes_SunOS='
#include
#include
+#include
#include
#include
#include
@@ -427,6 +442,7 @@ ccflags="$@"
$2 == "XCASE" ||
$2 == "ALTWERASE" ||
$2 == "NOKERNINFO" ||
+ $2 == "NFDBITS" ||
$2 ~ /^PAR/ ||
$2 ~ /^SIG[^_]/ ||
$2 ~ /^O[CNPFPL][A-Z]+[^_][A-Z]+$/ ||
@@ -451,6 +467,7 @@ ccflags="$@"
$2 ~ /^SYSCTL_VERS/ ||
$2 !~ "MNT_BITS" &&
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
+ $2 ~ /^NS_GET_/ ||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
$2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ ||
$2 ~ /^KEXEC_/ ||
@@ -506,6 +523,7 @@ ccflags="$@"
$2 ~ /^XDP_/ ||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
$2 ~ /^CRYPTO_/ ||
+ $2 ~ /^TIPC_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ ||
$2 ~/^PPPIOC/ ||
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go
deleted file mode 100644
index eb4332059a..0000000000
--- a/vendor/golang.org/x/sys/unix/mkpost.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// mkpost processes the output of cgo -godefs to
-// modify the generated types. It is used to clean up
-// the sys API in an architecture specific manner.
-//
-// mkpost is run after cgo -godefs; see README.md.
-package main
-
-import (
- "bytes"
- "fmt"
- "go/format"
- "io/ioutil"
- "log"
- "os"
- "regexp"
-)
-
-func main() {
- // Get the OS and architecture (using GOARCH_TARGET if it exists)
- goos := os.Getenv("GOOS")
- goarch := os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check that we are using the Docker-based build system if we should be.
- if goos == "linux" {
- if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n")
- os.Stderr.WriteString("See README.md\n")
- os.Exit(1)
- }
- }
-
- b, err := ioutil.ReadAll(os.Stdin)
- if err != nil {
- log.Fatal(err)
- }
-
- if goos == "aix" {
- // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t
- // to avoid having both StTimespec and Timespec.
- sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`)
- b = sttimespec.ReplaceAll(b, []byte("Timespec"))
- }
-
- // Intentionally export __val fields in Fsid and Sigset_t
- valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`)
- b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}"))
-
- // Intentionally export __fds_bits field in FdSet
- fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)
- b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}"))
-
- // If we have empty Ptrace structs, we should delete them. Only s390x emits
- // nonempty Ptrace structs.
- ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
- b = ptraceRexexp.ReplaceAll(b, nil)
-
- // Replace the control_regs union with a blank identifier for now.
- controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
- b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
-
- // Remove fields that are added by glibc
- // Note that this is unstable as the identifers are private.
- removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
- b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Convert [65]int8 to [65]byte in Utsname members to simplify
- // conversion to string; see golang.org/issue/20753
- convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
- b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
-
- // Convert [1024]int8 to [1024]byte in Ptmget members
- convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`)
- b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte"))
-
- // Remove spare fields (e.g. in Statx_t)
- spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
- b = spareFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove cgo padding fields
- removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
- b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove padding, hidden, or unused fields
- removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`)
- b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove the first line of warning from cgo
- b = b[bytes.IndexByte(b, '\n')+1:]
- // Modify the command in the header to include:
- // mkpost, our own warning, and a build tag.
- replacement := fmt.Sprintf(`$1 | go run mkpost.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s,%s`, goarch, goos)
- cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
- b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
-
- // Rename Stat_t time fields
- if goos == "freebsd" && goarch == "386" {
- // Hide Stat_t.[AMCB]tim_ext fields
- renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`)
- b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_"))
- }
- renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`)
- b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}"))
-
- // gofmt
- b, err = format.Source(b)
- if err != nil {
- log.Fatal(err)
- }
-
- os.Stdout.Write(b)
-}
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go
deleted file mode 100644
index e4af9424e9..0000000000
--- a/vendor/golang.org/x/sys/unix/mksyscall.go
+++ /dev/null
@@ -1,407 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_darwin.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named errno.
-
-A line beginning with //sysnb is like //sys, except that the
-goroutine will not be suspended during the execution of the system
-call. This must only be used for system calls which can never
-block, as otherwise the system call could cause all goroutines to
-hang.
-*/
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- plan9 = flag.Bool("plan9", false, "plan9")
- openbsd = flag.Bool("openbsd", false, "openbsd")
- netbsd = flag.Bool("netbsd", false, "netbsd")
- dragonfly = flag.Bool("dragonfly", false, "dragonfly")
- arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair
- tags = flag.String("tags", "", "build tags")
- filename = flag.String("output", "", "output file name (standard output if omitted)")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- // Get the OS and architecture (using GOARCH_TARGET if it exists)
- goos := os.Getenv("GOOS")
- if goos == "" {
- fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
- os.Exit(1)
- }
- goarch := os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
-
- // Check that we are using the Docker-based build system if we should
- if goos == "linux" {
- if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n")
- fmt.Fprintf(os.Stderr, "See README.md\n")
- os.Exit(1)
- }
- }
-
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- libc := false
- if goos == "darwin" && strings.Contains(buildTags(), ",go1.12") {
- libc = true
- }
- trampolines := map[string]bool{}
-
- text := ""
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- t = strings.TrimSpace(t)
- t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
- nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, errno error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, sysname := f[2], f[3], f[4], f[5]
-
- // ClockGettime doesn't have a syscall number on Darwin, only generate libc wrappers.
- if goos == "darwin" && !libc && funct == "ClockGettime" {
- continue
- }
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // Go function header.
- outDecl := ""
- if len(out) > 0 {
- outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", "))
- }
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl)
-
- // Check if err return available
- errvar := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- break
- }
- }
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name)
- text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass dummy pointer in that case.
- // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).
- text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n)
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name)
- text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n)
- args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
- n++
- } else if p.Type == "int64" && (*openbsd || *netbsd) {
- args = append(args, "0")
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if p.Type == "int64" && *dragonfly {
- if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil {
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" {
- if len(args)%2 == 1 && *arm {
- // arm abi specifies 64-bit argument uses
- // (even, odd) pair
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- }
-
- // Determine which form to use; pad args with zeros.
- asm := "Syscall"
- if nonblock != nil {
- if errvar == "" && goos == "linux" {
- asm = "RawSyscallNoError"
- } else {
- asm = "RawSyscall"
- }
- } else {
- if errvar == "" && goos == "linux" {
- asm = "SyscallNoError"
- }
- }
- if len(args) <= 3 {
- for len(args) < 3 {
- args = append(args, "0")
- }
- } else if len(args) <= 6 {
- asm += "6"
- for len(args) < 6 {
- args = append(args, "0")
- }
- } else if len(args) <= 9 {
- asm += "9"
- for len(args) < 9 {
- args = append(args, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct)
- }
-
- // System call number.
- if sysname == "" {
- sysname = "SYS_" + funct
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToUpper(sysname)
- }
-
- var libcFn string
- if libc {
- asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call
- sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_
- sysname = strings.ToLower(sysname) // lowercase
- if sysname == "getdirentries64" {
- // Special case - libSystem name and
- // raw syscall name don't match.
- sysname = "__getdirentries64"
- }
- libcFn = sysname
- sysname = "funcPC(libc_" + sysname + "_trampoline)"
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist)
-
- // Assign return values.
- body := ""
- ret := []string{"_", "_", "_"}
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" && !*plan9 {
- reg = "e1"
- ret[2] = reg
- doErrno = true
- } else if p.Name == "err" && *plan9 {
- ret[0] = "r0"
- ret[2] = "e1"
- break
- } else {
- reg = fmt.Sprintf("r%d", i)
- ret[i] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%s != 0", reg)
- }
- if p.Type == "int64" && endianness != "" {
- // 64-bit number in r1:r0 or r0:r1.
- if i+2 > len(out) {
- fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct)
- }
- if endianness == "big-endian" {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
- } else {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
- }
- ret[i] = fmt.Sprintf("r%d", i)
- ret[i+1] = fmt.Sprintf("r%d", i+1)
- }
- if reg != "e1" || *plan9 {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
- text += fmt.Sprintf("\t%s\n", call)
- } else {
- if errvar == "" && goos == "linux" {
- // raw syscall without error on Linux, see golang.org/issue/22924
- text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call)
- } else {
- text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
- }
- }
- text += body
-
- if *plan9 && ret[2] == "e1" {
- text += "\tif int32(r0) == -1 {\n"
- text += "\t\terr = e1\n"
- text += "\t}\n"
- } else if doErrno {
- text += "\tif e1 != 0 {\n"
- text += "\t\terr = errnoErr(e1)\n"
- text += "\t}\n"
- }
- text += "\treturn\n"
- text += "}\n\n"
-
- if libc && !trampolines[libcFn] {
- // some system calls share a trampoline, like read and readlen.
- trampolines[libcFn] = true
- // Declare assembly trampoline.
- text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn)
- // Assembly trampoline calls the libc_* function, which this magic
- // redirects to use the function from libSystem.
- text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn)
- text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn)
- text += "\n"
- }
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- fmt.Printf(srcTemplate, cmdLine(), buildTags(), text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go
deleted file mode 100644
index 3be3cdfc3b..0000000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_aix.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-*/
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- aix = flag.Bool("aix", false, "aix")
- tags = flag.String("tags", "", "build tags")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- text := ""
- cExtern := "/*\n#include \n#include \n"
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- t = strings.TrimSpace(t)
- t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // Check if value return, err return available
- errvar := ""
- retvar := ""
- rettype := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- } else {
- retvar = p.Name
- rettype = p.Type
- }
- }
-
- // System call name.
- if sysname == "" {
- sysname = funct
- }
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- cRettype := ""
- if rettype == "unsafe.Pointer" {
- cRettype = "uintptr_t"
- } else if rettype == "uintptr" {
- cRettype = "uintptr_t"
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil {
- cRettype = "uintptr_t"
- } else if rettype == "int" {
- cRettype = "int"
- } else if rettype == "int32" {
- cRettype = "int"
- } else if rettype == "int64" {
- cRettype = "long long"
- } else if rettype == "uint32" {
- cRettype = "unsigned int"
- } else if rettype == "uint64" {
- cRettype = "unsigned long long"
- } else {
- cRettype = "int"
- }
- if sysname == "exit" {
- cRettype = "void"
- }
-
- // Change p.Types to c
- var cIn []string
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "string" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t", "size_t")
- } else if p.Type == "unsafe.Pointer" {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "uintptr" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "int" {
- cIn = append(cIn, "int")
- } else if p.Type == "int32" {
- cIn = append(cIn, "int")
- } else if p.Type == "int64" {
- cIn = append(cIn, "long long")
- } else if p.Type == "uint32" {
- cIn = append(cIn, "unsigned int")
- } else if p.Type == "uint64" {
- cIn = append(cIn, "unsigned long long")
- } else {
- cIn = append(cIn, "int")
- }
- }
-
- if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" {
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- cExtern += "#define c_select select\n"
- }
- // Imports of system calls from libc
- cExtern += fmt.Sprintf("%s %s", cRettype, sysname)
- cIn := strings.Join(cIn, ", ")
- cExtern += fmt.Sprintf("(%s);\n", cIn)
- }
-
- // So file name.
- if *aix {
- if modname == "" {
- modname = "libc.a/shr_64.o"
- } else {
- fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct)
- os.Exit(1)
- }
- }
-
- strconvfunc := "C.CString"
-
- // Go function header.
- if outps != "" {
- outps = fmt.Sprintf(" (%s)", outps)
- }
- if text != "" {
- text += "\n"
- }
-
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps)
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- argN := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1])
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n))
- n++
- text += fmt.Sprintf("\tvar _p%d int\n", n)
- text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name)
- args = append(args, fmt.Sprintf("C.size_t(_p%d)", n))
- n++
- } else if p.Type == "int64" && endianness != "" {
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- n++
- } else if p.Type == "bool" {
- text += fmt.Sprintf("\tvar _p%d uint32\n", n)
- text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
- args = append(args, fmt.Sprintf("_p%d", n))
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
- } else if p.Type == "unsafe.Pointer" {
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
- } else if p.Type == "int" {
- if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) {
- args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name))
- } else if argN == 0 && funct == "fcntl" {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- }
- } else if p.Type == "int32" {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- } else if p.Type == "int64" {
- args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name))
- } else if p.Type == "uint32" {
- args = append(args, fmt.Sprintf("C.uint(%s)", p.Name))
- } else if p.Type == "uint64" {
- args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name))
- } else if p.Type == "uintptr" {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- }
- argN++
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := ""
- if sysname == "exit" {
- if errvar != "" {
- call += "er :="
- } else {
- call += ""
- }
- } else if errvar != "" {
- call += "r0,er :="
- } else if retvar != "" {
- call += "r0,_ :="
- } else {
- call += ""
- }
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist)
- } else {
- call += fmt.Sprintf("C.%s(%s)", sysname, arglist)
- }
-
- // Assign return values.
- body := ""
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- } else {
- reg = "r0"
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
-
- // verify return
- if sysname != "exit" && errvar != "" {
- if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil {
- body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- } else {
- body += "\tif (r0 ==-1 && er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- }
- } else if errvar != "" {
- body += "\tif (er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- }
-
- text += fmt.Sprintf("\t%s\n", call)
- text += body
-
- text += "\treturn\n"
- text += "}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
-
- }
- fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package %s
-
-
-%s
-*/
-import "C"
-import (
- "unsafe"
-)
-
-
-%s
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go
deleted file mode 100644
index c960099517..0000000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go
+++ /dev/null
@@ -1,614 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_aix.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-
-
-This program will generate three files and handle both gc and gccgo implementation:
- - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation)
- - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6
- - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type.
-
- The generated code looks like this
-
-zsyscall_aix_ppc64.go
-func asyscall(...) (n int, err error) {
- // Pointer Creation
- r1, e1 := callasyscall(...)
- // Type Conversion
- // Error Handler
- return
-}
-
-zsyscall_aix_ppc64_gc.go
-//go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o"
-//go:linkname libc_asyscall libc_asyscall
-var asyscall syscallFunc
-
-func callasyscall(...) (r1 uintptr, e1 Errno) {
- r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... )
- return
-}
-
-zsyscall_aix_ppc64_ggcgo.go
-
-// int asyscall(...)
-
-import "C"
-
-func callasyscall(...) (r1 uintptr, e1 Errno) {
- r1 = uintptr(C.asyscall(...))
- e1 = syscall.GetErrno()
- return
-}
-*/
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "io/ioutil"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- aix = flag.Bool("aix", false, "aix")
- tags = flag.String("tags", "", "build tags")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- // GCCGO
- textgccgo := ""
- cExtern := "/*\n#include \n"
- // GC
- textgc := ""
- dynimports := ""
- linknames := ""
- var vars []string
- // COMMON
- textcommon := ""
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- t = strings.TrimSpace(t)
- t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- if sysname == "" {
- sysname = funct
- }
-
- onlyCommon := false
- if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" {
- // This function call another syscall which is already implemented.
- // Therefore, the gc and gccgo part must not be generated.
- onlyCommon = true
- }
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
-
- textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- if !onlyCommon {
- textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- }
-
- // Check if value return, err return available
- errvar := ""
- rettype := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- } else {
- rettype = p.Type
- }
- }
-
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- // GCCGO Prototype return type
- cRettype := ""
- if rettype == "unsafe.Pointer" {
- cRettype = "uintptr_t"
- } else if rettype == "uintptr" {
- cRettype = "uintptr_t"
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil {
- cRettype = "uintptr_t"
- } else if rettype == "int" {
- cRettype = "int"
- } else if rettype == "int32" {
- cRettype = "int"
- } else if rettype == "int64" {
- cRettype = "long long"
- } else if rettype == "uint32" {
- cRettype = "unsigned int"
- } else if rettype == "uint64" {
- cRettype = "unsigned long long"
- } else {
- cRettype = "int"
- }
- if sysname == "exit" {
- cRettype = "void"
- }
-
- // GCCGO Prototype arguments type
- var cIn []string
- for i, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "string" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t", "size_t")
- } else if p.Type == "unsafe.Pointer" {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "uintptr" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "int" {
- if (i == 0 || i == 2) && funct == "fcntl" {
- // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock
- cIn = append(cIn, "uintptr_t")
- } else {
- cIn = append(cIn, "int")
- }
-
- } else if p.Type == "int32" {
- cIn = append(cIn, "int")
- } else if p.Type == "int64" {
- cIn = append(cIn, "long long")
- } else if p.Type == "uint32" {
- cIn = append(cIn, "unsigned int")
- } else if p.Type == "uint64" {
- cIn = append(cIn, "unsigned long long")
- } else {
- cIn = append(cIn, "int")
- }
- }
-
- if !onlyCommon {
- // GCCGO Prototype Generation
- // Imports of system calls from libc
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- cExtern += "#define c_select select\n"
- }
- cExtern += fmt.Sprintf("%s %s", cRettype, sysname)
- cIn := strings.Join(cIn, ", ")
- cExtern += fmt.Sprintf("(%s);\n", cIn)
- }
- // GC Library name
- if modname == "" {
- modname = "libc.a/shr_64.o"
- } else {
- fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct)
- os.Exit(1)
- }
- sysvarname := fmt.Sprintf("libc_%s", sysname)
-
- if !onlyCommon {
- // GC Runtime import of function to allow cross-platform builds.
- dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname)
- // GC Link symbol to proc address variable.
- linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname)
- // GC Library proc address variable.
- vars = append(vars, sysvarname)
- }
-
- strconvfunc := "BytePtrFromString"
- strconvtype := "*byte"
-
- // Go function header.
- if outps != "" {
- outps = fmt.Sprintf(" (%s)", outps)
- }
- if textcommon != "" {
- textcommon += "\n"
- }
-
- textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps)
-
- // Prepare arguments tocall.
- var argscommon []string // Arguments in the common part
- var argscall []string // Arguments for call prototype
- var argsgc []string // Arguments for gc call (with syscall6)
- var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall)
- n := 0
- argN := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if p.Type == "string" && errvar != "" {
- textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
-
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
-
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1])
- textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n))
- n++
- } else if p.Type == "int64" && endianness != "" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n")
- } else if p.Type == "bool" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" {
- argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if p.Type == "int" {
- if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) {
- // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock
- argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
-
- } else {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- }
- } else if p.Type == "int32" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int32", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- } else if p.Type == "int64" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int64", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name))
- } else if p.Type == "uint32" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name))
- } else if p.Type == "uint64" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name))
- } else if p.Type == "uintptr" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s int", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- }
- argN++
- }
- nargs := len(argsgc)
-
- // COMMON function generation
- argscommonlist := strings.Join(argscommon, ", ")
- callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist)
- ret := []string{"_", "_"}
- body := ""
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- ret[1] = reg
- doErrno = true
- } else {
- reg = "r0"
- ret[0] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%s != 0", reg)
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" {
- textcommon += fmt.Sprintf("\t%s\n", callcommon)
- } else {
- textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon)
- }
- textcommon += body
-
- if doErrno {
- textcommon += "\tif e1 != 0 {\n"
- textcommon += "\t\terr = errnoErr(e1)\n"
- textcommon += "\t}\n"
- }
- textcommon += "\treturn\n"
- textcommon += "}\n"
-
- if onlyCommon {
- continue
- }
-
- // CALL Prototype
- callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", "))
-
- // GC function generation
- asm := "syscall6"
- if nonblock != nil {
- asm = "rawSyscall6"
- }
-
- if len(argsgc) <= 6 {
- for len(argsgc) < 6 {
- argsgc = append(argsgc, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct)
- os.Exit(1)
- }
- argsgclist := strings.Join(argsgc, ", ")
- callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist)
-
- textgc += callProto
- textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc)
- textgc += "\treturn\n}\n"
-
- // GCCGO function generation
- argsgccgolist := strings.Join(argsgccgo, ", ")
- var callgccgo string
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist)
- } else {
- callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist)
- }
- textgccgo += callProto
- textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo)
- textgccgo += "\te1 = syscall.GetErrno()\n"
- textgccgo += "\treturn\n}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
-
- }
-
- // Print zsyscall_aix_ppc64.go
- err := ioutil.WriteFile("zsyscall_aix_ppc64.go",
- []byte(fmt.Sprintf(srcTemplate1, cmdLine(), buildTags(), pack, imp, textcommon)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-
- // Print zsyscall_aix_ppc64_gc.go
- vardecls := "\t" + strings.Join(vars, ",\n\t")
- vardecls += " syscallFunc"
- err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go",
- []byte(fmt.Sprintf(srcTemplate2, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, textgc)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-
- // Print zsyscall_aix_ppc64_gccgo.go
- err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go",
- []byte(fmt.Sprintf(srcTemplate3, cmdLine(), buildTags(), pack, cExtern, imp, textgccgo)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-}
-
-const srcTemplate1 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package %s
-
-import (
- "unsafe"
-)
-
-
-%s
-
-%s
-`
-const srcTemplate2 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-// +build !gccgo
-
-package %s
-
-import (
- "unsafe"
-)
-%s
-%s
-%s
-type syscallFunc uintptr
-
-var (
-%s
-)
-
-// Implemented in runtime/syscall_aix.go.
-func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-
-%s
-`
-const srcTemplate3 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-// +build gccgo
-
-package %s
-
-%s
-*/
-import "C"
-import (
- "syscall"
-)
-
-
-%s
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go
deleted file mode 100644
index 3d864738b6..0000000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go
+++ /dev/null
@@ -1,335 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-/*
- This program reads a file containing function prototypes
- (like syscall_solaris.go) and generates system call bodies.
- The prototypes are marked by lines beginning with "//sys"
- and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-*/
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- tags = flag.String("tags", "", "build tags")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- text := ""
- dynimports := ""
- linknames := ""
- var vars []string
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- t = strings.TrimSpace(t)
- t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `)
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // So file name.
- if modname == "" {
- modname = "libc"
- }
-
- // System call name.
- if sysname == "" {
- sysname = funct
- }
-
- // System call pointer variable name.
- sysvarname := fmt.Sprintf("proc%s", sysname)
-
- strconvfunc := "BytePtrFromString"
- strconvtype := "*byte"
-
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- // Runtime import of function to allow cross-platform builds.
- dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname)
- // Link symbol to proc address variable.
- linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname)
- // Library proc address variable.
- vars = append(vars, sysvarname)
-
- // Go function header.
- outlist := strings.Join(out, ", ")
- if outlist != "" {
- outlist = fmt.Sprintf(" (%s)", outlist)
- }
- if text != "" {
- text += "\n"
- }
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist)
-
- // Check if err return available
- errvar := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- continue
- }
- }
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1])
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
- n++
- } else if p.Type == "int64" && endianness != "" {
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- } else if p.Type == "bool" {
- text += fmt.Sprintf("\tvar _p%d uint32\n", n)
- text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
- args = append(args, fmt.Sprintf("uintptr(_p%d)", n))
- n++
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- }
- nargs := len(args)
-
- // Determine which form to use; pad args with zeros.
- asm := "sysvicall6"
- if nonblock != nil {
- asm = "rawSysvicall6"
- }
- if len(args) <= 6 {
- for len(args) < 6 {
- args = append(args, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path)
- os.Exit(1)
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist)
-
- // Assign return values.
- body := ""
- ret := []string{"_", "_", "_"}
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- ret[2] = reg
- doErrno = true
- } else {
- reg = fmt.Sprintf("r%d", i)
- ret[i] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%d != 0", reg)
- }
- if p.Type == "int64" && endianness != "" {
- // 64-bit number in r1:r0 or r0:r1.
- if i+2 > len(out) {
- fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path)
- os.Exit(1)
- }
- if endianness == "big-endian" {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
- } else {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
- }
- ret[i] = fmt.Sprintf("r%d", i)
- ret[i+1] = fmt.Sprintf("r%d", i+1)
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
- text += fmt.Sprintf("\t%s\n", call)
- } else {
- text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
- }
- text += body
-
- if doErrno {
- text += "\tif e1 != 0 {\n"
- text += "\t\terr = e1\n"
- text += "\t}\n"
- }
- text += "\treturn\n"
- text += "}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
-
- }
- vardecls := "\t" + strings.Join(vars, ",\n\t")
- vardecls += " syscallFunc"
- fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package %s
-
-import (
- "syscall"
- "unsafe"
-)
-%s
-%s
-%s
-var (
-%s
-)
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go
deleted file mode 100644
index b6b409909c..0000000000
--- a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright 2019 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// Parse the header files for OpenBSD and generate a Go usable sysctl MIB.
-//
-// Build a MIB with each entry being an array containing the level, type and
-// a hash that will contain additional entries if the current entry is a node.
-// We then walk this MIB and create a flattened sysctl name to OID hash.
-
-package main
-
-import (
- "bufio"
- "fmt"
- "os"
- "path/filepath"
- "regexp"
- "sort"
- "strings"
-)
-
-var (
- goos, goarch string
-)
-
-// cmdLine returns this programs's commandline arguments.
-func cmdLine() string {
- return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags.
-func buildTags() string {
- return fmt.Sprintf("%s,%s", goarch, goos)
-}
-
-// reMatch performs regular expression match and stores the substring slice to value pointed by m.
-func reMatch(re *regexp.Regexp, str string, m *[]string) bool {
- *m = re.FindStringSubmatch(str)
- if *m != nil {
- return true
- }
- return false
-}
-
-type nodeElement struct {
- n int
- t string
- pE *map[string]nodeElement
-}
-
-var (
- debugEnabled bool
- mib map[string]nodeElement
- node *map[string]nodeElement
- nodeMap map[string]string
- sysCtl []string
-)
-
-var (
- ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`)
- ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`)
- ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`)
- netInetRE = regexp.MustCompile(`^netinet/`)
- netInet6RE = regexp.MustCompile(`^netinet6/`)
- netRE = regexp.MustCompile(`^net/`)
- bracesRE = regexp.MustCompile(`{.*}`)
- ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`)
- fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`)
-)
-
-func debug(s string) {
- if debugEnabled {
- fmt.Fprintln(os.Stderr, s)
- }
-}
-
-// Walk the MIB and build a sysctl name to OID mapping.
-func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) {
- lNode := pNode // local copy of pointer to node
- var keys []string
- for k := range *lNode {
- keys = append(keys, k)
- }
- sort.Strings(keys)
-
- for _, key := range keys {
- nodename := name
- if name != "" {
- nodename += "."
- }
- nodename += key
-
- nodeoid := append(oid, (*pNode)[key].n)
-
- if (*pNode)[key].t == `CTLTYPE_NODE` {
- if _, ok := nodeMap[nodename]; ok {
- lNode = &mib
- ctlName := nodeMap[nodename]
- for _, part := range strings.Split(ctlName, ".") {
- lNode = ((*lNode)[part]).pE
- }
- } else {
- lNode = (*pNode)[key].pE
- }
- buildSysctl(lNode, nodename, nodeoid)
- } else if (*pNode)[key].t != "" {
- oidStr := []string{}
- for j := range nodeoid {
- oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j]))
- }
- text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n"
- sysCtl = append(sysCtl, text)
- }
- }
-}
-
-func main() {
- // Get the OS (using GOOS_TARGET if it exist)
- goos = os.Getenv("GOOS_TARGET")
- if goos == "" {
- goos = os.Getenv("GOOS")
- }
- // Get the architecture (using GOARCH_TARGET if it exists)
- goarch = os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check if GOOS and GOARCH environment variables are defined
- if goarch == "" || goos == "" {
- fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n")
- os.Exit(1)
- }
-
- mib = make(map[string]nodeElement)
- headers := [...]string{
- `sys/sysctl.h`,
- `sys/socket.h`,
- `sys/tty.h`,
- `sys/malloc.h`,
- `sys/mount.h`,
- `sys/namei.h`,
- `sys/sem.h`,
- `sys/shm.h`,
- `sys/vmmeter.h`,
- `uvm/uvmexp.h`,
- `uvm/uvm_param.h`,
- `uvm/uvm_swap_encrypt.h`,
- `ddb/db_var.h`,
- `net/if.h`,
- `net/if_pfsync.h`,
- `net/pipex.h`,
- `netinet/in.h`,
- `netinet/icmp_var.h`,
- `netinet/igmp_var.h`,
- `netinet/ip_ah.h`,
- `netinet/ip_carp.h`,
- `netinet/ip_divert.h`,
- `netinet/ip_esp.h`,
- `netinet/ip_ether.h`,
- `netinet/ip_gre.h`,
- `netinet/ip_ipcomp.h`,
- `netinet/ip_ipip.h`,
- `netinet/pim_var.h`,
- `netinet/tcp_var.h`,
- `netinet/udp_var.h`,
- `netinet6/in6.h`,
- `netinet6/ip6_divert.h`,
- `netinet6/pim6_var.h`,
- `netinet/icmp6.h`,
- `netmpls/mpls.h`,
- }
-
- ctls := [...]string{
- `kern`,
- `vm`,
- `fs`,
- `net`,
- //debug /* Special handling required */
- `hw`,
- //machdep /* Arch specific */
- `user`,
- `ddb`,
- //vfs /* Special handling required */
- `fs.posix`,
- `kern.forkstat`,
- `kern.intrcnt`,
- `kern.malloc`,
- `kern.nchstats`,
- `kern.seminfo`,
- `kern.shminfo`,
- `kern.timecounter`,
- `kern.tty`,
- `kern.watchdog`,
- `net.bpf`,
- `net.ifq`,
- `net.inet`,
- `net.inet.ah`,
- `net.inet.carp`,
- `net.inet.divert`,
- `net.inet.esp`,
- `net.inet.etherip`,
- `net.inet.gre`,
- `net.inet.icmp`,
- `net.inet.igmp`,
- `net.inet.ip`,
- `net.inet.ip.ifq`,
- `net.inet.ipcomp`,
- `net.inet.ipip`,
- `net.inet.mobileip`,
- `net.inet.pfsync`,
- `net.inet.pim`,
- `net.inet.tcp`,
- `net.inet.udp`,
- `net.inet6`,
- `net.inet6.divert`,
- `net.inet6.ip6`,
- `net.inet6.icmp6`,
- `net.inet6.pim6`,
- `net.inet6.tcp6`,
- `net.inet6.udp6`,
- `net.mpls`,
- `net.mpls.ifq`,
- `net.key`,
- `net.pflow`,
- `net.pfsync`,
- `net.pipex`,
- `net.rt`,
- `vm.swapencrypt`,
- //vfsgenctl /* Special handling required */
- }
-
- // Node name "fixups"
- ctlMap := map[string]string{
- "ipproto": "net.inet",
- "net.inet.ipproto": "net.inet",
- "net.inet6.ipv6proto": "net.inet6",
- "net.inet6.ipv6": "net.inet6.ip6",
- "net.inet.icmpv6": "net.inet6.icmp6",
- "net.inet6.divert6": "net.inet6.divert",
- "net.inet6.tcp6": "net.inet.tcp",
- "net.inet6.udp6": "net.inet.udp",
- "mpls": "net.mpls",
- "swpenc": "vm.swapencrypt",
- }
-
- // Node mappings
- nodeMap = map[string]string{
- "net.inet.ip.ifq": "net.ifq",
- "net.inet.pfsync": "net.pfsync",
- "net.mpls.ifq": "net.ifq",
- }
-
- mCtls := make(map[string]bool)
- for _, ctl := range ctls {
- mCtls[ctl] = true
- }
-
- for _, header := range headers {
- debug("Processing " + header)
- file, err := os.Open(filepath.Join("/usr/include", header))
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- var sub []string
- if reMatch(ctlNames1RE, s.Text(), &sub) ||
- reMatch(ctlNames2RE, s.Text(), &sub) ||
- reMatch(ctlNames3RE, s.Text(), &sub) {
- if sub[1] == `CTL_NAMES` {
- // Top level.
- node = &mib
- } else {
- // Node.
- nodename := strings.ToLower(sub[2])
- ctlName := ""
- if reMatch(netInetRE, header, &sub) {
- ctlName = "net.inet." + nodename
- } else if reMatch(netInet6RE, header, &sub) {
- ctlName = "net.inet6." + nodename
- } else if reMatch(netRE, header, &sub) {
- ctlName = "net." + nodename
- } else {
- ctlName = nodename
- ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`)
- }
-
- if val, ok := ctlMap[ctlName]; ok {
- ctlName = val
- }
- if _, ok := mCtls[ctlName]; !ok {
- debug("Ignoring " + ctlName + "...")
- continue
- }
-
- // Walk down from the top of the MIB.
- node = &mib
- for _, part := range strings.Split(ctlName, ".") {
- if _, ok := (*node)[part]; !ok {
- debug("Missing node " + part)
- (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}}
- }
- node = (*node)[part].pE
- }
- }
-
- // Populate current node with entries.
- i := -1
- for !strings.HasPrefix(s.Text(), "}") {
- s.Scan()
- if reMatch(bracesRE, s.Text(), &sub) {
- i++
- }
- if !reMatch(ctlTypeRE, s.Text(), &sub) {
- continue
- }
- (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}}
- }
- }
- }
- err = s.Err()
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
- file.Close()
- }
- buildSysctl(&mib, "", []int{})
-
- sort.Strings(sysCtl)
- text := strings.Join(sysCtl, "")
-
- fmt.Printf(srcTemplate, cmdLine(), buildTags(), text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; DO NOT EDIT.
-
-// +build %s
-
-package unix
-
-type mibentry struct {
- ctlname string
- ctloid []_C_int
-}
-
-var sysctlMib = []mibentry {
-%s
-}
-`
diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go
deleted file mode 100644
index baa6ecd850..0000000000
--- a/vendor/golang.org/x/sys/unix/mksysnum.go
+++ /dev/null
@@ -1,190 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// Generate system call table for DragonFly, NetBSD,
-// FreeBSD, OpenBSD or Darwin from master list
-// (for example, /usr/src/sys/kern/syscalls.master or
-// sys/syscall.h).
-package main
-
-import (
- "bufio"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- goos, goarch string
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksysnum.go " + strings.Join(os.Args[1:], " ")
-}
-
-// buildTags returns build tags
-func buildTags() string {
- return fmt.Sprintf("%s,%s", goarch, goos)
-}
-
-func checkErr(err error) {
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
-}
-
-// source string and substring slice for regexp
-type re struct {
- str string // source string
- sub []string // matched sub-string
-}
-
-// Match performs regular expression match
-func (r *re) Match(exp string) bool {
- r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str)
- if r.sub != nil {
- return true
- }
- return false
-}
-
-// fetchFile fetches a text file from URL
-func fetchFile(URL string) io.Reader {
- resp, err := http.Get(URL)
- checkErr(err)
- defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- checkErr(err)
- return strings.NewReader(string(body))
-}
-
-// readFile reads a text file from path
-func readFile(path string) io.Reader {
- file, err := os.Open(os.Args[1])
- checkErr(err)
- return file
-}
-
-func format(name, num, proto string) string {
- name = strings.ToUpper(name)
- // There are multiple entries for enosys and nosys, so comment them out.
- nm := re{str: name}
- if nm.Match(`^SYS_E?NOSYS$`) {
- name = fmt.Sprintf("// %s", name)
- }
- if name == `SYS_SYS_EXIT` {
- name = `SYS_EXIT`
- }
- return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto)
-}
-
-func main() {
- // Get the OS (using GOOS_TARGET if it exist)
- goos = os.Getenv("GOOS_TARGET")
- if goos == "" {
- goos = os.Getenv("GOOS")
- }
- // Get the architecture (using GOARCH_TARGET if it exists)
- goarch = os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check if GOOS and GOARCH environment variables are defined
- if goarch == "" || goos == "" {
- fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n")
- os.Exit(1)
- }
-
- file := strings.TrimSpace(os.Args[1])
- var syscalls io.Reader
- if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") {
- // Download syscalls.master file
- syscalls = fetchFile(file)
- } else {
- syscalls = readFile(file)
- }
-
- var text, line string
- s := bufio.NewScanner(syscalls)
- for s.Scan() {
- t := re{str: line}
- if t.Match(`^(.*)\\$`) {
- // Handle continuation
- line = t.sub[1]
- line += strings.TrimLeft(s.Text(), " \t")
- } else {
- // New line
- line = s.Text()
- }
- t = re{str: line}
- if t.Match(`\\$`) {
- continue
- }
- t = re{str: line}
-
- switch goos {
- case "dragonfly":
- if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) {
- num, proto := t.sub[1], t.sub[2]
- name := fmt.Sprintf("SYS_%s", t.sub[3])
- text += format(name, num, proto)
- }
- case "freebsd":
- if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) {
- num, proto := t.sub[1], t.sub[2]
- name := fmt.Sprintf("SYS_%s", t.sub[3])
- text += format(name, num, proto)
- }
- case "openbsd":
- if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) {
- num, proto, name := t.sub[1], t.sub[3], t.sub[4]
- text += format(name, num, proto)
- }
- case "netbsd":
- if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) {
- num, proto, compat := t.sub[1], t.sub[6], t.sub[8]
- name := t.sub[7] + "_" + t.sub[9]
- if t.sub[11] != "" {
- name = t.sub[7] + "_" + t.sub[11]
- }
- name = strings.ToUpper(name)
- if compat == "" || compat == "13" || compat == "30" || compat == "50" {
- text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto)
- }
- }
- case "darwin":
- if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) {
- name, num := t.sub[1], t.sub[2]
- name = strings.ToUpper(name)
- text += fmt.Sprintf(" SYS_%s = %s;\n", name, num)
- }
- default:
- fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos)
- os.Exit(1)
-
- }
- }
- err := s.Err()
- checkErr(err)
-
- fmt.Printf(template, cmdLine(), buildTags(), text)
-}
-
-const template = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build %s
-
-package unix
-
-const(
-%s)`
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go
index 1aa065f9c9..9ad8a0d4a5 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix.go
@@ -350,49 +350,12 @@ func (w WaitStatus) Signal() Signal {
func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 }
-func (w WaitStatus) CoreDump() bool { return w&0x200 != 0 }
+func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 }
func (w WaitStatus) TrapCause() int { return -1 }
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
// There is no way to create a custom fcntl and to keep //sys fcntl easily,
// Therefore, the programmer must call dup2 instead of fcntl in this case.
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
index bf05603f15..b3c8e3301c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
@@ -29,6 +29,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
index 13d4321f4c..9a6e024179 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
@@ -29,6 +29,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go
index 97a8eef6fa..3e6671426c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_bsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go
@@ -413,8 +413,6 @@ func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err e
return kevent(kq, change, len(changes), event, len(events), timeout)
}
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
-
// sysctlmib translates name to mib number and appends any additional args.
func sysctlmib(name string, args ...int) ([]_C_int, error) {
// Translate name to mib number.
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
new file mode 100644
index 0000000000..6a15cba611
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
@@ -0,0 +1,29 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,go1.12,!go1.13
+
+package unix
+
+import (
+ "unsafe"
+)
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ // To implement this using libSystem we'd need syscall_syscallPtr for
+ // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
+ // back to raw syscalls for this func on Go 1.12.
+ var p unsafe.Pointer
+ if len(buf) > 0 {
+ p = unsafe.Pointer(&buf[0])
+ } else {
+ p = unsafe.Pointer(&_zero)
+ }
+ r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
+ n = int(r0)
+ if e1 != 0 {
+ return n, errnoErr(e1)
+ }
+ return n, nil
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
new file mode 100644
index 0000000000..24960c38ba
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
@@ -0,0 +1,103 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,go1.13
+
+package unix
+
+import "unsafe"
+
+//sys closedir(dir uintptr) (err error)
+//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
+
+func fdopendir(fd int) (dir uintptr, err error) {
+ r0, _, e1 := syscall_syscallPtr(funcPC(libc_fdopendir_trampoline), uintptr(fd), 0, 0)
+ dir = uintptr(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+func libc_fdopendir_trampoline()
+
+//go:linkname libc_fdopendir libc_fdopendir
+//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ // Simulate Getdirentries using fdopendir/readdir_r/closedir.
+ const ptrSize = unsafe.Sizeof(uintptr(0))
+
+ // We store the number of entries to skip in the seek
+ // offset of fd. See issue #31368.
+ // It's not the full required semantics, but should handle the case
+ // of calling Getdirentries or ReadDirent repeatedly.
+ // It won't handle assigning the results of lseek to *basep, or handle
+ // the directory being edited underfoot.
+ skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
+ if err != nil {
+ return 0, err
+ }
+
+ // We need to duplicate the incoming file descriptor
+ // because the caller expects to retain control of it, but
+ // fdopendir expects to take control of its argument.
+ // Just Dup'ing the file descriptor is not enough, as the
+ // result shares underlying state. Use Openat to make a really
+ // new file descriptor referring to the same directory.
+ fd2, err := Openat(fd, ".", O_RDONLY, 0)
+ if err != nil {
+ return 0, err
+ }
+ d, err := fdopendir(fd2)
+ if err != nil {
+ Close(fd2)
+ return 0, err
+ }
+ defer closedir(d)
+
+ var cnt int64
+ for {
+ var entry Dirent
+ var entryp *Dirent
+ e := readdir_r(d, &entry, &entryp)
+ if e != 0 {
+ return n, errnoErr(e)
+ }
+ if entryp == nil {
+ break
+ }
+ if skip > 0 {
+ skip--
+ cnt++
+ continue
+ }
+ reclen := int(entry.Reclen)
+ if reclen > len(buf) {
+ // Not enough room. Return for now.
+ // The counter will let us know where we should start up again.
+ // Note: this strategy for suspending in the middle and
+ // restarting is O(n^2) in the length of the directory. Oh well.
+ break
+ }
+ // Copy entry into return buffer.
+ s := struct {
+ ptr unsafe.Pointer
+ siz int
+ cap int
+ }{ptr: unsafe.Pointer(&entry), siz: reclen, cap: reclen}
+ copy(buf, *(*[]byte)(unsafe.Pointer(&s)))
+ buf = buf[reclen:]
+ n += reclen
+ cnt++
+ }
+ // Set the seek offset of the input fd to record
+ // how many files we've already returned.
+ _, err = Seek(fd, cnt, 0 /* SEEK_SET */)
+ if err != nil {
+ return n, err
+ }
+
+ return n, nil
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 216b4ac9e8..c5018a385c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -89,7 +89,6 @@ func direntNamlen(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
}
-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
@@ -340,43 +339,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname)
@@ -498,7 +460,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sys Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go
new file mode 100644
index 0000000000..6b223f91a5
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go
@@ -0,0 +1,9 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,386,!go1.12
+
+package unix
+
+//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
index 489726fa9b..dd756e708c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
@@ -10,6 +10,9 @@ import (
"syscall"
)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
+
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
}
@@ -43,6 +46,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
@@ -56,7 +63,6 @@ const SYS___SYSCTL = SYS_SYSCTL
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go
new file mode 100644
index 0000000000..68ebd6fab2
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go
@@ -0,0 +1,9 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,amd64,!go1.12
+
+package unix
+
+//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
index 914b89bde5..7f148c428e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
@@ -10,6 +10,9 @@ import (
"syscall"
)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
+
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: sec, Nsec: nsec}
}
@@ -43,6 +46,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
@@ -56,7 +63,6 @@ const SYS___SYSCTL = SYS_SYSCTL
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
-//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go
new file mode 100644
index 0000000000..c81510da27
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go
@@ -0,0 +1,11 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,386,!go1.12
+
+package unix
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ return 0, ENOSYS
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
index 4a284cf502..58be02e718 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
@@ -8,6 +8,14 @@ import (
"syscall"
)
+func ptrace(request int, pid int, addr uintptr, data uintptr) error {
+ return ENOTSUP
+}
+
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
+ return ENOTSUP
+}
+
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
}
@@ -41,6 +49,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
@@ -58,7 +70,3 @@ const SYS___SYSCTL = SYS_SYSCTL
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Stat(path string, stat *Stat_t) (err error)
//sys Statfs(path string, stat *Statfs_t) (err error)
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return 0, ENOSYS
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go
new file mode 100644
index 0000000000..01d450406b
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go
@@ -0,0 +1,11 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin,arm64,!go1.12
+
+package unix
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ return 0, ENOSYS
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
index 52dcd88f6b..1ee931f97c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
@@ -10,6 +10,14 @@ import (
"syscall"
)
+func ptrace(request int, pid int, addr uintptr, data uintptr) error {
+ return ENOTSUP
+}
+
+func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
+ return ENOTSUP
+}
+
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: sec, Nsec: nsec}
}
@@ -43,6 +51,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
@@ -60,7 +72,3 @@ const SYS___SYSCTL = SYS_SYSCTL
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Stat(path string, stat *Stat_t) (err error)
//sys Statfs(path string, stat *Statfs_t) (err error)
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- return 0, ENOSYS
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
index 4b4ae460f2..f34c86c899 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
@@ -15,6 +15,7 @@ func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err
func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only
func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
//go:linkname syscall_syscall syscall.syscall
//go:linkname syscall_syscall6 syscall.syscall6
@@ -22,6 +23,7 @@ func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, er
//go:linkname syscall_syscall9 syscall.syscall9
//go:linkname syscall_rawSyscall syscall.rawSyscall
//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
+//go:linkname syscall_syscallPtr syscall.syscallPtr
// Find the entry point for f. See comments in runtime/proc.go for the
// function of the same name.
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
index 260a400f91..8c8d502979 100644
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
@@ -14,6 +14,8 @@ package unix
import "unsafe"
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
Len uint8
@@ -150,43 +152,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
err := sysctl(mib, old, oldlen, nil, 0)
if err != nil {
@@ -325,7 +290,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
index 9babb31ea7..a6b4830ac8 100644
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
@@ -33,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
index 329d240b90..25ac9340c0 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
@@ -36,6 +36,8 @@ var (
// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h
const _ino64First = 1200031
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
func supportsABI(ver uint32) bool {
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
return osreldate >= ver
@@ -201,43 +203,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname)
@@ -688,7 +653,7 @@ func PtraceSingleStep(pid int) (err error) {
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
index 21e03958cd..dcc56457a0 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
@@ -33,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
index 9c945a6579..321c3baceb 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
@@ -33,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
index 5cd6243f2a..6977008313 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
@@ -33,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
index a318054878..dbbbfd6035 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
@@ -33,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index 637b5017b8..b2c2d9b2e1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -71,6 +71,17 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
// ioctl itself should not be exposed directly, but additional get/set
// functions for specific types are permissible.
+// IoctlRetInt performs an ioctl operation specified by req on a device
+// associated with opened file descriptor fd, and returns a non-negative
+// integer that is returned by the ioctl syscall.
+func IoctlRetInt(fd int, req uint) (int, error) {
+ ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0)
+ if err != 0 {
+ return 0, err
+ }
+ return int(ret), nil
+}
+
// IoctlSetPointerInt performs an ioctl operation which sets an
// integer value on fd, using the specified request number. The ioctl
// argument is called with a pointer to the integer value, rather than
@@ -80,52 +91,18 @@ func IoctlSetPointerInt(fd int, req uint, value int) error {
return ioctl(fd, req, uintptr(unsafe.Pointer(&v)))
}
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
func IoctlSetRTCTime(fd int, value *RTCTime) error {
err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
runtime.KeepAlive(value)
return err
}
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
func IoctlGetUint32(fd int, req uint) (uint32, error) {
var value uint32
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
return value, err
}
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func IoctlGetRTCTime(fd int) (*RTCTime, error) {
var value RTCTime
err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value)))
@@ -798,6 +775,70 @@ func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil
}
+// SockaddrTIPC implements the Sockaddr interface for AF_TIPC type sockets.
+// For more information on TIPC, see: http://tipc.sourceforge.net/.
+type SockaddrTIPC struct {
+ // Scope is the publication scopes when binding service/service range.
+ // Should be set to TIPC_CLUSTER_SCOPE or TIPC_NODE_SCOPE.
+ Scope int
+
+ // Addr is the type of address used to manipulate a socket. Addr must be
+ // one of:
+ // - *TIPCSocketAddr: "id" variant in the C addr union
+ // - *TIPCServiceRange: "nameseq" variant in the C addr union
+ // - *TIPCServiceName: "name" variant in the C addr union
+ //
+ // If nil, EINVAL will be returned when the structure is used.
+ Addr TIPCAddr
+
+ raw RawSockaddrTIPC
+}
+
+// TIPCAddr is implemented by types that can be used as an address for
+// SockaddrTIPC. It is only implemented by *TIPCSocketAddr, *TIPCServiceRange,
+// and *TIPCServiceName.
+type TIPCAddr interface {
+ tipcAddrtype() uint8
+ tipcAddr() [12]byte
+}
+
+func (sa *TIPCSocketAddr) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCSocketAddr{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCSocketAddr) tipcAddrtype() uint8 { return TIPC_SOCKET_ADDR }
+
+func (sa *TIPCServiceRange) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceRange{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCServiceRange) tipcAddrtype() uint8 { return TIPC_SERVICE_RANGE }
+
+func (sa *TIPCServiceName) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceName{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCServiceName) tipcAddrtype() uint8 { return TIPC_SERVICE_ADDR }
+
+func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) {
+ if sa.Addr == nil {
+ return nil, 0, EINVAL
+ }
+
+ sa.raw.Family = AF_TIPC
+ sa.raw.Scope = int8(sa.Scope)
+ sa.raw.Addrtype = sa.Addr.tipcAddrtype()
+ sa.raw.Addr = sa.Addr.tipcAddr()
+
+ return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil
+}
+
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_NETLINK:
@@ -923,6 +964,27 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
break
}
}
+ return sa, nil
+ case AF_TIPC:
+ pp := (*RawSockaddrTIPC)(unsafe.Pointer(rsa))
+
+ sa := &SockaddrTIPC{
+ Scope: int(pp.Scope),
+ }
+
+ // Determine which union variant is present in pp.Addr by checking
+ // pp.Addrtype.
+ switch pp.Addrtype {
+ case TIPC_SERVICE_RANGE:
+ sa.Addr = (*TIPCServiceRange)(unsafe.Pointer(&pp.Addr))
+ case TIPC_SERVICE_ADDR:
+ sa.Addr = (*TIPCServiceName)(unsafe.Pointer(&pp.Addr))
+ case TIPC_SOCKET_ADDR:
+ sa.Addr = (*TIPCSocketAddr)(unsafe.Pointer(&pp.Addr))
+ default:
+ return nil, EINVAL
+ }
+
return sa, nil
}
return nil, EAFNOSUPPORT
@@ -1160,6 +1222,34 @@ func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error
return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer)
}
+// KeyctlRestrictKeyring implements the KEYCTL_RESTRICT_KEYRING command. This
+// command limits the set of keys that can be linked to the keyring, regardless
+// of keyring permissions. The command requires the "setattr" permission.
+//
+// When called with an empty keyType the command locks the keyring, preventing
+// any further keys from being linked to the keyring.
+//
+// The "asymmetric" keyType defines restrictions requiring key payloads to be
+// DER encoded X.509 certificates signed by keys in another keyring. Restrictions
+// for "asymmetric" include "builtin_trusted", "builtin_and_secondary_trusted",
+// "key_or_keyring:", and "key_or_keyring::chain".
+//
+// As of Linux 4.12, only the "asymmetric" keyType defines type-specific
+// restrictions.
+//
+// See the full documentation at:
+// http://man7.org/linux/man-pages/man3/keyctl_restrict_keyring.3.html
+// http://man7.org/linux/man-pages/man2/keyctl.2.html
+func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error {
+ if keyType == "" {
+ return keyctlRestrictKeyring(KEYCTL_RESTRICT_KEYRING, ringid)
+ }
+ return keyctlRestrictKeyringByType(KEYCTL_RESTRICT_KEYRING, ringid, keyType, restriction)
+}
+
+//sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL
+//sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL
+
func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
var msg Msghdr
var rsa RawSockaddrAny
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
index e2f8cf6e5a..e7fa665e68 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
@@ -372,6 +372,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
index 87a30744d6..088ce0f935 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
@@ -163,6 +163,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
index f626794439..11930fc8fa 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
@@ -252,6 +252,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
index cb20b15d5d..251e2d9715 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
@@ -180,6 +180,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
index b3b21ec1e2..7562fe97b8 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
@@ -208,6 +208,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
index 5144d4e133..a939ff8f21 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
@@ -220,6 +220,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
index 0a100b66a3..28d6d0f229 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
@@ -91,6 +91,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
index 6230f64052..6798c26258 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
@@ -179,6 +179,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
index f81dbdc9c8..eb5cb1a71d 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
@@ -120,6 +120,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
index b69565616f..37321c12ef 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
@@ -107,6 +107,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint64(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
index 5ef3090401..f95463ee28 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
@@ -18,6 +18,8 @@ import (
"unsafe"
)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
Len uint8
@@ -187,43 +189,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {
var value Ptmget
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
@@ -365,7 +330,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
index 24f74e58ce..24da8b5245 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
index 6878bf7ff9..25a0ac8258 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
index dbbfcf71db..21591ecd4d 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
index f3434465a1..8047496350 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index 1a074b2fe1..7fe65ef75f 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -18,6 +18,8 @@ import (
"unsafe"
)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
Len uint8
@@ -178,43 +180,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-// ioctl itself should not be exposed directly, but additional get/set
-// functions for specific types are permissible.
-
-// IoctlSetInt performs an ioctl operation which sets an integer value
-// on fd, using the specified request number.
-func IoctlSetInt(fd int, req uint, value int) error {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-// IoctlGetInt performs an ioctl operation which gets an integer value
-// from fd, using the specified request number.
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
@@ -340,7 +305,7 @@ func Uname(uname *Utsname) error {
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
index d62da60d1f..42b5a0e51e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
index 9a35334cba..6ea4b48831 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
index 5d812aaea5..1c3d26fa2c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
index 0fb39cf5eb..a8c458cb03 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
@@ -28,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
index 0153a316dd..62f968c7f0 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go
@@ -553,40 +553,10 @@ func Minor(dev uint64) uint32 {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
-func IoctlSetInt(fd int, req uint, value int) (err error) {
- return ioctl(fd, req, uintptr(value))
-}
-
-func ioctlSetWinsize(fd int, req uint, value *Winsize) (err error) {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
-func ioctlSetTermios(fd int, req uint, value *Termios) (err error) {
- return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
-}
-
func IoctlSetTermio(fd int, req uint, value *Termio) (err error) {
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
}
-func IoctlGetInt(fd int, req uint) (int, error) {
- var value int
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return value, err
-}
-
-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
- var value Winsize
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
-func IoctlGetTermios(fd int, req uint) (*Termios, error) {
- var value Termios
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
- return &value, err
-}
-
func IoctlGetTermio(fd int, req uint) (*Termio, error) {
var value Termio
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
@@ -679,7 +649,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
+//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sysnb Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
index 91c32ddf02..b22a34d7ae 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
@@ -18,6 +18,10 @@ func (iov *Iovec) SetLen(length int) {
iov.Len = uint64(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go
deleted file mode 100644
index 40d2beede5..0000000000
--- a/vendor/golang.org/x/sys/unix/types_aix.go
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-// +build aix
-
-/*
-Input to cgo -godefs. See also mkerrors.sh and mkall.sh
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-
-
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
- PathMax = C.PATH_MAX
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-type off64 C.off64_t
-type off C.off_t
-type Mode_t C.mode_t
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-type Timeval32 C.struct_timeval32
-
-type Timex C.struct_timex
-
-type Time_t C.time_t
-
-type Tms C.struct_tms
-
-type Utimbuf C.struct_utimbuf
-
-type Timezone C.struct_timezone
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit64
-
-type Pid_t C.pid_t
-
-type _Gid_t C.gid_t
-
-type dev_t C.dev_t
-
-// Files
-
-type Stat_t C.struct_stat
-
-type StatxTimestamp C.struct_statx_timestamp
-
-type Statx_t C.struct_statx
-
-type Dirent C.struct_dirent
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Cmsghdr C.struct_cmsghdr
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type Linger C.struct_linger
-
-type Msghdr C.struct_msghdr
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofLinger = C.sizeof_struct_linger
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
-)
-
-type IfMsgHdr C.struct_if_msghdr
-
-// Misc
-
-type FdSet C.fd_set
-
-type Utsname C.struct_utsname
-
-type Ustat_t C.struct_ustat
-
-type Sigset_t C.sigset_t
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_REMOVEDIR = C.AT_REMOVEDIR
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
-)
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Termio C.struct_termio
-
-type Winsize C.struct_winsize
-
-//poll
-
-type PollFd struct {
- Fd int32
- Events uint16
- Revents uint16
-}
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-//flock_t
-
-type Flock_t C.struct_flock64
-
-// Statfs
-
-type Fsid_t C.struct_fsid_t
-type Fsid64_t C.struct_fsid64_t
-
-type Statfs_t C.struct_statfs
-
-const RNDGETENTCNT = 0x80045200
diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go
deleted file mode 100644
index 155c2e692b..0000000000
--- a/vendor/golang.org/x/sys/unix/types_darwin.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define __DARWIN_UNIX03 0
-#define KERNEL
-#define _DARWIN_USE_64_BIT_INODE
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include