fix parsing of transport headers with empty source (https://github.com/aler9/rtsp-simple-server/issues/986)

This commit is contained in:
aler9
2022-06-11 11:54:51 +02:00
parent 0101ad961c
commit 1fd66bdaed
2 changed files with 35 additions and 13 deletions

View File

@@ -198,6 +198,24 @@ var casesTransport = []struct {
}(),
},
},
{
"empty source",
base.HeaderValue{`RTP/AVP/UDP;unicast;source=;client_port=32560-32561;server_port=3046-3047;ssrc=45dcb578`},
base.HeaderValue{`RTP/AVP;unicast;client_port=32560-32561;server_port=3046-3047;ssrc=45DCB578`},
Transport{
Protocol: TransportProtocolUDP,
Delivery: func() *TransportDelivery {
v := TransportDeliveryUnicast
return &v
}(),
SSRC: func() *uint32 {
v := uint32(0x45dcb578)
return &v
}(),
ClientPorts: &[2]int{32560, 32561},
ServerPorts: &[2]int{3046, 3047},
},
},
}
func TestTransportRead(t *testing.T) {