Ejemplo n.º 1
0
            /// <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();
            }
Ejemplo n.º 2
0
 /// <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();
 }