Ack Ping frame
This commit is contained in:
@ -85,6 +85,14 @@ func (flushIO) isItem() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type ping struct {
|
||||
ack bool
|
||||
}
|
||||
|
||||
func (ping) isItem() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// quotaPool is a pool which accumulates the quota and sends it to acquire()
|
||||
// when it is available.
|
||||
type quotaPool struct {
|
||||
|
@ -573,7 +573,7 @@ func (t *http2Client) handleSettings(f *http2.SettingsFrame) {
|
||||
}
|
||||
|
||||
func (t *http2Client) handlePing(f *http2.PingFrame) {
|
||||
// TODO(zhaoq): PingFrame handler to be implemented"
|
||||
t.controlBuf.put(&ping{true})
|
||||
}
|
||||
|
||||
func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) {
|
||||
@ -719,6 +719,10 @@ func (t *http2Client) controller() {
|
||||
t.framer.writeRSTStream(true, i.streamID, i.code)
|
||||
case *flushIO:
|
||||
t.framer.flushWrite()
|
||||
case *ping:
|
||||
// TODO(zhaoq): Ack with all-0 data now. will change to some
|
||||
// meaningful content when this is actually in use.
|
||||
t.framer.writePing(true, i.ack, [8]byte{})
|
||||
default:
|
||||
log.Printf("transport: http2Client.controller got unexpected item type %v\n", i)
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ func (t *http2Server) handleSettings(f *http2.SettingsFrame) {
|
||||
}
|
||||
|
||||
func (t *http2Server) handlePing(f *http2.PingFrame) {
|
||||
// TODO(zhaoq): PingFrame handler to be implemented
|
||||
t.controlBuf.put(&ping{true})
|
||||
}
|
||||
|
||||
func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) {
|
||||
@ -609,6 +609,10 @@ func (t *http2Server) controller() {
|
||||
t.framer.writeRSTStream(true, i.streamID, i.code)
|
||||
case *flushIO:
|
||||
t.framer.flushWrite()
|
||||
case *ping:
|
||||
// TODO(zhaoq): Ack with all-0 data now. will change to some
|
||||
// meaningful content when this is actually in use.
|
||||
t.framer.writePing(true, i.ack, [8]byte{})
|
||||
default:
|
||||
log.Printf("transport: http2Server.controller got unexpected item type %v\n", i)
|
||||
}
|
||||
|
Reference in New Issue
Block a user