public InternalLocalPushConnection(TransportLocal transport) : base(transport) { Repository dst; try { dst = new Repository(transport.remoteGitDir); } catch (IOException) { throw new TransportException(uri, "Not a Git directory"); } 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 ex) { dst.Close(); throw new TransportException(uri, "Cannot connect pipes", ex); } worker = new Thread(() => { try { ReceivePack rp = new ReceivePack(dst); rp.receive(out_r, in_w, null); } catch (IOException) { // Client side of the pipes should report the problem. } catch (Exception) { // Clients side will notice we went away, and report. } finally { try { out_r.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } try { in_w.close(); } catch (IOException) { // Ignore close failure, we probably crashed above. } dst.Close(); } }); worker.Name = "JGit-Receive-Pack"; worker.Start(); init(in_r, out_w); readAdvertisedRefs(); }
public override void Close() { base.Close(); pins.close(); pouts.close(); }