Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1095 → Rev 1094

/TCPproxy/trunk/src/Network.cs
28,7 → 28,7
Connecting,
Connected,
ShutdownSend,
ShutdownReceived,
ShutdownReceive,
Closed
}
 
430,7 → 430,7
else if(this.localState == SocketState.Connected && localState == SocketState.ShutdownSend)
{
}
else if(this.localState == SocketState.Connected && localState == SocketState.ShutdownReceived)
else if(this.localState == SocketState.Connected && localState == SocketState.ShutdownReceive)
{
if(localEndTimestamp == DateTime.MinValue) localEndTimestamp = DateTime.Now;
}
442,14 → 442,14
{
if(localEndTimestamp == DateTime.MinValue) localEndTimestamp = DateTime.Now;
}
else if(this.localState == SocketState.ShutdownSend && localState == SocketState.ShutdownReceived)
else if(this.localState == SocketState.ShutdownSend && localState == SocketState.ShutdownReceive)
{
if(localEndTimestamp == DateTime.MinValue) localEndTimestamp = DateTime.Now;
}
else if(this.localState == SocketState.ShutdownReceived && localState == SocketState.ShutdownSend)
else if(this.localState == SocketState.ShutdownReceive && localState == SocketState.ShutdownSend)
{
}
else if(this.localState == SocketState.ShutdownReceived && localState == SocketState.Closed)
else if(this.localState == SocketState.ShutdownReceive && localState == SocketState.Closed)
{
if(localEndTimestamp == DateTime.MinValue) localEndTimestamp = DateTime.Now;
}
487,7 → 487,7
else if(this.remoteState == SocketState.Connected && remoteState == SocketState.ShutdownSend)
{
}
else if(this.remoteState == SocketState.Connected && remoteState == SocketState.ShutdownReceived)
else if(this.remoteState == SocketState.Connected && remoteState == SocketState.ShutdownReceive)
{
if(remoteEndTimestamp == DateTime.MinValue) remoteEndTimestamp = DateTime.Now;
}
499,14 → 499,14
{
if(remoteEndTimestamp == DateTime.MinValue) remoteEndTimestamp = DateTime.Now;
}
else if(this.remoteState == SocketState.ShutdownSend && remoteState == SocketState.ShutdownReceived)
else if(this.remoteState == SocketState.ShutdownSend && remoteState == SocketState.ShutdownReceive)
{
if(remoteEndTimestamp == DateTime.MinValue) remoteEndTimestamp = DateTime.Now;
}
else if(this.remoteState == SocketState.ShutdownReceived && remoteState == SocketState.ShutdownSend)
else if(this.remoteState == SocketState.ShutdownReceive && remoteState == SocketState.ShutdownSend)
{
}
else if(this.remoteState == SocketState.ShutdownReceived && remoteState == SocketState.Closed)
else if(this.remoteState == SocketState.ShutdownReceive && remoteState == SocketState.Closed)
{
if(remoteEndTimestamp == DateTime.MinValue) remoteEndTimestamp = DateTime.Now;
}
795,7 → 795,7
tcp.SendLog(LogLevel.Info, "Got showdown from local end");
 
localSocket.Shutdown(SocketShutdown.Receive);
tcp.SetLocalState(SocketState.ShutdownReceived);
tcp.SetLocalState(SocketState.ShutdownReceive);
localSocketReceiveShutdown = true;
CheckLocalSocket();
 
939,7 → 939,7
tcp.SendLog(LogLevel.Info, "Got showdown from remote end");
 
remoteSocket.Shutdown(SocketShutdown.Receive);
tcp.SetRemoteState(SocketState.ShutdownReceived);
tcp.SetRemoteState(SocketState.ShutdownReceive);
remoteSocketReceiveShutdown = true;
CheckRemoteSocket();
 
/TCPproxy/trunk/src/ViewControl.cs
580,11 → 580,10
{
if(line.Length <= lastLineLen || m.endPos < lastLineLen)
{
LineFragment[] newLine = new LineFragment[lastLineLen * (line.Length + 1 >= lastLineLen ? 2 : 1)];
LineFragment[] newLine = new LineFragment[lastLineLen * (line.Length == lastLineLen ? 2 : 1)];
 
if(m.endPos > 0) Array.Copy(line, 0, newLine, 0, m.endPos);
if(lastLineLen > m.endPos) Array.Copy(line, m.endPos, newLine, m.endPos+1, lastLineLen - m.endPos);
 
line = newLine;
lineFragments[m.endLine] = line;
}
646,9 → 645,8
LineFragment[] oldLine = (LineFragment[])lineFragments[m.endLine];
int oldLineLen = (m.endLine == linesCount - 1) ? lastLineLen : oldLine.Length;
LineFragment[] line1 = new LineFragment[m.endPos];
LineFragment[] line2 = new LineFragment[(m.endLine == linesCount - 1)
? (int)Math.Ceiling((double)(oldLineLen - m.endPos) / NEW_LINE_LENGTH) * NEW_LINE_LENGTH
: oldLineLen - m.endPos];
LineFragment[] line2 = new LineFragment[
(m.endLine == linesCount - 1) ? NEW_LINE_LENGTH : oldLine.Length - m.endPos];
 
if(m.endPos > 0) Array.Copy(oldLine, 0, line1, 0, m.endPos);
if(oldLineLen - m.endPos > 0) Array.Copy(oldLine, m.endPos, line2, 0, oldLineLen - m.endPos);
656,9 → 654,9
lineFragments[m.endLine] = line1;
lineFragments.Insert(m.endLine + 1, line2);
lineBackColors.Insert(m.endLine + 1, backColor);
linesCount++;
 
if(m.endLine == linesCount - 1) lastLineLen = oldLineLen - m.endPos;
linesCount++;
}
 
// update screen