mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
fix: revert the version change of nutsdb due to no backward compatibility
This commit is contained in:
1 parent
60cdb43aba
commit
2ca29b1193
5 files changed
+25
-13
No files matched your search
@@ -47,6 +47,7 @@ type Template struct {
|
||||
Outbounds []Outbound `json:"outbounds"`
|
||||
Routing struct {
|
||||
DomainStrategy string `json:"domainStrategy"`
|
||||
DomainMatcher string `json:"domainMatcher"`
|
||||
Rules []RoutingRule `json:"rules"`
|
||||
} `json:"routing"`
|
||||
DNS *DNS `json:"dns,omitempty"`
|
||||
@@ -1215,6 +1216,7 @@ func NewTemplateFromVmessInfo(v vmessInfo.VmessInfo) (t Template, info *entity.E
|
||||
//再修改outbounds
|
||||
t.AppendDNSOutbound()
|
||||
//最后是routing
|
||||
t.Routing.DomainMatcher = "mph"
|
||||
t.SetDNSRouting(v, dohIPs, dohHosts, setting, supportUDP)
|
||||
serverIPs, serverDomain := t.SetDirectRuleRouting(v)
|
||||
//添加目标服务器的ip到hosts中
|
||||
|
||||
@@ -197,14 +197,24 @@ func ListRemove(bucket, key string, indexes []int) error {
|
||||
// TODO: waiting for https://github.com/xujiajun/nutsdb/issues/93
|
||||
sort.Ints(indexes)
|
||||
return DB().Update(func(tx *nutsdb.Tx) (err error) {
|
||||
specialValue := []byte{0, 0, 0, 0, 0}
|
||||
for i := len(indexes) - 1; i >= 0; i-- {
|
||||
err = tx.LSet(bucket, []byte(key), indexes[i], specialValue)
|
||||
if err != nil {
|
||||
return newError().Base(err)
|
||||
}
|
||||
//for i := len(indexes) - 1; i >= 0; i-- {
|
||||
// err = tx.LSet(bucket, []byte(key), indexes[i], []byte{0})
|
||||
// if err != nil {
|
||||
// return newError().Base(err)
|
||||
// }
|
||||
//}
|
||||
//tx.LRem(bucket, []byte(key), 0)
|
||||
list, err := tx.LRange(bucket, []byte(key), 0, -1)
|
||||
if err != nil {
|
||||
return newError().Base(err)
|
||||
}
|
||||
if _, err = tx.LRem(bucket, []byte(key), 0, specialValue); err != nil {
|
||||
for i := len(indexes) - 1; i >= 0; i-- {
|
||||
list = append(list[:indexes[i]], list[indexes[i]+1:]...)
|
||||
}
|
||||
if err = tx.LRem(bucket, []byte(key), 0); err != nil {
|
||||
return newError().Base(err)
|
||||
}
|
||||
if err = tx.RPush(bucket, []byte(key), list...); err != nil {
|
||||
return newError().Base(err)
|
||||
}
|
||||
return nil
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ require (
|
||||
github.com/ugorji/go v1.2.5 // indirect
|
||||
github.com/v2rayA/routingA v0.0.0-20201204065601-aef348ea7aa1
|
||||
github.com/v2rayA/shadowsocksR v1.0.3
|
||||
github.com/xujiajun/nutsdb v0.6.0
|
||||
github.com/xujiajun/nutsdb v0.5.0
|
||||
go.starlark.net v0.0.0-20210429133630-0c63ff3779a6 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781
|
||||
|
||||
+2
-2
@@ -210,8 +210,8 @@ github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62
|
||||
github.com/xujiajun/gorouter v1.2.0/go.mod h1:yJrIta+bTNpBM/2UT8hLOaEAFckO+m/qmR3luMIQygM=
|
||||
github.com/xujiajun/mmap-go v1.0.1 h1:7Se7ss1fLPPRW+ePgqGpCkfGIZzJV6JPq9Wq9iv/WHc=
|
||||
github.com/xujiajun/mmap-go v1.0.1/go.mod h1:CNN6Sw4SL69Sui00p0zEzcZKbt+5HtEnYUsc6BKKRMg=
|
||||
github.com/xujiajun/nutsdb v0.6.0 h1:voRbF4bQO6gF9xiFZ+5w/fPHgEfR7Jea1NOtU34I8yE=
|
||||
github.com/xujiajun/nutsdb v0.6.0/go.mod h1:Q8FXi2zeQRluPpUl/CKQ6J7u/9gcI02J6cZp3owFLyA=
|
||||
github.com/xujiajun/nutsdb v0.5.0 h1:j/jM3Zw7Chg8WK7bAcKR0Xr7Mal47U1oJAMgySfDn9E=
|
||||
github.com/xujiajun/nutsdb v0.5.0/go.mod h1:owdwN0tW084RxEodABLbO7h4Z2s9WiAjZGZFhRh0/1Q=
|
||||
github.com/xujiajun/utils v0.0.0-20190123093513-8bf096c4f53b h1:jKG9OiL4T4xQN3IUrhUpc1tG+HfDXppkgVcrAiiaI/0=
|
||||
github.com/xujiajun/utils v0.0.0-20190123093513-8bf096c4f53b/go.mod h1:AZd87GYJlUzl82Yab2kTjx1EyXSQCAfZDhpTo1SQC4k=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
|
||||
+3
-3
@@ -333,9 +333,9 @@ func run() (err error) {
|
||||
if w := configure.GetConnectedServer(); w != nil {
|
||||
_ = service.Connect(w)
|
||||
}
|
||||
w := configure.GetConnectedServer()
|
||||
log.Println(err, ", which:", w)
|
||||
_ = configure.ClearConnected()
|
||||
//w := configure.GetConnectedServer()
|
||||
//log.Println(err, ", which:", w)
|
||||
//_ = configure.ClearConnected()
|
||||
errch := make(chan error)
|
||||
//启动服务端
|
||||
go func() {
|
||||
|
||||
Reference in new issue
Block a user