コード例 #1
0
ファイル: TransportLocal.cs プロジェクト: ashmind/ngit
            /// <exception cref="NGit.Errors.TransportException"></exception>
            public InternalLocalFetchConnection(TransportLocal _enclosing) : base(_enclosing
                                                                                  )
            {
                this._enclosing = _enclosing;
                Repository dst;

                try
                {
                    dst = new FileRepository(this._enclosing.remoteGitDir);
                }
                catch (IOException)
                {
                    throw new TransportException(this.uri, JGitText.Get().notAGitDirectory);
                }
                PipedInputStream  in_r;
                PipedOutputStream in_w;
                PipedInputStream  out_r;
                PipedOutputStream out_w;

                try
                {
                    in_r  = new PipedInputStream();
                    in_w  = new PipedOutputStream(in_r);
                    out_r = new _PipedInputStream_193();
                    // The client (BasePackFetchConnection) can write
                    // a huge burst before it reads again. We need to
                    // force the buffer to be big enough, otherwise it
                    // will deadlock both threads.
                    out_w = new PipedOutputStream(out_r);
                }
                catch (IOException err)
                {
                    dst.Close();
                    throw new TransportException(this.uri, JGitText.Get().cannotConnectPipes, err);
                }
                this.worker = new _Thread_208(this, dst, out_r, in_w, "JGit-Upload-Pack");
                // Client side of the pipes should report the problem.
                // Clients side will notice we went away, and report.
                // Ignore close failure, we probably crashed above.
                // Ignore close failure, we probably crashed above.
                this.worker.Start();
                this.Init(in_r, out_w);
                this.ReadAdvertisedRefs();
            }
コード例 #2
0
ファイル: TransportLocal.cs プロジェクト: ashmind/ngit
            /// <exception cref="NGit.Errors.TransportException"></exception>
            public ForkLocalPushConnection(TransportLocal _enclosing) : base(_enclosing)
            {
                this._enclosing = _enclosing;
                MessageWriter msg = new MessageWriter();

                this.SetMessageWriter(msg);
                this.receivePack = this._enclosing.Spawn(this._enclosing.GetOptionReceivePack());
                InputStream rpErr = this.receivePack.GetErrorStream();

                this.errorReaderThread = new StreamCopyThread(rpErr, msg.GetRawStream());
                this.errorReaderThread.Start();
                InputStream  rpIn  = this.receivePack.GetInputStream();
                OutputStream rpOut = this.receivePack.GetOutputStream();

                rpIn  = new BufferedInputStream(rpIn);
                rpOut = new BufferedOutputStream(rpOut);
                this.Init(rpIn, rpOut);
                this.ReadAdvertisedRefs();
            }
コード例 #3
0
            /// <exception cref="NGit.Errors.TransportException"></exception>
            public ForkLocalFetchConnection(TransportLocal _enclosing) : base(_enclosing
                                                                              )
            {
                this._enclosing = _enclosing;
                MessageWriter msg = new MessageWriter();

                this.SetMessageWriter(msg);
                this.uploadPack = this._enclosing.Spawn(this._enclosing.GetOptionUploadPack());
                InputStream upErr = this.uploadPack.GetErrorStream();

                this.errorReaderThread = new StreamCopyThread(upErr, msg.GetRawStream());
                this.errorReaderThread.Start();
                InputStream  upIn  = this.uploadPack.GetInputStream();
                OutputStream upOut = this.uploadPack.GetOutputStream();

                upIn  = new BufferedInputStream(upIn);
                upOut = new SafeBufferedOutputStream(upOut);
                this.Init(upIn, upOut);
                this.ReadAdvertisedRefs();
            }
コード例 #4
0
ファイル: TransportLocal.cs プロジェクト: ashmind/ngit
            /// <exception cref="NGit.Errors.TransportException"></exception>
            public InternalLocalPushConnection(TransportLocal _enclosing) : base(_enclosing
                                                                                 )
            {
                this._enclosing = _enclosing;
                Repository dst;

                try
                {
                    dst = new FileRepository(this._enclosing.remoteGitDir);
                }
                catch (IOException)
                {
                    throw new TransportException(this.uri, JGitText.Get().notAGitDirectory);
                }
                PipedInputStream  in_r;
                PipedOutputStream in_w;
                PipedInputStream  out_r;
                PipedOutputStream out_w;

                try
                {
                    in_r  = new PipedInputStream();
                    in_w  = new PipedOutputStream(in_r);
                    out_r = new PipedInputStream();
                    out_w = new PipedOutputStream(out_r);
                }
                catch (IOException err)
                {
                    dst.Close();
                    throw new TransportException(this.uri, JGitText.Get().cannotConnectPipes, err);
                }
                this.worker = new _Thread_340(this, dst, out_r, in_w, "JGit-Receive-Pack");
                // Client side of the pipes should report the problem.
                // Clients side will notice we went away, and report.
                // Ignore close failure, we probably crashed above.
                // Ignore close failure, we probably crashed above.
                this.worker.Start();
                this.Init(in_r, out_w);
                this.ReadAdvertisedRefs();
            }
コード例 #5
0
ファイル: TransportLocal.cs プロジェクト: sharwell/ngit
 /// <exception cref="NGit.Errors.TransportException"></exception>
 public InternalLocalPushConnection(TransportLocal _enclosing)
     : base(_enclosing)
 {
     this._enclosing = _enclosing;
     Repository dst;
     try
     {
         dst = new FileRepository(this._enclosing.remoteGitDir);
     }
     catch (IOException)
     {
         throw new TransportException(this.uri, JGitText.Get().notAGitDirectory);
     }
     PipedInputStream in_r;
     PipedOutputStream in_w;
     PipedInputStream out_r;
     PipedOutputStream out_w;
     try
     {
         in_r = new PipedInputStream();
         in_w = new PipedOutputStream(in_r);
         out_r = new PipedInputStream();
         out_w = new PipedOutputStream(out_r);
     }
     catch (IOException err)
     {
         dst.Close();
         throw new TransportException(this.uri, JGitText.Get().cannotConnectPipes, err);
     }
     this.worker = new _Thread_365(this, dst, out_r, in_w, "JGit-Receive-Pack");
     // Client side of the pipes should report the problem.
     // Clients side will notice we went away, and report.
     // Ignore close failure, we probably crashed above.
     // Ignore close failure, we probably crashed above.
     this.worker.Start();
     this.Init(in_r, out_w);
     this.ReadAdvertisedRefs();
 }
コード例 #6
0
ファイル: TransportLocal.cs プロジェクト: sharwell/ngit
 /// <exception cref="NGit.Errors.TransportException"></exception>
 public InternalLocalFetchConnection(TransportLocal _enclosing)
     : base(_enclosing)
 {
     this._enclosing = _enclosing;
     Repository dst;
     try
     {
         dst = new FileRepository(this._enclosing.remoteGitDir);
     }
     catch (IOException)
     {
         throw new TransportException(this.uri, JGitText.Get().notAGitDirectory);
     }
     PipedInputStream in_r;
     PipedOutputStream in_w;
     PipedInputStream out_r;
     PipedOutputStream out_w;
     try
     {
         in_r = new PipedInputStream();
         in_w = new PipedOutputStream(in_r);
         out_r = new _PipedInputStream_218();
         // The client (BasePackFetchConnection) can write
         // a huge burst before it reads again. We need to
         // force the buffer to be big enough, otherwise it
         // will deadlock both threads.
         out_w = new PipedOutputStream(out_r);
     }
     catch (IOException err)
     {
         dst.Close();
         throw new TransportException(this.uri, JGitText.Get().cannotConnectPipes, err);
     }
     this.worker = new _Thread_233(this, dst, out_r, in_w, "JGit-Upload-Pack");
     // Client side of the pipes should report the problem.
     // Clients side will notice we went away, and report.
     // Ignore close failure, we probably crashed above.
     // Ignore close failure, we probably crashed above.
     this.worker.Start();
     this.Init(in_r, out_w);
     this.ReadAdvertisedRefs();
 }
コード例 #7
0
ファイル: TransportLocal.cs プロジェクト: sharwell/ngit
 /// <exception cref="NGit.Errors.TransportException"></exception>
 public ForkLocalPushConnection(TransportLocal _enclosing)
     : base(_enclosing)
 {
     this._enclosing = _enclosing;
     MessageWriter msg = new MessageWriter();
     this.SetMessageWriter(msg);
     this.receivePack = this._enclosing.Spawn(this._enclosing.GetOptionReceivePack());
     InputStream rpErr = this.receivePack.GetErrorStream();
     this.errorReaderThread = new StreamCopyThread(rpErr, msg.GetRawStream());
     this.errorReaderThread.Start();
     InputStream rpIn = this.receivePack.GetInputStream();
     OutputStream rpOut = this.receivePack.GetOutputStream();
     rpIn = new BufferedInputStream(rpIn);
     rpOut = new SafeBufferedOutputStream(rpOut);
     this.Init(rpIn, rpOut);
     this.ReadAdvertisedRefs();
 }
コード例 #8
0
ファイル: TransportLocal.cs プロジェクト: ashmind/ngit
 /// <exception cref="NGit.Errors.TransportException"></exception>
 public ForkLocalFetchConnection(TransportLocal _enclosing)
     : base(_enclosing)
 {
     this._enclosing = _enclosing;
     MessageWriter msg = new MessageWriter();
     this.SetMessageWriter(msg);
     this.uploadPack = this._enclosing.Spawn(this._enclosing.GetOptionUploadPack());
     InputStream upErr = this.uploadPack.GetErrorStream();
     this.errorReaderThread = new StreamCopyThread(upErr, msg.GetRawStream());
     this.errorReaderThread.Start();
     InputStream upIn = this.uploadPack.GetInputStream();
     OutputStream upOut = this.uploadPack.GetOutputStream();
     upIn = new BufferedInputStream(upIn);
     upOut = new BufferedOutputStream(upOut);
     this.Init(upIn, upOut);
     this.ReadAdvertisedRefs();
 }