| 3099 | } |
| 3100 | |
| 3101 | func (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 | |
| 3122 | func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error { |
| 3123 | // We told the peer we don't want them. |