mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
format private annotation
This commit is contained in:
parent
a9da266bf9
commit
e6e0419958
@ -24,7 +24,7 @@ func NewDefaultDispatcher(space app.Space) *DefaultDispatcher {
|
|||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Used by app.Space only.
|
||||||
func (this *DefaultDispatcher) Initialize(space app.Space) error {
|
func (this *DefaultDispatcher) Initialize(space app.Space) error {
|
||||||
if !space.HasApp(proxyman.APP_ID_OUTBOUND_MANAGER) {
|
if !space.HasApp(proxyman.APP_ID_OUTBOUND_MANAGER) {
|
||||||
log.Error("DefaultDispatcher: OutboundHandlerManager is not found in the space.")
|
log.Error("DefaultDispatcher: OutboundHandlerManager is not found in the space.")
|
||||||
@ -70,7 +70,7 @@ func (this *DefaultDispatcher) DispatchToOutbound(meta *proxy.InboundHandlerMeta
|
|||||||
return direct
|
return direct
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *DefaultDispatcher) FilterPacketAndDispatch(destination v2net.Destination, link ray.OutboundRay, dispatcher proxy.OutboundHandler) {
|
func (this *DefaultDispatcher) FilterPacketAndDispatch(destination v2net.Destination, link ray.OutboundRay, dispatcher proxy.OutboundHandler) {
|
||||||
payload, err := link.OutboundInput().Read()
|
payload, err := link.OutboundInput().Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -59,7 +59,7 @@ func NewUDPNameServer(address v2net.Destination, dispatcher dispatcher.PacketDis
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *UDPNameServer) Cleanup() {
|
func (this *UDPNameServer) Cleanup() {
|
||||||
expiredRequests := make([]uint16, 0, 16)
|
expiredRequests := make([]uint16, 0, 16)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
@ -77,7 +77,7 @@ func (this *UDPNameServer) Cleanup() {
|
|||||||
expiredRequests = nil
|
expiredRequests = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16 {
|
func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16 {
|
||||||
var id uint16
|
var id uint16
|
||||||
this.Lock()
|
this.Lock()
|
||||||
@ -102,7 +102,7 @@ func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16 {
|
|||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *UDPNameServer) HandleResponse(dest v2net.Destination, payload *alloc.Buffer) {
|
func (this *UDPNameServer) HandleResponse(dest v2net.Destination, payload *alloc.Buffer) {
|
||||||
msg := new(dns.Msg)
|
msg := new(dns.Msg)
|
||||||
err := msg.Unpack(payload.Value)
|
err := msg.Unpack(payload.Value)
|
||||||
|
@ -60,7 +60,7 @@ func (this *CacheServer) Release() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Private
|
// Private: Visible for testing.
|
||||||
func (this *CacheServer) GetCached(domain string) []net.IP {
|
func (this *CacheServer) GetCached(domain string) []net.IP {
|
||||||
this.RLock()
|
this.RLock()
|
||||||
defer this.RUnlock()
|
defer this.RUnlock()
|
||||||
|
@ -41,7 +41,7 @@ func (this *Router) Release() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *Router) ResolveIP(dest v2net.Destination) []v2net.Destination {
|
func (this *Router) ResolveIP(dest v2net.Destination) []v2net.Destination {
|
||||||
ips := this.dnsServer.Get(dest.Address().Domain())
|
ips := this.dnsServer.Get(dest.Address().Domain())
|
||||||
if len(ips) == 0 {
|
if len(ips) == 0 {
|
||||||
|
@ -22,7 +22,7 @@ func NewChanReader(stream Reader) *ChanReader {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *ChanReader) Fill() {
|
func (this *ChanReader) Fill() {
|
||||||
b, err := this.stream.Read()
|
b, err := this.stream.Read()
|
||||||
this.current = b
|
this.current = b
|
||||||
|
@ -46,7 +46,7 @@ func (this *ServerList) GetServer(idx uint32) *ServerSpec {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *ServerList) RemoveServer(idx uint32) {
|
func (this *ServerList) RemoveServer(idx uint32) {
|
||||||
n := len(this.servers)
|
n := len(this.servers)
|
||||||
this.servers[idx] = this.servers[n-1]
|
this.servers[idx] = this.servers[n-1]
|
||||||
|
@ -44,7 +44,7 @@ func NewFreedomConnection(config *Config, space app.Space, meta *proxy.OutboundH
|
|||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *FreedomConnection) ResolveIP(destination v2net.Destination) v2net.Destination {
|
func (this *FreedomConnection) ResolveIP(destination v2net.Destination) v2net.Destination {
|
||||||
if !destination.Address().Family().IsDomain() {
|
if !destination.Address().Family().IsDomain() {
|
||||||
return destination
|
return destination
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"v2ray.com/core/transport"
|
"v2ray.com/core/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
type Validator struct {
|
type Validator struct {
|
||||||
actualAuth hash.Hash32
|
actualAuth hash.Hash32
|
||||||
expectedAuth uint32
|
expectedAuth uint32
|
||||||
|
@ -277,7 +277,7 @@ func (this *SendingWorker) ProcessReceivingNextWithoutLock(nextNumber uint32) {
|
|||||||
this.FindFirstUnacknowledged()
|
this.FindFirstUnacknowledged()
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *SendingWorker) FindFirstUnacknowledged() {
|
func (this *SendingWorker) FindFirstUnacknowledged() {
|
||||||
prevUna := this.firstUnacknowledged
|
prevUna := this.firstUnacknowledged
|
||||||
if !this.window.IsEmpty() {
|
if !this.window.IsEmpty() {
|
||||||
@ -290,7 +290,7 @@ func (this *SendingWorker) FindFirstUnacknowledged() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *SendingWorker) ProcessAck(number uint32) {
|
func (this *SendingWorker) ProcessAck(number uint32) {
|
||||||
// number < this.firstUnacknowledged || number >= this.nextNumber
|
// number < this.firstUnacknowledged || number >= this.nextNumber
|
||||||
if number-this.firstUnacknowledged > 0x7FFFFFFF || number-this.nextNumber < 0x7FFFFFFF {
|
if number-this.firstUnacknowledged > 0x7FFFFFFF || number-this.nextNumber < 0x7FFFFFFF {
|
||||||
@ -372,7 +372,7 @@ func (this *SendingWorker) Push(b []byte) int {
|
|||||||
return nBytes
|
return nBytes
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Private
|
// Private: Visible for testing.
|
||||||
func (this *SendingWorker) Write(seg Segment) {
|
func (this *SendingWorker) Write(seg Segment) {
|
||||||
dataSeg := seg.(*DataSegment)
|
dataSeg := seg.(*DataSegment)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user