1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-16 17:38:45 -05:00

rename ISegment -> Segment

This commit is contained in:
v2ray 2016-07-04 14:17:42 +02:00
parent 03ff683686
commit 8ea3c13236
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
5 changed files with 7 additions and 7 deletions

View File

@ -137,7 +137,7 @@ func (kcp *KCP) update_ack(rtt int32) {
func (kcp *KCP) Input(data []byte) int { func (kcp *KCP) Input(data []byte) int {
kcp.lastIncomingTime = kcp.current kcp.lastIncomingTime = kcp.current
var seg ISegment var seg Segment
for { for {
seg, data = ReadSegment(data) seg, data = ReadSegment(data)
if seg == nil { if seg == nil {

View File

@ -9,7 +9,7 @@ import (
) )
type SegmentWriter interface { type SegmentWriter interface {
Write(seg ISegment) Write(seg Segment)
} }
type BufferedSegmentWriter struct { 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() this.Lock()
defer this.Unlock() defer this.Unlock()

View File

@ -291,7 +291,7 @@ func (this *ReceivingWorker) Flush() {
this.acklist.Flush(this.kcp.current, this.kcp.rx_rto) 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 := seg.(*AckSegment)
ackSeg.Conv = this.kcp.conv ackSeg.Conv = this.kcp.conv
ackSeg.ReceivingNext = this.nextNumber ackSeg.ReceivingNext = this.nextNumber

View File

@ -22,7 +22,7 @@ const (
SegmentOptionClose SegmentOption = 1 SegmentOptionClose SegmentOption = 1
) )
type ISegment interface { type Segment interface {
common.Releasable common.Releasable
ByteSize() int ByteSize() int
Bytes([]byte) []byte Bytes([]byte) []byte
@ -115,7 +115,7 @@ func (this *CmdOnlySegment) Bytes(b []byte) []byte {
func (this *CmdOnlySegment) Release() {} func (this *CmdOnlySegment) Release() {}
func ReadSegment(buf []byte) (ISegment, []byte) { func ReadSegment(buf []byte) (Segment, []byte) {
if len(buf) <= 4 { if len(buf) <= 4 {
return nil, nil return nil, nil
} }

View File

@ -316,7 +316,7 @@ func (this *SendingWorker) Push(b []byte) int {
return nBytes return nBytes
} }
func (this *SendingWorker) Write(seg ISegment) { func (this *SendingWorker) Write(seg Segment) {
dataSeg := seg.(*DataSegment) dataSeg := seg.(*DataSegment)
dataSeg.Conv = this.kcp.conv dataSeg.Conv = this.kcp.conv