MCPcopy Create free account
hub / github.com/imroc/req / processPing

Method processPing

internal/http2/transport.go:3101–3120  ·  view source on GitHub ↗
(f *PingFrame)

Source from the content-addressed store, hash-verified

3099}
3100
3101func (rl *clientConnReadLoop) processPing(f *PingFrame) error {
3102 if f.IsAck() {
3103 cc := rl.cc
3104 cc.mu.Lock()
3105 defer cc.mu.Unlock()
3106 // If ack, notify listener if any
3107 if c, ok := cc.pings[f.Data]; ok {
3108 close(c)
3109 delete(cc.pings, f.Data)
3110 }
3111 return nil
3112 }
3113 cc := rl.cc
3114 cc.wmu.Lock()
3115 defer cc.wmu.Unlock()
3116 if err := cc.fr.WritePing(true, f.Data); err != nil {
3117 return err
3118 }
3119 return cc.bw.Flush()
3120}
3121
3122func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error {
3123 // We told the peer we don't want them.

Callers 1

runMethod · 0.95

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
WritePingMethod · 0.80
IsAckMethod · 0.45

Tested by

no test coverage detected