1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00
This commit is contained in:
Darien Raymond 2018-04-19 21:33:18 +02:00
parent 2f3670f60b
commit 1d001c090b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
5 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,7 @@ type cachedReader struct {
func (r *cachedReader) Cache(b *buf.Buffer) {
mb, _ := r.reader.ReadMultiBufferWithTimeout(time.Millisecond * 100)
if !mb.IsEmpty() {
r.cache.WriteMultiBuffer(mb)
common.Must(r.cache.WriteMultiBuffer(mb))
}
common.Must(b.Reset(func(x []byte) (int, error) {
return r.cache.Copy(x), nil

View File

@ -1,3 +1,4 @@
// Package dns is an implementation of core.DNS feature.
package dns
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg dns -path App,DNS

View File

@ -68,6 +68,7 @@ func (p *Policy) ToCorePolicy() core.Policy {
return cp
}
// ToCorePolicy converts this SystemPolicy to core.SystemPolicy.
func (p *SystemPolicy) ToCorePolicy() core.SystemPolicy {
return core.SystemPolicy{
Stats: core.SystemStatsPolicy{

View File

@ -45,6 +45,7 @@ func (m *Instance) ForLevel(level uint32) core.Policy {
return core.DefaultPolicy()
}
// ForSystem implements core.PolicyManager.
func (m *Instance) ForSystem() core.SystemPolicy {
if m.system == nil {
return core.SystemPolicy{}

View File

@ -1,3 +1,4 @@
// Package policy is an implementation of core.PolicyManager feature.
package policy
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg policy -path App,Policy