Esempio n. 1
0
        private void onSectionComplete()
        {
            string contentDisposition;

            if (!_dispositions.TryGetValue("Content-Disposition", out contentDisposition))
            {
                Log.Error("Content disposition cannot been found");
                return;
            }

            var match = ContentDispositionParser.Match(contentDisposition);

            if (!match.Success)
            {
                Log.Error("Content disposition cannot be matched: '{0}'", contentDisposition);
                return;
            }

            var names  = match.Groups["Name"];
            var values = match.Groups["Value"];

            for (int i = 0; i < names.Captures.Count; ++i)
            {
                var name  = names.Captures[i].Value;
                var value = values.Captures[i].Value;

                _dispositions[name] = value;
            }

            _currentPartStream = reportPart(_dispositions);
        }
Esempio n. 2
0
        private void reportPartEnd()
        {
            if (_currentPartStream == null)
            {
                Log.Error("Part end without part start");
                ContinueDownloading = false;
                return;
            }

            //report completition action
            _currentPartStream.Completed();
            //waiting for new stream
            _currentPartStream = null;
        }