End() публичный Метод

public End ( ) : void
Результат void
Пример #1
0
        private void SendAdvertisedRefs()
        {
            _refs = _db.getAllRefs();

            var adv = new RefAdvertiser(_pckOut, _walk, ADVERTISED);

            adv.advertiseCapability(OptionIncludeTag);
            adv.advertiseCapability(OptionMultiAck);
            adv.advertiseCapability(OptionOfsDelta);
            adv.advertiseCapability(OptionSideBand);
            adv.advertiseCapability(OptionSideBand64K);
            adv.advertiseCapability(OptionThinPack);
            adv.advertiseCapability(OptionNoProgress);
            adv.setDerefTags(true);
            _refs = _db.getAllRefs();
            adv.send(_refs.Values);
            _pckOut.End();
        }
Пример #2
0
        public override void Close()
        {
            if (outStream != null)
            {
                try
                {
                    if (outNeedsEnd)
                    {
                        pckOut.End();
                    }
                    outStream.Close();
                }
                catch (IOException)
                {
                    // Ignore any close errors.
                }
                finally
                {
                    outStream = null;
                    pckOut    = null;
                }
            }

            if (inStream != null)
            {
                try
                {
                    inStream.Close();
                }
                catch (IOException)
                {
                    // Ignore any close errors.
                }
                finally
                {
                    inStream = null;
                    pckIn    = null;
                }
            }

#if DEBUG
            GC.SuppressFinalize(this); // Disarm lock-release checker
#endif
        }
Пример #3
0
 public override void end()
 {
     pckOut.End();
 }
Пример #4
0
        private void SendPack()
        {
            bool thin     = _options.Contains(OptionThinPack);
            bool progress = !_options.Contains(OptionNoProgress);
            bool sideband = _options.Contains(OptionSideBand) || _options.Contains(OptionSideBand64K);

            ProgressMonitor pm       = NullProgressMonitor.Instance;
            Stream          _packOut = _rawOut;

            if (sideband)
            {
                int bufsz = SideBandOutputStream.SMALL_BUF;
                if (_options.Contains(OptionSideBand64K))
                {
                    bufsz = SideBandOutputStream.MAX_BUF;
                }

                _packOut = new SideBandOutputStream(SideBandOutputStream.CH_DATA, bufsz, _rawOut);

                if (progress)
                {
                    pm = new SideBandProgressMonitor(new SideBandOutputStream(SideBandOutputStream.CH_PROGRESS, bufsz, _rawOut));
                }
            }

            var pw = new PackWriter(_db, pm, NullProgressMonitor.Instance)
            {
                DeltaBaseAsOffset = _options.Contains(OptionOfsDelta),
                Thin = thin
            };

            pw.preparePack(_wantAll, _commonBase);
            if (_options.Contains(OptionIncludeTag))
            {
                foreach (Ref r in _refs.Values)
                {
                    RevObject o;
                    try
                    {
                        o = _walk.parseAny(r.ObjectId);
                    }
                    catch (IOException)
                    {
                        continue;
                    }
                    RevTag t = (o as RevTag);
                    if (o.has(WANT) || (t == null))
                    {
                        continue;
                    }

                    if (!pw.willInclude(t) && pw.willInclude(t.getObject()))
                    {
                        pw.addObject(t);
                    }
                }
            }

            pw.writePack(_packOut);

            if (sideband)
            {
                _packOut.Flush();
                _pckOut.End();
            }
            else
            {
                _rawOut.Flush();
            }
        }