Skip to content

Commit

Permalink
リレーが出すぎる問題を直した。
Browse files Browse the repository at this point in the history
Servent のステータスを CONNECTED にするタイミングを変えた。
  • Loading branch information
plonk committed Feb 13, 2024
1 parent c323068 commit 3980a78
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/common/servent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ bool Servent::handshakeStream(ChanInfo &chanInfo)
// ンネルをリレー・視聴している servent であると設
// 定する。
chanID = chanInfo.id;
setStatus(S_CONNECTED);
}
}
LOG_DEBUG("chanReady = %d; reason = %s", chanReady, denialReasonToName(reason));
Expand Down Expand Up @@ -1615,6 +1616,7 @@ void Servent::processStream(ChanInfo &chanInfo)
return;

ASSERT(chanID.isSet());
ASSERT(this->status == S_CONNECTED);

if (chanInfo.id.isSet())
{
Expand Down Expand Up @@ -1687,8 +1689,6 @@ void Servent::sendRawChannel(bool sendHead, bool sendData)
if (!ch)
throw StreamException("Channel not found");

setStatus(S_CONNECTED);

LOG_DEBUG("Starting Raw stream of %s at %d", ch->info.name.cstr(), streamPos);

if (sendHead)
Expand Down Expand Up @@ -1775,8 +1775,6 @@ void Servent::sendRawMetaChannel(int interval)

sock->setWriteTimeout(DIRECT_WRITE_TIMEOUT*1000);

setStatus(S_CONNECTED);

LOG_DEBUG("Starting Raw Meta stream of %s (metaint: %d) at %d", ch->info.name.cstr(), interval, streamPos);

String lastTitle, lastURL;
Expand Down Expand Up @@ -1901,8 +1899,6 @@ void Servent::sendPCPChannel()
{
LOG_DEBUG("Starting PCP stream of channel at %d", streamPos);

setStatus(S_CONNECTED);

atom.writeParent(PCP_CHAN, 3 + ((sendHeader)?1:0));
atom.writeBytes(PCP_CHAN_ID, chanID.id, 16);
ch->info.writeInfoAtoms(atom);
Expand Down

0 comments on commit 3980a78

Please sign in to comment.