aboutsummaryrefslogtreecommitdiffstats
path: root/util/network
diff options
context:
space:
mode:
authortejblum <tejblum@yandex-team.ru>2022-02-10 16:48:02 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:02 +0300
commit2bf39531b4f50b889e946ac4866018678a4fb281 (patch)
tree65ee082892af9db55f726e13950abf0b1cc65992 /util/network
parenta61e8c559b6b690a019253067224d595e3d642f1 (diff)
downloadydb-2bf39531b4f50b889e946ac4866018678a4fb281.tar.gz
Restoring authorship annotation for <tejblum@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/network')
-rw-r--r--util/network/poller.h6
-rw-r--r--util/network/socket.cpp28
2 files changed, 17 insertions, 17 deletions
diff --git a/util/network/poller.h b/util/network/poller.h
index 8dccd731407..37873e911a4 100644
--- a/util/network/poller.h
+++ b/util/network/poller.h
@@ -1,10 +1,10 @@
#pragma once
-
+
#include "socket.h"
#include <util/generic/ptr.h>
#include <util/datetime/base.h>
-
+
class TSocketPoller {
public:
TSocketPoller();
@@ -55,4 +55,4 @@ public:
private:
class TImpl;
THolder<TImpl> Impl_;
-};
+};
diff --git a/util/network/socket.cpp b/util/network/socket.cpp
index 4f6e8043462..d9266af5465 100644
--- a/util/network/socket.cpp
+++ b/util/network/socket.cpp
@@ -64,16 +64,16 @@ int inet_aton(const char* cp, struct in_addr* inp) {
#if (_WIN32_WINNT < 0x0600)
const char* inet_ntop(int af, const void* src, char* dst, socklen_t size) {
if (af != AF_INET) {
- errno = EINVAL;
- return 0;
- }
- const ui8* ia = (ui8*)src;
- if (snprintf(dst, size, "%u.%u.%u.%u", ia[0], ia[1], ia[2], ia[3]) >= (int)size) {
- errno = ENOSPC;
- return 0;
- }
- return dst;
-}
+ errno = EINVAL;
+ return 0;
+ }
+ const ui8* ia = (ui8*)src;
+ if (snprintf(dst, size, "%u.%u.%u.%u", ia[0], ia[1], ia[2], ia[3]) >= (int)size) {
+ errno = ENOSPC;
+ return 0;
+ }
+ return dst;
+}
struct evpair {
int event;
@@ -242,13 +242,13 @@ int poll(struct pollfd fds[], nfds_t nfds, int timeout) noexcept {
bool GetRemoteAddr(SOCKET Socket, char* str, socklen_t size) {
if (!size) {
- return false;
+ return false;
}
TOpaqueAddr addr;
if (getpeername(Socket, addr.MutableAddr(), addr.LenPtr()) != 0) {
- return false;
+ return false;
}
try {
@@ -263,8 +263,8 @@ bool GetRemoteAddr(SOCKET Socket, char* str, socklen_t size) {
}
return false;
-}
-
+}
+
void SetSocketTimeout(SOCKET s, long timeout) {
SetSocketTimeout(s, timeout, 0);
}