1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00

signal when read

This commit is contained in:
Darien Raymond 2018-04-17 00:45:38 +02:00
parent ef1d9d24cd
commit b4ff4c7e75
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 2 additions and 0 deletions

View File

@ -62,6 +62,7 @@ func (p *pipe) ReadMultiBuffer() (buf.MultiBuffer, error) {
for { for {
data, err := p.readMultiBufferInternal() data, err := p.readMultiBufferInternal()
if data != nil || err != nil { if data != nil || err != nil {
p.writeSignal.Signal()
return data, err return data, err
} }

View File

@ -19,6 +19,7 @@ func WithSizeLimit(limit int32) Option {
} }
} }
// New creates a new Reader and Writer that connects to each other.
func New(opts ...Option) (*Reader, *Writer) { func New(opts ...Option) (*Reader, *Writer) {
p := &pipe{ p := &pipe{
limit: defaultLimit, limit: defaultLimit,