diff options
author | nocomer <nocomer@yandex-team.ru> | 2022-02-10 16:51:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:48 +0300 |
commit | df2933eb0ef860ea5a47e630dfa493fd7171ff38 (patch) | |
tree | ab7fbbf3253d4c0e2793218f09378908beb025fb /util/network/socket.cpp | |
parent | 98445ce16e046ec9528200234bd53fcf7f9aa61b (diff) | |
download | ydb-df2933eb0ef860ea5a47e630dfa493fd7171ff38.tar.gz |
Restoring authorship annotation for <nocomer@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/network/socket.cpp')
-rw-r--r-- | util/network/socket.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/util/network/socket.cpp b/util/network/socket.cpp index fe4e6eab2c..4f6e804346 100644 --- a/util/network/socket.cpp +++ b/util/network/socket.cpp @@ -523,18 +523,18 @@ static int MsgPeek(SOCKET s) { } bool IsNotSocketClosedByOtherSide(SOCKET s) { - return HasSocketDataToRead(s) != ESocketReadStatus::SocketClosed; -} - -ESocketReadStatus HasSocketDataToRead(SOCKET s) { + return HasSocketDataToRead(s) != ESocketReadStatus::SocketClosed; +} + +ESocketReadStatus HasSocketDataToRead(SOCKET s) { const int r = MsgPeek(s); - if (r == -1 && IsBlocked(LastSystemError())) { - return ESocketReadStatus::NoData; - } - if (r > 0) { - return ESocketReadStatus::HasData; - } - return ESocketReadStatus::SocketClosed; + if (r == -1 && IsBlocked(LastSystemError())) { + return ESocketReadStatus::NoData; + } + if (r > 0) { + return ESocketReadStatus::HasData; + } + return ESocketReadStatus::SocketClosed; } #if defined(_win_) |