diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/actors/interconnect | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors/interconnect')
9 files changed, 53 insertions, 53 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_handshake.cpp b/library/cpp/actors/interconnect/interconnect_handshake.cpp index 9ede998d8e..2f0399fd9e 100644 --- a/library/cpp/actors/interconnect/interconnect_handshake.cpp +++ b/library/cpp/actors/interconnect/interconnect_handshake.cpp @@ -128,7 +128,7 @@ namespace NActors { Y_VERIFY(Socket); PeerAddr = TString::Uninitialized(1024); if (GetRemoteAddr(*Socket, PeerAddr.Detach(), PeerAddr.size())) { - PeerAddr.resize(strlen(PeerAddr.data())); + PeerAddr.resize(strlen(PeerAddr.data())); } else { PeerAddr.clear(); } @@ -223,7 +223,7 @@ namespace NActors { void ProcessUnexpectedEvent(TAutoPtr<IEventHandle> ev) override { switch (const ui32 type = ev->GetTypeRewrite()) { case TEvents::TSystem::Wakeup: - Fail(TEvHandshakeFail::HANDSHAKE_FAIL_TRANSIENT, Sprintf("Handshake timed out, State# %s", State.data()), true); + Fail(TEvHandshakeFail::HANDSHAKE_FAIL_TRANSIENT, Sprintf("Handshake timed out, State# %s", State.data()), true); [[fallthrough]]; case ui32(ENetwork::NodeInfo): @@ -318,7 +318,7 @@ namespace NActors { } } if (!matching) { - errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", uuid->data(), formatList(Common->AcceptUUID).data())); + errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", uuid->data(), formatList(Common->AcceptUUID).data())); } } return; // remote side did not fill in this field -- old version, symmetric protocol is not supported @@ -342,7 +342,7 @@ namespace NActors { } // no match - errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", remoteUUID.data(), formatList(Common->AcceptUUID).data())); + errorCallback(Sprintf("Peer ClusterUUID# %s mismatch, AcceptUUID# %s", remoteUUID.data(), formatList(Common->AcceptUUID).data())); } void ParsePeerScopeId(const NActorsInterconnect::TScopeId& proto) { @@ -562,7 +562,7 @@ namespace NActors { // extract peer node id from the peer PeerNodeId = request.Header.SelfVirtualId.NodeId(); if (!PeerNodeId) { - Y_VERIFY_DEBUG(false, "PeerNodeId is zero request# %s", request.ToString().data()); + Y_VERIFY_DEBUG(false, "PeerNodeId is zero request# %s", request.ToString().data()); Fail(TEvHandshakeFail::HANDSHAKE_FAIL_PERMANENT, "SelfVirtualId.NodeId is empty in initial packet"); } UpdatePrefix(); @@ -646,8 +646,8 @@ namespace NActors { generateError(Sprintf("Incorrect ReceiverNodeId# %" PRIu32 " from the peer, expected# %" PRIu32, request.GetReceiverNodeId(), SelfActorId.NodeId())); } else if (request.GetReceiverHostName() != Common->TechnicalSelfHostName) { - generateError(Sprintf("ReceiverHostName# %s mismatch, expected# %s", request.GetReceiverHostName().data(), - Common->TechnicalSelfHostName.data())); + generateError(Sprintf("ReceiverHostName# %s mismatch, expected# %s", request.GetReceiverHostName().data(), + Common->TechnicalSelfHostName.data())); } ValidateVersionTag(request, generateError); diff --git a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp index 0abe9fe659..01e3ecb24c 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_input_session.cpp @@ -36,7 +36,7 @@ namespace NActors { } void TInputSessionTCP::Bootstrap() { - SetPrefix(Sprintf("InputSession %s [node %" PRIu32 "]", SelfId().ToString().data(), NodeId)); + SetPrefix(Sprintf("InputSession %s [node %" PRIu32 "]", SelfId().ToString().data(), NodeId)); Become(&TThis::WorkingState, DeadPeerTimeout, new TEvCheckDeadPeer); LOG_DEBUG_IC_SESSION("ICIS01", "InputSession created"); LastReceiveTimestamp = TActivationContext::Now(); @@ -371,7 +371,7 @@ namespace NActors { : recvres == 0 ? "connection closed by peer" : err ? err : Sprintf("socket: %s", strerror(-recvres)); - LOG_NOTICE_NET(NodeId, "%s", message.data()); + LOG_NOTICE_NET(NodeId, "%s", message.data()); ReestablishConnection(CloseInputSessionRequested ? TDisconnectReason::Debug() : recvres == 0 ? TDisconnectReason::EndOfStream() : TDisconnectReason::FromErrno(-recvres)); } else if (PollerToken && !std::exchange(Context->ReadPending, true)) { diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp index 7e2d8ccb94..3ddc50129d 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.cpp @@ -37,7 +37,7 @@ namespace NActors { } void TInterconnectProxyTCP::Bootstrap() { - SetPrefix(Sprintf("Proxy %s [node %" PRIu32 "]", SelfId().ToString().data(), PeerNodeId)); + SetPrefix(Sprintf("Proxy %s [node %" PRIu32 "]", SelfId().ToString().data(), PeerNodeId)); SwitchToInitialState(); PassAwayTimestamp = TActivationContext::Now() + TDuration::Seconds(15); @@ -197,7 +197,7 @@ namespace NActors { if (OutgoingHandshakeActor && SelfId().NodeId() < PeerNodeId) { // Both outgoing and incoming handshake are in progress. To prevent race condition during semultanous handshake // incoming handshake must be held till outgoing handshake is complete or failed - LOG_DEBUG_IC("ICP06", "reply for incoming handshake (actor %s) is held", IncomingHandshakeActor.ToString().data()); + LOG_DEBUG_IC("ICP06", "reply for incoming handshake (actor %s) is held", IncomingHandshakeActor.ToString().data()); HeldHandshakeReply = std::move(event); // Check that we are in one of acceptable states that would properly handle handshake statuses. @@ -227,19 +227,19 @@ namespace NActors { TEvHandshakeAsk *msg = ev->Get(); // TEvHandshakeAsk is only applicable for continuation requests - LOG_DEBUG_IC("ICP09", "(actor %s) from: %s for: %s", ev->Sender.ToString().data(), - ev->Get()->Self.ToString().data(), ev->Get()->Peer.ToString().data()); + LOG_DEBUG_IC("ICP09", "(actor %s) from: %s for: %s", ev->Sender.ToString().data(), + ev->Get()->Self.ToString().data(), ev->Get()->Peer.ToString().data()); if (!Session) { // if there is no open session, report error -- continuation request works only with open sessions LOG_NOTICE_IC("ICP12", "(actor %s) peer tries to resume nonexistent session Self# %s Peer# %s", - ev->Sender.ToString().data(), msg->Self.ToString().data(), msg->Peer.ToString().data()); + ev->Sender.ToString().data(), msg->Self.ToString().data(), msg->Peer.ToString().data()); } else if (SessionVirtualId != ev->Get()->Peer || RemoteSessionVirtualId != ev->Get()->Self) { // check session virtual ids for continuation LOG_NOTICE_IC("ICP13", "(actor %s) virtual id mismatch with existing session (Peer: %s Self: %s" - " SessionVirtualId: %s RemoteSessionVirtualId: %s)", ev->Sender.ToString().data(), - ev->Get()->Peer.ToString().data(), ev->Get()->Self.ToString().data(), SessionVirtualId.ToString().data(), - RemoteSessionVirtualId.ToString().data()); + " SessionVirtualId: %s RemoteSessionVirtualId: %s)", ev->Sender.ToString().data(), + ev->Get()->Peer.ToString().data(), ev->Get()->Self.ToString().data(), SessionVirtualId.ToString().data(), + RemoteSessionVirtualId.ToString().data()); } else { // if we already have incoming handshake, then terminate existing one DropIncomingHandshake(); @@ -256,7 +256,7 @@ namespace NActors { void TInterconnectProxyTCP::IncomingHandshake(TEvHandshakeRequest::TPtr& ev) { ICPROXY_PROFILED; - LOG_DEBUG_IC("ICP17", "incoming handshake (actor %s)", ev->Sender.ToString().data()); + LOG_DEBUG_IC("ICP17", "incoming handshake (actor %s)", ev->Sender.ToString().data()); const auto& record = ev->Get()->Record; ui64 remotePID = record.GetProgramPID(); @@ -265,7 +265,7 @@ namespace NActors { if (RemoteProgramInfo && remotePID == RemoteProgramInfo->PID && remoteStartTime == RemoteProgramInfo->StartTime) { if (remoteSerial < RemoteProgramInfo->Serial) { - LOG_INFO_IC("ICP18", "handshake (actor %s) is too old", ev->Sender.ToString().data()); + LOG_INFO_IC("ICP18", "handshake (actor %s) is too old", ev->Sender.ToString().data()); Send(ev->Sender, new TEvents::TEvPoisonPill); return; } else { @@ -290,13 +290,13 @@ namespace NActors { const ui64 serial = record.GetSerial(); if (serial < *LastSerialFromIncomingHandshake) { LOG_NOTICE_IC("ICP15", "Handshake# %s has duplicate serial# %" PRIu64 - " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(), + " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(), serial, *LastSerialFromIncomingHandshake); Send(ev->Sender, new TEvHandshakeReplyError("duplicate serial")); return; } else if (serial == *LastSerialFromIncomingHandshake) { LOG_NOTICE_IC("ICP15", "Handshake# %s is obsolete, serial# %" PRIu64 - " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(), + " LastSerialFromIncomingHandshake# %" PRIu64, ev->Sender.ToString().data(), serial, *LastSerialFromIncomingHandshake); Send(ev->Sender, new TEvents::TEvPoisonPill); return; @@ -368,7 +368,7 @@ namespace NActors { IActor::InvokeOtherActor(*Session, &TInterconnectSessionTCP::Init); SessionVirtualId = msg->Self; RemoteSessionVirtualId = msg->Peer; - LOG_INFO_IC("ICP22", "created new session: %s", SessionID.ToString().data()); + LOG_INFO_IC("ICP22", "created new session: %s", SessionID.ToString().data()); } // ensure that we have session local/peer virtual ids @@ -394,17 +394,17 @@ namespace NActors { if (ev->Sender == IncomingHandshakeActor) { LOG_NOTICE_IC("ICP24", "incoming handshake failed, temporary: %" PRIu32 " explanation: %s outgoing: %s", - ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), OutgoingHandshakeActor.ToString().data()); + ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), OutgoingHandshakeActor.ToString().data()); DropIncomingHandshake(false); } else if (ev->Sender == OutgoingHandshakeActor) { LOG_NOTICE_IC("ICP25", "outgoing handshake failed, temporary: %" PRIu32 " explanation: %s incoming: %s held: %s", - ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), IncomingHandshakeActor.ToString().data(), + ui32(ev->Get()->Temporary), ev->Get()->Explanation.data(), IncomingHandshakeActor.ToString().data(), HeldHandshakeReply ? "yes" : "no"); DropOutgoingHandshake(false); if (IEventBase* reply = HeldHandshakeReply.Release()) { Y_VERIFY(IncomingHandshakeActor); - LOG_DEBUG_IC("ICP26", "sent held handshake reply to %s", IncomingHandshakeActor.ToString().data()); + LOG_DEBUG_IC("ICP26", "sent held handshake reply to %s", IncomingHandshakeActor.ToString().data()); Send(IncomingHandshakeActor, reply); } @@ -532,8 +532,8 @@ namespace NActors { Y_VERIFY(Session && Session == session && SessionID); - LOG_INFO_IC("ICP30", "unregister session Session# %s VirtualId# %s", SessionID.ToString().data(), - SessionVirtualId.ToString().data()); + LOG_INFO_IC("ICP30", "unregister session Session# %s VirtualId# %s", SessionID.ToString().data(), + SessionVirtualId.ToString().data()); Session = nullptr; SessionID = TActorId(); @@ -739,7 +739,7 @@ namespace NActors { void TInterconnectProxyTCP::TransitToErrorState(TString explanation, bool updateErrorLog) { ICPROXY_PROFILED; - LOG_NOTICE_IC("ICP32", "transit to hold-by-error state Explanation# %s", explanation.data()); + LOG_NOTICE_IC("ICP32", "transit to hold-by-error state Explanation# %s", explanation.data()); LOG_INFO(*TlsActivationContext, NActorsServices::INTERCONNECT_STATUS, "[%u] error state: %s", PeerNodeId, explanation.data()); if (updateErrorLog) { diff --git a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h index 023e5bd1ee..2bea6c68c3 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_proxy.h +++ b/library/cpp/actors/interconnect/interconnect_tcp_proxy.h @@ -186,7 +186,7 @@ namespace NActors { ICPROXY_PROFILED; Y_VERIFY(!PendingSessionEvents && !PendingIncomingHandshakeEvents, "%s PendingSessionEvents# %zu" - " PendingIncomingHandshakeEvents# %zu State# %s", LogPrefix.data(), PendingSessionEvents.size(), + " PendingIncomingHandshakeEvents# %zu State# %s", LogPrefix.data(), PendingSessionEvents.size(), PendingIncomingHandshakeEvents.size(), State); SwitchToState(__LINE__, "PendingActivation", &TThis::PendingActivation); if (DynamicPtr && !PassAwayScheduled && PassAwayTimestamp != TInstant::Max()) { @@ -351,14 +351,14 @@ namespace NActors { TString msg = Sprintf("Event Type# 0x%08" PRIx32 " TypeRewrite# 0x%08" PRIx32 " from Sender# %s sent to the proxy for the node itself via Interconnect;" " THIS IS NOT A BUG IN INTERCONNECT, check the event sender instead", - ev->Type, ev->GetTypeRewrite(), ev->Sender.ToString().data()); - LOG_ERROR_IC("ICP03", "%s", msg.data()); - Y_VERIFY_DEBUG(false, "%s", msg.data()); + ev->Type, ev->GetTypeRewrite(), ev->Sender.ToString().data()); + LOG_ERROR_IC("ICP03", "%s", msg.data()); + Y_VERIFY_DEBUG(false, "%s", msg.data()); } Y_VERIFY(ev->GetTypeRewrite() != TEvInterconnect::EvForward || ev->Recipient.NodeId() == PeerNodeId, "Recipient/Proxy NodeId mismatch Recipient# %s Type# 0x%08" PRIx32 " PeerNodeId# %" PRIu32 " Func# %s", - ev->Recipient.ToString().data(), ev->Type, PeerNodeId, func); + ev->Recipient.ToString().data(), ev->Type, PeerNodeId, func); } // Common with helpers @@ -430,7 +430,7 @@ namespace NActors { ICPROXY_PROFILED; if (const TActorId& actorId = std::exchange(IncomingHandshakeActor, TActorId())) { - LOG_DEBUG_IC("ICP111", "dropped incoming handshake: %s poison: %s", actorId.ToString().data(), + LOG_DEBUG_IC("ICP111", "dropped incoming handshake: %s poison: %s", actorId.ToString().data(), poison ? "true" : "false"); if (poison) { Send(actorId, new TEvents::TEvPoisonPill); @@ -445,7 +445,7 @@ namespace NActors { ICPROXY_PROFILED; if (const TActorId& actorId = std::exchange(OutgoingHandshakeActor, TActorId())) { - LOG_DEBUG_IC("ICP112", "dropped outgoing handshake: %s poison: %s", actorId.ToString().data(), + LOG_DEBUG_IC("ICP112", "dropped outgoing handshake: %s poison: %s", actorId.ToString().data(), poison ? "true" : "false"); if (poison) { Send(actorId, new TEvents::TEvPoisonPill); diff --git a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp index b95c994598..b36f0a98dd 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp @@ -9,7 +9,7 @@ namespace NActors { TInterconnectListenerTCP::TInterconnectListenerTCP(const TString& address, ui16 port, TInterconnectProxyCommon::TPtr common, const TMaybe<SOCKET>& socket) : TActor(&TThis::Initial) - , TInterconnectLoggingBase(Sprintf("ICListener: %s", SelfId().ToString().data())) + , TInterconnectLoggingBase(Sprintf("ICListener: %s", SelfId().ToString().data())) , Address(address.c_str(), port) , Listener( socket diff --git a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp index 2ded7f9f53..51fb4bf9f5 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_session.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_session.cpp @@ -60,7 +60,7 @@ namespace NActors { Proxy->Common->Settings.MaxSerializedEventSize, Params); LOG_INFO(*TlsActivationContext, NActorsServices::INTERCONNECT_STATUS, "[%u] session created", Proxy->PeerNodeId); - SetPrefix(Sprintf("Session %s [node %" PRIu32 "]", SelfId().ToString().data(), Proxy->PeerNodeId)); + SetPrefix(Sprintf("Session %s [node %" PRIu32 "]", SelfId().ToString().data(), Proxy->PeerNodeId)); SendUpdateToWhiteboard(); } @@ -117,7 +117,7 @@ namespace NActors { void TInterconnectSessionTCP::Forward(STATEFN_SIG) { Proxy->ValidateEvent(ev, "Forward"); - LOG_DEBUG_IC_SESSION("ICS02", "send event from: %s to: %s", ev->Sender.ToString().data(), ev->Recipient.ToString().data()); + LOG_DEBUG_IC_SESSION("ICS02", "send event from: %s to: %s", ev->Sender.ToString().data(), ev->Recipient.ToString().data()); ++MessagesGot; if (ev->Flags & IEventHandle::FlagSubscribeOnSession) { @@ -185,7 +185,7 @@ namespace NActors { } void TInterconnectSessionTCP::Subscribe(STATEFN_SIG) { - LOG_DEBUG_IC_SESSION("ICS04", "subscribe for session state for %s", ev->Sender.ToString().data()); + LOG_DEBUG_IC_SESSION("ICS04", "subscribe for session state for %s", ev->Sender.ToString().data()); const auto [it, inserted] = Subscribers.emplace(ev->Sender, ev->Cookie); if (inserted) { Proxy->Metrics->IncSubscribersCount(); @@ -196,7 +196,7 @@ namespace NActors { } void TInterconnectSessionTCP::Unsubscribe(STATEFN_SIG) { - LOG_DEBUG_IC_SESSION("ICS05", "unsubscribe for session state for %s", ev->Sender.ToString().data()); + LOG_DEBUG_IC_SESSION("ICS05", "unsubscribe for session state for %s", ev->Sender.ToString().data()); Proxy->Metrics->SubSubscribersCount( Subscribers.erase(ev->Sender)); } @@ -291,7 +291,7 @@ namespace NActors { } const ui64 serial = s.GetOrElse(Max<ui64>()); - Y_VERIFY(serial > LastConfirmed, "%s serial# %" PRIu64 " LastConfirmed# %" PRIu64, LogPrefix.data(), serial, LastConfirmed); + Y_VERIFY(serial > LastConfirmed, "%s serial# %" PRIu64 " LastConfirmed# %" PRIu64, LogPrefix.data(), serial, LastConfirmed); LOG_DEBUG_IC_SESSION("ICS06", "rewind SendQueue size# %zu LastConfirmed# %" PRIu64 " SendQueuePos.Serial# %" PRIu64 "\n", SendQueue.size(), LastConfirmed, serial); @@ -619,7 +619,7 @@ namespace NActors { const TString message = r == 0 ? "connection closed by peer" : err ? err : Sprintf("socket: %s", strerror(-r)); - LOG_NOTICE_NET(Proxy->PeerNodeId, "%s", message.data()); + LOG_NOTICE_NET(Proxy->PeerNodeId, "%s", message.data()); if (written) { Proxy->Metrics->AddTotalBytesWritten(written); } diff --git a/library/cpp/actors/interconnect/load.cpp b/library/cpp/actors/interconnect/load.cpp index 2a8443da71..6ec989f241 100644 --- a/library/cpp/actors/interconnect/load.cpp +++ b/library/cpp/actors/interconnect/load.cpp @@ -186,7 +186,7 @@ namespace NInterconnect { } void GenerateMessages(const TActorContext& ctx) { - while (InFly.size() < Params.InFlyMax && ctx.Now() >= NextMessageTimestamp) { + while (InFly.size() < Params.InFlyMax && ctx.Now() >= NextMessageTimestamp) { // generate payload const ui32 size = Params.SizeMin + RandomNumber(Params.SizeMax - Params.SizeMin + 1); @@ -360,7 +360,7 @@ namespace NInterconnect { std::sort(v.begin(), v.end()); for (double q : {0.5, 0.9, 0.99, 0.999, 0.9999, 1.0}) { const size_t pos = q * (v.size() - 1); - msg << Sprintf(" %.4f# %s", q, v[pos].ToString().data()); + msg << Sprintf(" %.4f# %s", q, v[pos].ToString().data()); } msg << "}"; } else { @@ -373,7 +373,7 @@ namespace NInterconnect { msg << " final"; } - LOG_NOTICE(ctx, NActorsServices::INTERCONNECT_SPEED_TEST, "%s", msg.Str().data()); + LOG_NOTICE(ctx, NActorsServices::INTERCONNECT_SPEED_TEST, "%s", msg.Str().data()); if (schedule) { SchedulePublishResults(ctx); diff --git a/library/cpp/actors/interconnect/packet.h b/library/cpp/actors/interconnect/packet.h index 4ba50a2b5f..592f9d5623 100644 --- a/library/cpp/actors/interconnect/packet.h +++ b/library/cpp/actors/interconnect/packet.h @@ -260,7 +260,7 @@ public: } bool DropBufs(size_t& amount) { - while (BufferIndex != Bufs.size()) { + while (BufferIndex != Bufs.size()) { TConstIoVec& item = Bufs[BufferIndex]; // calculate number of bytes to the end in current buffer const size_t remain = item.Size - FirstBufferOffset; diff --git a/library/cpp/actors/interconnect/ut/lib/interrupter.h b/library/cpp/actors/interconnect/ut/lib/interrupter.h index 48851de2c5..c645054fff 100644 --- a/library/cpp/actors/interconnect/ut/lib/interrupter.h +++ b/library/cpp/actors/interconnect/ut/lib/interrupter.h @@ -85,13 +85,13 @@ public: , RejectingTraffic(false) { SetReuseAddressAndPort(ListenSocket); - TSockAddrInet6 addr(Address.data(), listenPort); + TSockAddrInet6 addr(Address.data(), listenPort); Y_VERIFY(ListenSocket.Bind(&addr) == 0); Y_VERIFY(ListenSocket.Listen(5) == 0); DelayTraffic = (Bandwidth == 0.0) ? false : true; - ForwardAddrress.Reset(new TSockAddrInet6(Address.data(), ForwardPort)); + ForwardAddrress.Reset(new TSockAddrInet6(Address.data(), ForwardPort)); const ui32 BufSize = DelayTraffic ? 4096 : 65536 + 4096; Buf.resize(BufSize); } @@ -164,7 +164,7 @@ private: updateTimout(it.ForwardConnection); updateTimout(it.BackwardConnection); } - pollReadyCount = SocketPoller.WaitT(Events.data(), Events.size(), timeout); + pollReadyCount = SocketPoller.WaitT(Events.data(), Events.size(), timeout); if (pollReadyCount > 0) { for (int i = 0; i < pollReadyCount; i++) { HandleSocketPollEvent(Events[i]); @@ -182,7 +182,7 @@ private: if (TInstant::Now() >= frontPackage.first) { TInet6StreamSocket* sock = frontPackage.second.ForwardSocket; if (sock) { - sock->Send(frontPackage.second.Data.data(), frontPackage.second.Data.size()); + sock->Send(frontPackage.second.Data.data(), frontPackage.second.Data.size()); } conn.DelayedQueue.pop(); } else { @@ -222,7 +222,7 @@ private: TDirectedConnection* directedConnection = static_cast<TDirectedConnection*>(ev); int recvSize = 0; do { - recvSize = directedConnection->Source->Recv(Buf.data(), Buf.size()); + recvSize = directedConnection->Source->Recv(Buf.data(), Buf.size()); } while (recvSize == -EINTR); if (recvSize > 0) { @@ -234,10 +234,10 @@ private: TDelayedPacket pkt; pkt.ForwardSocket = directedConnection->Destination; pkt.Data.resize(recvSize); - memcpy(pkt.Data.data(), Buf.data(), recvSize); + memcpy(pkt.Data.data(), Buf.data(), recvSize); directedConnection->DelayedQueue.emplace(directedConnection->Timestamp, std::move(pkt)); } else { - directedConnection->Destination->Send(Buf.data(), recvSize); + directedConnection->Destination->Send(Buf.data(), recvSize); } } else { SocketPoller.Unwait(static_cast<SOCKET>(*directedConnection->Source)); |