more checks for watch os version

This commit is contained in:
Arseny Smirnov 2021-03-27 11:02:32 +03:00
parent 079c9919d2
commit a51b63afdd
2 changed files with 10 additions and 0 deletions

View File

@ -74,6 +74,9 @@ Status Wget::try_init() {
TRY_STATUS(addr.init_host_port(url.host_, url.port_, prefer_ipv6_)); TRY_STATUS(addr.init_host_port(url.host_, url.port_, prefer_ipv6_));
TRY_RESULT(fd, SocketFd::open(addr)); TRY_RESULT(fd, SocketFd::open(addr));
if (fd.empty()) {
return td::Status::Error("Sockets are not supported");
}
if (url.protocol_ == HttpUrl::Protocol::Http) { if (url.protocol_ == HttpUrl::Protocol::Http) {
connection_ = create_actor<HttpOutboundConnection>("Connect", std::move(fd), SslStream{}, connection_ = create_actor<HttpOutboundConnection>("Connect", std::move(fd), SslStream{},
std::numeric_limits<std::size_t>::max(), 0, 0, std::numeric_limits<std::size_t>::max(), 0, 0,

View File

@ -629,29 +629,36 @@ bool SocketFd::empty() const {
} }
PollableFdInfo &SocketFd::get_poll_info() { PollableFdInfo &SocketFd::get_poll_info() {
CHECK(!empty());
return impl_->get_poll_info(); return impl_->get_poll_info();
} }
const PollableFdInfo &SocketFd::get_poll_info() const { const PollableFdInfo &SocketFd::get_poll_info() const {
CHECK(!empty());
return impl_->get_poll_info(); return impl_->get_poll_info();
} }
const NativeFd &SocketFd::get_native_fd() const { const NativeFd &SocketFd::get_native_fd() const {
CHECK(!empty());
return impl_->get_native_fd(); return impl_->get_native_fd();
} }
Status SocketFd::get_pending_error() { Status SocketFd::get_pending_error() {
CHECK(!empty());
return impl_->get_pending_error(); return impl_->get_pending_error();
} }
Result<size_t> SocketFd::write(Slice slice) { Result<size_t> SocketFd::write(Slice slice) {
CHECK(!empty());
return impl_->write(slice); return impl_->write(slice);
} }
Result<size_t> SocketFd::writev(Span<IoSlice> slices) { Result<size_t> SocketFd::writev(Span<IoSlice> slices) {
CHECK(!empty());
return impl_->writev(slices); return impl_->writev(slices);
} }
Result<size_t> SocketFd::read(MutableSlice slice) { Result<size_t> SocketFd::read(MutableSlice slice) {
CHECK(!empty());
return impl_->read(slice); return impl_->read(slice);
} }