threadshare: Update to socket2 0.4

This commit is contained in:
Sebastian Dröge 2021-03-21 12:57:10 +02:00
parent d9e727050c
commit b919d226b1
4 changed files with 20 additions and 16 deletions

View file

@ -124,6 +124,13 @@ version = "0.3"
name = "ansi_term"
version = "0.11"
# ignore duplicated socket2 dependency because hyper and miow depend on an old version
# https://github.com/yoshuawuyts/miow/pull/44
# https://github.com/hyperium/hyper/pull/2472
[[bans.skip]]
name = "socket2"
version = "0.3"
[sources]
unknown-registry = "deny"
unknown-git = "deny"

View file

@ -19,14 +19,11 @@ once_cell = "1"
tokio = { git = "https://github.com/fengalin/tokio", tag = "tokio-0.2.13-throttling", features = ["io-util", "macros", "rt-core", "sync", "stream", "time", "tcp", "udp", "rt-util"] }
futures = { version = "0.3", features = ["thread-pool"] }
rand = "0.8"
socket2 = "0.3"
socket2 = {features = ["all"], version = "0.4"}
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["winsock2", "processthreadsapi"] }
[target.'cfg(unix)'.dependencies]
socket2 = { version = "0.3", features = ["reuseport"] }
[dev-dependencies]
gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }
gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" }

View file

@ -778,14 +778,14 @@ impl UdpSink {
let socket = match family {
SocketFamily::Ipv4 => socket2::Socket::new(
socket2::Domain::ipv4(),
socket2::Type::dgram(),
Some(socket2::Protocol::udp()),
socket2::Domain::IPV4,
socket2::Type::DGRAM,
Some(socket2::Protocol::UDP),
),
SocketFamily::Ipv6 => socket2::Socket::new(
socket2::Domain::ipv6(),
socket2::Type::dgram(),
Some(socket2::Protocol::udp()),
socket2::Domain::IPV6,
socket2::Type::DGRAM,
Some(socket2::Protocol::UDP),
),
};

View file

@ -511,15 +511,15 @@ impl UdpSrc {
let socket = if addr.is_ipv4() {
socket2::Socket::new(
socket2::Domain::ipv4(),
socket2::Type::dgram(),
Some(socket2::Protocol::udp()),
socket2::Domain::IPV4,
socket2::Type::DGRAM,
Some(socket2::Protocol::UDP),
)
} else {
socket2::Socket::new(
socket2::Domain::ipv6(),
socket2::Type::dgram(),
Some(socket2::Protocol::udp()),
socket2::Domain::IPV6,
socket2::Type::DGRAM,
Some(socket2::Protocol::UDP),
)
}
.map_err(|err| {