1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

TEST: Upgrade pion to v3.2.9. (#3567)

------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
Winlin 2023-06-05 11:25:04 +08:00 committed by GitHub
parent 104cf14d68
commit df854339ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1383 changed files with 118469 additions and 41421 deletions

View file

@ -22,3 +22,4 @@ cover.out
*.wasm
examples/sfu-ws/cert.pem
examples/sfu-ws/key.pem
wasm_exec.js

View file

@ -15,14 +15,22 @@ linters-settings:
linters:
enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences
- bodyclose # checks whether HTTP response body is closed successfully
- contextcheck # check the function whether use a non-inherited context
- deadcode # Finds unused code
- decorder # check declaration order and count of types, constants, variables and functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- dupl # Tool for code clone detection
- durationcheck # check for two durations multiplied together
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted.
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
- exhaustive # check exhaustiveness of enum switch statements
- exportloopref # checks for pointers to enclosing loop variables
- forcetypeassert # finds forced type assertions
- gci # Gci control golang package import order and make it always deterministic.
- gochecknoglobals # Checks that no globals are present in Go code
- gochecknoinits # Checks that no init functions are present in Go code
@ -35,40 +43,62 @@ linters:
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- goheader # Checks is file header matches to pattern
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
- gosec # Inspects source code for security problems
- gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- grouper # An analyzer to analyze expression groups.
- importas # Enforces consistent import aliases
- ineffassign # Detects when assignments to existing variables are not used
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
- noctx # noctx finds sending http request without context.Context
- scopelint # Scopelint checks for unpinned variables in go programs
- predeclared # find code that shadows one of Go's predeclared identifiers
- revive # golint replacement, finds style mistakes
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- structcheck # Finds unused struct fields
- stylecheck # Stylecheck is a replacement for golint
- tagliatelle # Checks the struct tags.
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- unused # Checks Go code for unused constants, variables, functions and types
- varcheck # Finds unused global variables and constants
- wastedassign # wastedassign finds wasted assignment statements
- whitespace # Tool for detection of leading and trailing whitespace
disable:
- containedctx # containedctx is a linter that detects struct contained context.Context field
- cyclop # checks function and package cyclomatic complexity
- exhaustivestruct # Checks if all struct's fields are initialized
- forbidigo # Forbids identifiers
- funlen # Tool for detection of long functions
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- gomnd # An analyzer to detect magic numbers.
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
- ireturn # Accept Interfaces, Return Concrete Types
- lll # Reports long lines
- maintidx # maintidx measures the maintainability index of each function.
- makezero # Finds slice declarations with non-zero initial length
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
- nestif # Reports deeply nested if statements
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
- nolintlint # Reports ill-formed or insufficient nolint directives
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
- prealloc # Finds slice declarations that could potentially be preallocated
- promlinter # Check Prometheus metrics naming via promlint
- rowserrcheck # checks whether Err of rows is checked successfully
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
- testpackage # linter that makes you use a separate _test package
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- varnamelen # checks that the length of a variable's name matches its scope
- wrapcheck # Checks that errors returned from external packages are wrapped
- wsl # Whitespace Linter - Forces you to use empty lines!
issues:

View file

@ -0,0 +1,32 @@
# Thank you to everyone that made Pion possible. If you are interested in contributing
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
#
# This file is auto generated, using git to list all individuals contributors.
# see `.github/generate-authors.sh` for the scripting
adwpc <adwpc@hotmail.com>
Atsushi Watanabe <atsushi.w@ieee.org>
backkem <mail@backkem.me>
Brendan Abolivier <babolivier@matrix.org>
chenkaiC4 <chenkaic4@gmail.com>
cnderrauber <zengjie9004@gmail.com>
Daniele Sluijters <daenney@users.noreply.github.com>
Graham King <graham@gkgk.org>
Guilherme <gqgs@protonmail.com>
Hugo Arregui <hugo.arregui@gmail.com>
Jason <jabrady42@gmail.com>
Jerko Steiner <jerko.steiner@gmail.com>
John Bradley <jrb@turrettech.com>
Konstantin Itskov <konstantin.itskov@kovits.com>
korymiller1489 <kmiller@unwiredrevolution.com>
Luke S <luke@street.dev>
Max Hawkins <maxhawkins@gmail.com>
Maxim Oransky <maxim.oransky@gmail.com>
mchlrhw <4028654+mchlrhw@users.noreply.github.com>
Michael MacDonald <mike.macdonald@savantsystems.com>
Mustafa Navruz <mustafanavruz@gmail.com>
Roman Romanenko <romandafe94@gmail.com>
Sean DuBois <seaduboi@amazon.com>
Sean DuBois <sean@siobud.com>
tarrencev <tarrence13@gmail.com>
Woodrow Douglass <wdouglass@carnegierobotics.com>
ZHENK <chengzhenyang@gmail.com>

View file

@ -17,7 +17,6 @@
</p>
<br>
See [DESIGN.md](DESIGN.md) for an overview of features and future goals.
### Roadmap
The library is used as a part of our WebRTC implementation. Please refer to that [roadmap](https://github.com/pion/webrtc/issues/9) to track our major milestones.
@ -32,28 +31,5 @@ If you need commercial support or don't want to use public methods you can conta
### Contributing
Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contributing)** to join the group of amazing people making this project possible:
* [John Bradley](https://github.com/kc5nra) - *Original Author*
* [Sean DuBois](https://github.com/Sean-Der) - *Original Author*
* [Michiel De Backker](https://github.com/backkem) - *Public API, Initialization*
* [Konstantin Itskov](https://github.com/trivigy) - *Fix documentation*
* [chenkaiC4](https://github.com/chenkaiC4) - *Fix GolangCI Linter*
* [Woodrow Douglass](https://github.com/wdouglass) *RTCP, RTP improvements, G.722 support, Bugfixes*
* [Michael MacDonald](https://github.com/mjmac)
* [Max Hawkins](https://github.com/maxhawkins)
* [mchlrhw](https://github.com/mchlrhw)
* [Hugo Arregui](https://github.com/hugoArregui)
* [Guilherme Souza](https://github.com/gqgs)
* [adwpc](https://github.com/adwpc) - *extmap add transport-cc*
* [Atsushi Watanabe](https://github.com/at-wat)
* [Luke S](https://github.com/encounter)
* [Jerko Steiner](https://github.com/jeremija)
* [Roman Romanenko](https://github.com/r-novel)
* [Jason Brady](https://github.com/jbrady42)
* [Kory Miller](https://github.com/jbrady42/korymiller1489)
* [ZHENK](https://github.com/scorpionknifes)
* [Tarrence van As](https://github.com/tarrencev)
* [Maxim Oransky](https://github.com/sdfsdhgjkbmnmxc)
* [Graham King](https://github.com/grahamking/)
### License
MIT License - see [LICENSE](LICENSE) for full text

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io"
"strconv"
)
var errDocumentStart = errors.New("already on document start")
@ -17,8 +18,7 @@ func (e syntaxError) Error() string {
if e.i < 0 {
e.i = 0
}
head, middle, tail := e.s[:e.i], e.s[e.i:e.i+1], e.s[e.i+1:]
return fmt.Sprintf("%s --> %s <-- %s", head, middle, tail)
return fmt.Sprintf("sdp: syntax error at pos %d: %s", e.i, strconv.QuoteToASCII(e.s[e.i:e.i+1]))
}
type baseLexer struct {
@ -50,7 +50,7 @@ func (l *baseLexer) readByte() (byte, error) {
func (l *baseLexer) nextLine() error {
for {
ch, err := l.readByte()
if err == io.EOF {
if errors.Is(err, io.EOF) {
return nil
} else if err != nil {
return err
@ -64,7 +64,7 @@ func (l *baseLexer) nextLine() error {
func (l *baseLexer) readWhitespace() error {
for {
ch, err := l.readByte()
if err == io.EOF {
if errors.Is(err, io.EOF) {
return nil
} else if err != nil {
return err
@ -78,7 +78,7 @@ func (l *baseLexer) readWhitespace() error {
func (l *baseLexer) readUint64Field() (i uint64, err error) {
for {
ch, err := l.readByte()
if err == io.EOF && i > 0 {
if errors.Is(err, io.EOF) && i > 0 {
break
} else if err != nil {
return i, err
@ -130,11 +130,11 @@ func (l *baseLexer) readUint64Field() (i uint64, err error) {
// Returns next field on this line or empty string if no more fields on line
func (l *baseLexer) readField() (string, error) {
start := l.pos
stop := start
var stop int
for {
stop = l.pos
ch, err := l.readByte()
if err == io.EOF && stop > start {
if errors.Is(err, io.EOF) && stop > start {
break
} else if err != nil {
return "", err

View file

@ -1,3 +1,4 @@
//go:build gofuzz
// +build gofuzz
package sdp

View file

@ -1,8 +0,0 @@
module github.com/pion/sdp/v3
go 1.13
require (
github.com/pion/randutil v0.1.0
github.com/stretchr/testify v1.6.1
)

View file

@ -1,13 +0,0 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -9,24 +9,25 @@ import (
// Constants for SDP attributes used in JSEP
const (
AttrKeyCandidate = "candidate"
AttrKeyEndOfCandidates = "end-of-candidates"
AttrKeyIdentity = "identity"
AttrKeyGroup = "group"
AttrKeySSRC = "ssrc"
AttrKeySSRCGroup = "ssrc-group"
AttrKeyMsid = "msid"
AttrKeyMsidSemantic = "msid-semantic"
AttrKeyConnectionSetup = "setup"
AttrKeyMID = "mid"
AttrKeyICELite = "ice-lite"
AttrKeyRTCPMux = "rtcp-mux"
AttrKeyRTCPRsize = "rtcp-rsize"
AttrKeyInactive = "inactive"
AttrKeyRecvOnly = "recvonly"
AttrKeySendOnly = "sendonly"
AttrKeySendRecv = "sendrecv"
AttrKeyExtMap = "extmap"
AttrKeyCandidate = "candidate"
AttrKeyEndOfCandidates = "end-of-candidates"
AttrKeyIdentity = "identity"
AttrKeyGroup = "group"
AttrKeySSRC = "ssrc"
AttrKeySSRCGroup = "ssrc-group"
AttrKeyMsid = "msid"
AttrKeyMsidSemantic = "msid-semantic"
AttrKeyConnectionSetup = "setup"
AttrKeyMID = "mid"
AttrKeyICELite = "ice-lite"
AttrKeyRTCPMux = "rtcp-mux"
AttrKeyRTCPRsize = "rtcp-rsize"
AttrKeyInactive = "inactive"
AttrKeyRecvOnly = "recvonly"
AttrKeySendOnly = "sendonly"
AttrKeySendRecv = "sendrecv"
AttrKeyExtMap = "extmap"
AttrKeyExtMapAllowMixed = "extmap-allow-mixed"
)
// Constants for semantic tokens used in JSEP

View file

@ -1,15 +1,27 @@
{
"extends": [
"config:base"
"config:base",
":disableDependencyDashboard"
],
"postUpdateOptions": [
"gomodTidy"
],
"commitBody": "Generated by renovateBot",
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"packagePatterns": ["^golang.org/x/"],
"schedule": ["on the first day of the month"]
}
],
"ignorePaths": [
".github/workflows/generate-authors.yml",
".github/workflows/lint.yaml",
".github/workflows/renovate-go-mod-fix.yaml",
".github/workflows/test.yaml",
".github/workflows/tidy-check.yaml"
]
}

View file

@ -568,9 +568,11 @@ func unmarshalBandwidth(value string) (*Bandwidth, error) {
experimental := strings.HasPrefix(parts[0], "X-")
if experimental {
parts[0] = strings.TrimPrefix(parts[0], "X-")
} else if !anyOf(parts[0], "CT", "AS") {
} else if !anyOf(parts[0], "CT", "AS", "TIAS", "RS", "RR") {
// Set according to currently registered with IANA
// https://tools.ietf.org/html/rfc4566#section-5.8
// https://tools.ietf.org/html/rfc3890#section-6.2
// https://tools.ietf.org/html/rfc3556#section-2
return nil, fmt.Errorf("%w `%v`", errSDPInvalidValue, parts[0])
}
@ -767,8 +769,9 @@ func unmarshalMediaDescription(l *lexer) (stateFn, error) {
// Set according to currently registered with IANA
// https://tools.ietf.org/html/rfc4566#section-5.14
// https://tools.ietf.org/html/rfc4975#section-8.1
for _, proto := range strings.Split(field, "/") {
if !anyOf(proto, "UDP", "RTP", "AVP", "SAVP", "SAVPF", "TLS", "DTLS", "SCTP", "AVPF") {
if !anyOf(proto, "UDP", "RTP", "AVP", "SAVP", "SAVPF", "TLS", "DTLS", "SCTP", "AVPF", "TCP", "MSRP") {
return nil, fmt.Errorf("%w `%v`", errSDPInvalidNumericValue, field)
}
newMediaDesc.MediaName.Protos = append(newMediaDesc.MediaName.Protos, proto)

View file

@ -98,7 +98,7 @@ func parseRtpmap(rtpmap string) (Codec, error) {
return codec, parsingFailed
}
ptInt, err := strconv.Atoi(ptSplit[1])
ptInt, err := strconv.ParseUint(ptSplit[1], 10, 8)
if err != nil {
return codec, parsingFailed
}
@ -109,7 +109,7 @@ func parseRtpmap(rtpmap string) (Codec, error) {
codec.Name = split[0]
parts := len(split)
if parts > 1 {
rate, err := strconv.Atoi(split[1])
rate, err := strconv.ParseUint(split[1], 10, 32)
if err != nil {
return codec, parsingFailed
}
@ -139,7 +139,7 @@ func parseFmtp(fmtp string) (Codec, error) {
return codec, parsingFailed
}
ptInt, err := strconv.Atoi(split[1])
ptInt, err := strconv.ParseUint(split[1], 10, 8)
if err != nil {
return codec, parsingFailed
}
@ -165,7 +165,7 @@ func parseRtcpFb(rtcpFb string) (Codec, error) {
return codec, parsingFailed
}
ptInt, err := strconv.Atoi(ptSplit[1])
ptInt, err := strconv.ParseUint(ptSplit[1], 10, 8)
if err != nil {
return codec, parsingFailed
}
@ -304,8 +304,8 @@ type keyToState func(key string) stateFn
func (l *lexer) handleType(fn keyToState) (stateFn, error) {
key, err := l.readType()
if err == io.EOF && key == "" {
return nil, nil
if errors.Is(err, io.EOF) && key == "" {
return nil, nil //nolint:nilnil
} else if err != nil {
return nil, err
}