Update of /cvsroot/csmaild/csmaild/src/Imap/NetworkManager
In directory sc8-pr-cvs1:/tmp/cvs-serv906/src/Imap/NetworkManager
Modified Files:
Connection.cs
Log Message:
UIDs, UIDVALIDITYs, and literal sizes can all be uint.MaxValue big
Finished up parenthesized list parser, it should work for all commands that need it except SEARCH for now
Quite a bit of fixing yet to do to handle buffer overruns and large transmissions, but for small things (can fit into memory), we should be alright for now
Index: Connection.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/NetworkManager/Connection.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Connection.cs 25 Jul 2003 03:39:13 -0000 1.5
--- Connection.cs 25 Jul 2003 23:35:24 -0000 1.6
***************
*** 171,177 ****
/// <param name="offset">The offset into this buffer</param>
/// <param name="size">The number of bytes to read into the buffer</param>
! public void ReadBlock(byte[] block, int offset, int length)
{
! ReadBlock(block, offset, length, mReceivedBlockEvent);
}
--- 171,181 ----
/// <param name="offset">The offset into this buffer</param>
/// <param name="size">The number of bytes to read into the buffer</param>
! public void ReadBlock(byte[] block, uint offset, uint length)
{
! // TODO: really need to handle bigger values, will need to split this up too, because an presumed 4 gigabyte buffer probably won't slide
! if(length > int.MaxValue)
! ReadBlock(block, offset, int.MaxValue, mReceivedBlockEvent);
! else
! ReadBlock(block, offset, length, mReceivedBlockEvent);
}
***************
*** 183,191 ****
/// <param name="size">The number of bytes to read into the buffer</param>
/// <param name="callback">The callback function to call after done reading</param>
! public void ReadBlock(byte[] block, int offset, int length, ReceivedBlockDelegate callback)
{
! mReceiveBlockBuffer = block;
! mReceiveBlockOffset = offset;
! mReceiveBlockSize = length;
ReadBlock(callback);
--- 187,205 ----
/// <param name="size">The number of bytes to read into the buffer</param>
/// <param name="callback">The callback function to call after done reading</param>
! public void ReadBlock(byte[] block, uint offset, uint length, ReceivedBlockDelegate callback)
{
! // TODO: really need to handle bigger values, will need to split this up too, because an presumed 4 gigabyte buffer probably won't slide
! if(length > int.MaxValue)
! {
! mReceiveBlockBuffer = block;
! mReceiveBlockOffset = (int)offset;
! mReceiveBlockSize = int.MaxValue;
! }
! else
! {
! mReceiveBlockBuffer = block;
! mReceiveBlockOffset = (int)offset;
! mReceiveBlockSize = (int)length;
! }
ReadBlock(callback);
|