Ai
10 Star 41 Fork 20

Gitee 极速下载/Pion-WebRTC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/pion/webrtc
克隆/下载
chunk_cookie_echo.go 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
John Bradley 提交于 2018-07-20 07:18 +08:00 . Fix bug in cookie echo unmarshalling, style
package sctp
import (
"github.com/pkg/errors"
)
/*
CookieEcho represents an SCTP Chunk of type CookieEcho
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = 10 |Chunk Flags | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cookie |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
type chunkCookieEcho struct {
chunkHeader
cookie []byte
}
func (c *chunkCookieEcho) unmarshal(raw []byte) error {
if err := c.chunkHeader.unmarshal(raw); err != nil {
return err
}
if c.typ != COOKIEECHO {
return errors.Errorf("ChunkType is not of type COOKIEECHO, actually is %s", c.typ.String())
}
c.cookie = c.raw
return nil
}
func (c *chunkCookieEcho) marshal() ([]byte, error) {
c.chunkHeader.typ = COOKIEECHO
c.chunkHeader.raw = c.cookie
return c.chunkHeader.marshal()
}
func (c *chunkCookieEcho) check() (abort bool, err error) {
return false, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/Pion-WebRTC.git
git@gitee.com:mirrors/Pion-WebRTC.git
mirrors
Pion-WebRTC
Pion-WebRTC
v1.1.1

搜索帮助