Exemplo n.º 1
0
 // Token: 0x06000339 RID: 825 RVA: 0x000125A8 File Offset: 0x000107A8
 public void SetContentType(MajorContentType contentType, MimeString boundaryValue)
 {
     if (contentType == MajorContentType.Multipart)
     {
         int    srcOffset;
         int    num;
         byte[] data  = boundaryValue.GetData(out srcOffset, out num);
         int    num2  = MimeString.TwoDashes.Length + num + MimeString.TwoDashes.Length;
         byte[] array = new byte[num2];
         int    num3  = MimeString.TwoDashes.Length;
         Buffer.BlockCopy(MimeString.TwoDashes, 0, array, 0, num3);
         Buffer.BlockCopy(data, srcOffset, array, num3, num);
         num3            += num;
         this.boundaryCrc = ByteString.ComputeCrc(array, 0, num3);
         Buffer.BlockCopy(MimeString.TwoDashes, 0, array, num3, MimeString.TwoDashes.Length);
         num3 += MimeString.TwoDashes.Length;
         this.endBoundaryCrc = ByteString.ComputeCrc(array, 0, num3);
         this.boundaryValue  = new MimeString(array, 0, num3);
     }
     else
     {
         this.boundaryValue  = default(MimeString);
         this.boundaryCrc    = 0U;
         this.endBoundaryCrc = 0U;
     }
     this.contentType = contentType;
 }
Exemplo n.º 2
0
        // Token: 0x0600032A RID: 810 RVA: 0x000120A0 File Offset: 0x000102A0
        private bool FindBoundary(byte[] data, int line, int nextNL, out int nextBoundaryLevel, out bool nextBoundaryEnd)
        {
            while (nextNL > line && MimeScan.IsLWSP(data[nextNL - 1]))
            {
                nextNL--;
            }
            uint num = ByteString.ComputeCrc(data, line, nextNL - line);
            bool flag;

            if (this.currentLevel.IsBoundary(data, line, nextNL - line, (long)((ulong)num), out flag))
            {
                nextBoundaryLevel = this.parseStackTop;
                nextBoundaryEnd   = flag;
                return(true);
            }
            for (int i = this.parseStackTop - 1; i >= 0; i--)
            {
                if (this.parseStack[i].IsBoundary(data, line, nextNL - line, (long)((ulong)num), out flag))
                {
                    nextBoundaryLevel = i;
                    nextBoundaryEnd   = flag;
                    return(true);
                }
            }
            nextBoundaryLevel = -1;
            nextBoundaryEnd   = false;
            return(false);
        }