mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
temp fix deadlock in quic lib
This commit is contained in:
parent
3b1aaa9a3d
commit
fd060a0880
@ -104,8 +104,8 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti
|
|||||||
ConnectionIDLength: 12,
|
ConnectionIDLength: 12,
|
||||||
HandshakeTimeout: time.Second * 8,
|
HandshakeTimeout: time.Second * 8,
|
||||||
IdleTimeout: time.Second * 30,
|
IdleTimeout: time.Second * 30,
|
||||||
MaxIncomingStreams: 32,
|
MaxIncomingStreams: 128,
|
||||||
MaxIncomingUniStreams: -1,
|
MaxIncomingUniStreams: 32,
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := wrapSysConn(rawConn, config)
|
conn, err := wrapSysConn(rawConn, config)
|
||||||
|
10
vendor/github.com/lucas-clemente/quic-go/send_stream.go
generated
vendored
10
vendor/github.com/lucas-clemente/quic-go/send_stream.go
generated
vendored
@ -97,7 +97,7 @@ func (s *sendStream) Write(p []byte) (int, error) {
|
|||||||
|
|
||||||
s.dataForWriting = make([]byte, len(p))
|
s.dataForWriting = make([]byte, len(p))
|
||||||
copy(s.dataForWriting, p)
|
copy(s.dataForWriting, p)
|
||||||
s.sender.onHasStreamData(s.streamID)
|
go s.sender.onHasStreamData(s.streamID)
|
||||||
|
|
||||||
var bytesWritten int
|
var bytesWritten int
|
||||||
var err error
|
var err error
|
||||||
@ -222,7 +222,7 @@ func (s *sendStream) Close() error {
|
|||||||
return fmt.Errorf("Close called for canceled stream %d", s.streamID)
|
return fmt.Errorf("Close called for canceled stream %d", s.streamID)
|
||||||
}
|
}
|
||||||
s.finishedWriting = true
|
s.finishedWriting = true
|
||||||
s.sender.onHasStreamData(s.streamID) // need to send the FIN
|
go s.sender.onHasStreamData(s.streamID) // need to send the FIN
|
||||||
s.ctxCancel()
|
s.ctxCancel()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -268,10 +268,14 @@ func (s *sendStream) handleStopSendingFrame(frame *wire.StopSendingFrame) {
|
|||||||
func (s *sendStream) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) {
|
func (s *sendStream) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) {
|
||||||
s.flowController.UpdateSendWindow(frame.ByteOffset)
|
s.flowController.UpdateSendWindow(frame.ByteOffset)
|
||||||
s.mutex.Lock()
|
s.mutex.Lock()
|
||||||
|
hasData := false
|
||||||
if s.dataForWriting != nil {
|
if s.dataForWriting != nil {
|
||||||
s.sender.onHasStreamData(s.streamID)
|
hasData = true
|
||||||
}
|
}
|
||||||
s.mutex.Unlock()
|
s.mutex.Unlock()
|
||||||
|
if hasData {
|
||||||
|
s.sender.onHasStreamData(s.streamID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// must be called after locking the mutex
|
// must be called after locking the mutex
|
||||||
|
Loading…
Reference in New Issue
Block a user