Client disconnects periodically when in channels with a moderate amount of traffic
Bug #862420 reported by
Andy Jump
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IRC.NET |
Fix Committed
|
Medium
|
Alexander Regueiro |
Bug Description
We're using IRC.Net in the SpikeLite IRC bot.
When running in ##csharp it periodically disconnects and reconnects.
This happens on both Linux with MONO and on Windows with .Net.
From the logs I can see that the bot appears to simply stop receiving data from the server and then disconnects a few minutes later.
At a guess this is because it's no longer receiving 'pings' and so send no 'pongs'.
Changed in ircdotnet: | |
importance: | Undecided → Medium |
assignee: | nobody → Alex Regueiro (alexreg) |
status: | New → Confirmed |
milestone: | none → 0.4.2 |
To post a comment you must log in.
Because the activity on this project is very low I gathered the soruces and figured some bugs out, especially this one (which was not easy at all to fix...)
I was not really able to track this one down but I know what I changed to resove the issue: tream in the following ways:
return length < 0 ? this.buffer.Length + length : length;
I did change the CircularBufferS
public override long Length
{
get
{
var length = this.writePosition - this.readPosition;
}
}
public override long Seek(long offset, SeekOrigin origin) eption( );
{
throw new NotSupportedExc
}
public override void Write(byte[] buffer, int offset, int count) buffer. Length - this.writePosit ion))) > 0)
throw new InternalBufferO verflowExceptio n("Der CircularBuffer wurde überlaufen!");
System. Buffer. BlockCopy( buffer, offset, this.buffer, (int)this. writePosition, writeCount);
this. writePosition = newWritePosition;
{
// Write block of bytes from given buffer into circular buffer, wrapping around when necessary.
int writeCount;
while ((writeCount = Math.Min(count, (int)(this.
{
var oldWritePosition = this.writePosition;
var newWritePosition = (this.writePosition + writeCount) % this.buffer.Length;
if (newWritePosition > readPosition && oldWritePosition < readPosition)
{
}
}
}
public override int Read(byte[] buffer, int offset, int count) buffer. Length - offset, count);
readCount = (int)(this. buffer. Length - readPosition);
System. Buffer. BlockCopy( this.buffer, (int)this. readPosition, buffer, offset, readCount);
this. readPosition = (this.readPosition + readCount) % this.buffer.Length;
offset += readCount;
count = Math.Min( buffer. Length - offset, count);
totalReadCoun t += readCount;
{
// Read block of bytes from circular buffer, wrapping around when necessary.
int totalReadCount = 0;
int readCount;
count = Math.Min(
while ((readCount = Math.Min(count, (int)(Length))) > 0)
{
if (readCount > this.buffer.Length - readPosition)
{
}
}
return totalReadCount;
}
I think the problem occured on some special cases at the end of the CircularBuffer which were not handled correctly.
( but I'm not 100% sure )
Added the patched file as Attachment (not sure if it will compile in the current version on this site)
It's not possible for me to reupload my complete implementation as i changed lots of Logging to be able to track this down...
Hope this helps!
reddragon