intermediate change

This commit is contained in:
Mahak Mukhi
2017-01-27 11:15:56 -08:00
parent 49d2a88c27
commit b2448f6c9b

View File

@ -1075,12 +1075,16 @@ func (t *http2Client) controller() {
} }
isPingSent := false isPingSent := false
keepalivePing := &ping{data: [8]byte{}} keepalivePing := &ping{data: [8]byte{}}
cchan := t.controlBuf.get()
wchan := nil
for { for {
select { select {
case i := <-t.controlBuf.get(): case i := <-cchan:
t.controlBuf.load() t.controlBuf.load()
select { wchan = t.writableChan
case <-t.writableChan: cchan = nil
continue
case <-wchan:
switch i := i.(type) { switch i := i.(type) {
case *windowUpdate: case *windowUpdate:
t.framer.writeWindowUpdate(true, i.streamID, i.increment) t.framer.writeWindowUpdate(true, i.streamID, i.increment)
@ -1100,11 +1104,10 @@ func (t *http2Client) controller() {
default: default:
grpclog.Printf("transport: http2Client.controller got unexpected item type %v\n", i) grpclog.Printf("transport: http2Client.controller got unexpected item type %v\n", i)
} }
t.writableChan <- 0 wchan <- 0
wchan = nil
cchan = t.controlBuf.get()
continue continue
case <-t.shutdownChan:
return
}
case <-timer.C: case <-timer.C:
t.mu.Lock() t.mu.Lock()
ns := len(t.activeStreams) ns := len(t.activeStreams)