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,
|
||||
HandshakeTimeout: time.Second * 8,
|
||||
IdleTimeout: time.Second * 30,
|
||||
MaxIncomingStreams: 32,
|
||||
MaxIncomingUniStreams: -1,
|
||||
MaxIncomingStreams: 128,
|
||||
MaxIncomingUniStreams: 32,
|
||||
}
|
||||
|
||||
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))
|
||||
copy(s.dataForWriting, p)
|
||||
s.sender.onHasStreamData(s.streamID)
|
||||
go s.sender.onHasStreamData(s.streamID)
|
||||
|
||||
var bytesWritten int
|
||||
var err error
|
||||
@ -222,7 +222,7 @@ func (s *sendStream) Close() error {
|
||||
return fmt.Errorf("Close called for canceled stream %d", s.streamID)
|
||||
}
|
||||
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()
|
||||
return nil
|
||||
}
|
||||
@ -268,10 +268,14 @@ func (s *sendStream) handleStopSendingFrame(frame *wire.StopSendingFrame) {
|
||||
func (s *sendStream) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) {
|
||||
s.flowController.UpdateSendWindow(frame.ByteOffset)
|
||||
s.mutex.Lock()
|
||||
hasData := false
|
||||
if s.dataForWriting != nil {
|
||||
s.sender.onHasStreamData(s.streamID)
|
||||
hasData = true
|
||||
}
|
||||
s.mutex.Unlock()
|
||||
if hasData {
|
||||
s.sender.onHasStreamData(s.streamID)
|
||||
}
|
||||
}
|
||||
|
||||
// must be called after locking the mutex
|
||||
|
Loading…
Reference in New Issue
Block a user