Ejemplo n.º 1
0
        /// <summary>
        /// Receives exclude list from stream
        /// </summary>
        /// <param name="ioStream"></param>
        public void ReceiveExcludeList(IoStream ioStream)
        {
            var line = String.Empty;
            int length;

            while ((length = ioStream.ReadInt()) != 0)
            {
                if (length >= Options.Maxpathlen + 3)
                {
                    Log.Write("Overflow: recv_exclude_list");
                    continue;
                }

                line = ioStream.ReadStringFromBuffer(length);
                AddExclude(ref _options.ExcludeList, line, 0);
            }
        }
Ejemplo n.º 2
0
        public int SimpleReceiveToken(IoStream ioStream, ref byte[] data, int offset)
        {
            int n;

            if (Residue == 0)
            {
                var i = ioStream.ReadInt();
                if (i <= 0)
                {
                    return(i);
                }
                Residue = i;
            }

            n        = Math.Min(Match.ChunkSize, Residue);
            Residue -= n;
            data     = ioStream.ReadBuffer(n);
            return(n);
        }