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