diff options
author | prout <prout@yandex-team.ru> | 2022-02-10 16:49:42 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:42 +0300 |
commit | 7b7fa28b9099b7adca890459a699c6ba5eeff4ca (patch) | |
tree | cffe238e08f715008f864d223dd0db8fc1f92f9f /util/network | |
parent | 0fd1998e1b2369f50fb694556f817d3c7fef10c8 (diff) | |
download | ydb-7b7fa28b9099b7adca890459a699c6ba5eeff4ca.tar.gz |
Restoring authorship annotation for <prout@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/network')
-rw-r--r-- | util/network/address.h | 6 | ||||
-rw-r--r-- | util/network/poller.cpp | 8 | ||||
-rw-r--r-- | util/network/pollerimpl.h | 56 | ||||
-rw-r--r-- | util/network/socket.cpp | 8 |
4 files changed, 39 insertions, 39 deletions
diff --git a/util/network/address.h b/util/network/address.h index 448fcac0c9..47e20fb2a2 100644 --- a/util/network/address.h +++ b/util/network/address.h @@ -91,7 +91,7 @@ namespace NAddr { } private: - const addrinfo* const AI_; + const addrinfo* const AI_; }; //compat, for TIpAddress @@ -111,7 +111,7 @@ namespace NAddr { } private: - const TIpAddress A_; + const TIpAddress A_; }; //same, for ipv6 addresses @@ -131,6 +131,6 @@ namespace NAddr { } private: - const sockaddr_in6 A_; + const sockaddr_in6 A_; }; } diff --git a/util/network/poller.cpp b/util/network/poller.cpp index 7954d0e8b5..932d5c4071 100644 --- a/util/network/poller.cpp +++ b/util/network/poller.cpp @@ -49,10 +49,10 @@ void TSocketPoller::WaitWrite(SOCKET sock, void* cookie) { Impl_->Set(cookie, sock, CONT_POLL_WRITE); } -void TSocketPoller::WaitReadWrite(SOCKET sock, void* cookie) { - Impl_->Set(cookie, sock, CONT_POLL_READ | CONT_POLL_WRITE); -} - +void TSocketPoller::WaitReadWrite(SOCKET sock, void* cookie) { + Impl_->Set(cookie, sock, CONT_POLL_READ | CONT_POLL_WRITE); +} + void TSocketPoller::WaitRdhup(SOCKET sock, void* cookie) { Impl_->Set(cookie, sock, CONT_POLL_RDHUP); } diff --git a/util/network/pollerimpl.h b/util/network/pollerimpl.h index e8c7e40fba..7bc6900289 100644 --- a/util/network/pollerimpl.h +++ b/util/network/pollerimpl.h @@ -160,29 +160,29 @@ public: } static inline int ExtractStatus(const TEvent* event) noexcept { - if (event->flags & EV_ERROR) { - return EIO; - } - + if (event->flags & EV_ERROR) { + return EIO; + } + return event->fflags; } static inline int ExtractFilterImpl(const TEvent* event) noexcept { if (event->filter == EVFILT_READ) { - return CONT_POLL_READ; - } - - if (event->filter == EVFILT_WRITE) { - return CONT_POLL_WRITE; - } + return CONT_POLL_READ; + } + if (event->filter == EVFILT_WRITE) { + return CONT_POLL_WRITE; + } + if (event->flags & EV_EOF) { return CONT_POLL_READ | CONT_POLL_WRITE; } - return 0; - } - + return 0; + } + private: int Fd_; }; @@ -287,23 +287,23 @@ public: } static inline int ExtractFilterImpl(const TEvent* event) noexcept { - int ret = 0; - - if (event->events & EPOLLIN) { - ret |= CONT_POLL_READ; - } - - if (event->events & EPOLLOUT) { - ret |= CONT_POLL_WRITE; - } - + int ret = 0; + + if (event->events & EPOLLIN) { + ret |= CONT_POLL_READ; + } + + if (event->events & EPOLLOUT) { + ret |= CONT_POLL_WRITE; + } + if (event->events & EPOLLRDHUP) { ret |= CONT_POLL_RDHUP; } - return ret; - } - + return ret; + } + private: int Fd_; }; @@ -585,8 +585,8 @@ public: static inline int ExtractFilterImpl(const TEvent* event) noexcept { return event->Filter(); - } - + } + private: inline void Signal() noexcept { char ch = 13; diff --git a/util/network/socket.cpp b/util/network/socket.cpp index 4f6e804346..bd7d2dd867 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -1008,7 +1008,7 @@ public: struct addrinfo hints; memset(&hints, 0, sizeof(hints)); - + hints.ai_flags = flags; hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; @@ -1071,9 +1071,9 @@ TNetworkAddress::TNetworkAddress(const TUnixSocketPath& unixSocketPath, int flag TNetworkAddress::TNetworkAddress(const TString& host, ui16 port, int flags) : Impl_(new TImpl(host.data(), port, flags)) -{ -} - +{ +} + TNetworkAddress::TNetworkAddress(const TString& host, ui16 port) : Impl_(new TImpl(host.data(), port, 0)) { |