mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
rename ISegment -> Segment
This commit is contained in:
parent
03ff683686
commit
8ea3c13236
@ -137,7 +137,7 @@ func (kcp *KCP) update_ack(rtt int32) {
|
||||
func (kcp *KCP) Input(data []byte) int {
|
||||
kcp.lastIncomingTime = kcp.current
|
||||
|
||||
var seg ISegment
|
||||
var seg Segment
|
||||
for {
|
||||
seg, data = ReadSegment(data)
|
||||
if seg == nil {
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type SegmentWriter interface {
|
||||
Write(seg ISegment)
|
||||
Write(seg Segment)
|
||||
}
|
||||
|
||||
type BufferedSegmentWriter struct {
|
||||
@ -26,7 +26,7 @@ func NewSegmentWriter(writer *AuthenticationWriter) *BufferedSegmentWriter {
|
||||
}
|
||||
}
|
||||
|
||||
func (this *BufferedSegmentWriter) Write(seg ISegment) {
|
||||
func (this *BufferedSegmentWriter) Write(seg Segment) {
|
||||
this.Lock()
|
||||
defer this.Unlock()
|
||||
|
||||
|
@ -291,7 +291,7 @@ func (this *ReceivingWorker) Flush() {
|
||||
this.acklist.Flush(this.kcp.current, this.kcp.rx_rto)
|
||||
}
|
||||
|
||||
func (this *ReceivingWorker) Write(seg ISegment) {
|
||||
func (this *ReceivingWorker) Write(seg Segment) {
|
||||
ackSeg := seg.(*AckSegment)
|
||||
ackSeg.Conv = this.kcp.conv
|
||||
ackSeg.ReceivingNext = this.nextNumber
|
||||
|
@ -22,7 +22,7 @@ const (
|
||||
SegmentOptionClose SegmentOption = 1
|
||||
)
|
||||
|
||||
type ISegment interface {
|
||||
type Segment interface {
|
||||
common.Releasable
|
||||
ByteSize() int
|
||||
Bytes([]byte) []byte
|
||||
@ -115,7 +115,7 @@ func (this *CmdOnlySegment) Bytes(b []byte) []byte {
|
||||
|
||||
func (this *CmdOnlySegment) Release() {}
|
||||
|
||||
func ReadSegment(buf []byte) (ISegment, []byte) {
|
||||
func ReadSegment(buf []byte) (Segment, []byte) {
|
||||
if len(buf) <= 4 {
|
||||
return nil, nil
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ func (this *SendingWorker) Push(b []byte) int {
|
||||
return nBytes
|
||||
}
|
||||
|
||||
func (this *SendingWorker) Write(seg ISegment) {
|
||||
func (this *SendingWorker) Write(seg Segment) {
|
||||
dataSeg := seg.(*DataSegment)
|
||||
|
||||
dataSeg.Conv = this.kcp.conv
|
||||
|
Loading…
Reference in New Issue
Block a user