|
@@ -1214,7 +1214,7 @@ namespace NNetliba {
|
|
const TUdpAddress& ip = i.first;
|
|
const TUdpAddress& ip = i.first;
|
|
const TCongestionControl& cc = *i.second.UdpCongestion;
|
|
const TCongestionControl& cc = *i.second.UdpCongestion;
|
|
IIBPeer* ibPeer = i.second.IBPeer.Get();
|
|
IIBPeer* ibPeer = i.second.IBPeer.Get();
|
|
- sprintf(buf, "%s\tIB: %d, RTT: %g Timeout: %g Window: %g MaxWin: %g FailRate: %g TimeSinceLastRecv: %g Transfers: %d MTU: %d\n",
|
|
|
|
|
|
+ snprintf(buf, sizeof(buf), "%s\tIB: %d, RTT: %g Timeout: %g Window: %g MaxWin: %g FailRate: %g TimeSinceLastRecv: %g Transfers: %d MTU: %d\n",
|
|
GetAddressAsString(ip).c_str(),
|
|
GetAddressAsString(ip).c_str(),
|
|
ibPeer ? ibPeer->GetState() : -1,
|
|
ibPeer ? ibPeer->GetState() : -1,
|
|
cc.GetRTT() * 1000, cc.GetTimeout() * 1000, cc.GetWindow(), cc.GetMaxWindow(), cc.GetFailRate(),
|
|
cc.GetRTT() * 1000, cc.GetTimeout() * 1000, cc.GetWindow(), cc.GetMaxWindow(), cc.GetFailRate(),
|
|
@@ -1227,17 +1227,17 @@ namespace NNetliba {
|
|
TString TUdpHost::GetDebugInfo() {
|
|
TString TUdpHost::GetDebugInfo() {
|
|
TString res;
|
|
TString res;
|
|
char buf[1000];
|
|
char buf[1000];
|
|
- sprintf(buf, "Receiving %d msgs, sending %d high prior, %d regular msgs, %d low prior msgs\n",
|
|
|
|
|
|
+ snprintf(buf, sizeof(buf), "Receiving %d msgs, sending %d high prior, %d regular msgs, %d low prior msgs\n",
|
|
RecvQueue.ysize(), (int)SendOrderHighPrior.size(), (int)SendOrder.size(), (int)SendOrderLow.size());
|
|
RecvQueue.ysize(), (int)SendOrderHighPrior.size(), (int)SendOrder.size(), (int)SendOrderLow.size());
|
|
res += buf;
|
|
res += buf;
|
|
|
|
|
|
TRequesterPendingDataStats pds;
|
|
TRequesterPendingDataStats pds;
|
|
GetPendingDataSize(&pds);
|
|
GetPendingDataSize(&pds);
|
|
- sprintf(buf, "Pending data size: %" PRIu64 "\n", pds.InpDataSize + pds.OutDataSize);
|
|
|
|
|
|
+ snprintf(buf, sizeof(buf), "Pending data size: %" PRIu64 "\n", pds.InpDataSize + pds.OutDataSize);
|
|
res += buf;
|
|
res += buf;
|
|
- sprintf(buf, " in packets: %d, size %" PRIu64 "\n", pds.InpCount, pds.InpDataSize);
|
|
|
|
|
|
+ snprintf(buf, sizeof(buf), " in packets: %d, size %" PRIu64 "\n", pds.InpCount, pds.InpDataSize);
|
|
res += buf;
|
|
res += buf;
|
|
- sprintf(buf, " out packets: %d, size %" PRIu64 "\n", pds.OutCount, pds.OutDataSize);
|
|
|
|
|
|
+ snprintf(buf, sizeof(buf), " out packets: %d, size %" PRIu64 "\n", pds.OutCount, pds.OutDataSize);
|
|
res += buf;
|
|
res += buf;
|
|
|
|
|
|
res += "\nCongestion info:\n";
|
|
res += "\nCongestion info:\n";
|