Forráskód Böngészése

format private annotation

Darien Raymond 9 éve
szülő
commit
e6e0419958

+ 2 - 2
app/dispatcher/impl/default.go

@@ -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 {

+ 3 - 3
app/dns/nameserver.go

@@ -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)

+ 1 - 1
app/dns/server.go

@@ -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()

+ 1 - 1
app/router/rules/router.go

@@ -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 {

+ 1 - 1
common/io/chan_reader.go

@@ -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

+ 1 - 1
common/protocol/server_picker.go

@@ -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]

+ 1 - 1
proxy/freedom/freedom.go

@@ -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

+ 1 - 1
proxy/vmess/io/reader.go

@@ -10,7 +10,7 @@ import (
 	"v2ray.com/core/transport"
 )
 
-// @Private
+// Private: Visible for testing.
 type Validator struct {
 	actualAuth   hash.Hash32
 	expectedAuth uint32

+ 3 - 3
transport/internet/kcp/sending.go

@@ -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)