Fix mutex error in (*inFlow).connOnRead.

This commit is contained in:
David Symonds
2015-04-13 09:24:25 +10:00
parent 66961220bd
commit 80c301c396

View File

@ -193,11 +193,11 @@ func (f *inFlow) onData(n uint32) error {
// connOnRead updates the connection level states when the application consumes data. // connOnRead updates the connection level states when the application consumes data.
func (f *inFlow) connOnRead(n uint32) uint32 { func (f *inFlow) connOnRead(n uint32) uint32 {
if n == 0 || f.conn != nil { if n == 0 || f.conn != nil {
return 0 return 0
} }
f.mu.Lock() f.mu.Lock()
f.mu.Unlock() defer f.mu.Unlock()
f.pendingData -= n f.pendingData -= n
f.pendingUpdate += n f.pendingUpdate += n
if f.pendingUpdate >= f.limit/4 { if f.pendingUpdate >= f.limit/4 {