Setting returns the setting from the frame at the given 0-based index. The index must be >= 0 and less than f.NumSettings().
(i int)
| 826 | // Setting returns the setting from the frame at the given 0-based index. |
| 827 | // The index must be >= 0 and less than f.NumSettings(). |
| 828 | func (f *SettingsFrame) Setting(i int) http2.Setting { |
| 829 | buf := f.p |
| 830 | return http2.Setting{ |
| 831 | ID: http2.SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])), |
| 832 | Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]), |
| 833 | } |
| 834 | } |
| 835 | |
| 836 | func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 } |
| 837 |