/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void AdvertiseRefs(UploadPack rp) { for (int i = 0; i < count; i++) { hooks[i].AdvertiseRefs(rp); } }
public override void Run() { try { UploadPack rp = this._enclosing._enclosing.CreateUploadPack(dst); rp.Upload(out_r, in_w, null); } catch (IOException err) { Sharpen.Runtime.PrintStackTrace(err); } catch (RuntimeException err) { Sharpen.Runtime.PrintStackTrace(err); } finally { try { out_r.Close(); } catch (IOException) { } try { in_w.Close(); } catch (IOException) { } dst.Close(); } }
/// <exception cref="System.IO.IOException"></exception> /// <exception cref="NGit.Transport.Resolver.ServiceNotEnabledException"></exception> /// <exception cref="NGit.Transport.Resolver.ServiceNotAuthorizedException"></exception> internal override void Execute(DaemonClient dc, Repository db) { UploadPack up = this._enclosing.uploadPackFactory.Create(dc, db); InputStream @in = dc.GetInputStream(); OutputStream @out = dc.GetOutputStream(); up.Upload(@in, @out, null); }
public override void AdvertiseUploadPack(Stream output) { using (var repository = GetRepository()) { var pack = new UploadPack(repository); pack.SendAdvertisedRefs(new RefAdvertiser.PacketLineOutRefAdvertiser(new PacketLineOut(output))); } }
/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnBeginNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntOffered) { for (int i = 0; i < count; i++) { hooks[i].OnBeginNegotiateRound(up, wants, cntOffered); } }
/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnEndNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntCommon, int cntNotFound, bool ready) { for (int i = 0; i < count; i++) { hooks[i].OnEndNegotiateRound(up, wants, cntCommon, cntNotFound, ready); } }
/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnSendPack <_T0, _T1>(UploadPack up, ICollection <_T0> wants, ICollection <_T1> haves) { for (int i = 0; i < count; i++) { hooks[i].OnSendPack(up, wants, haves); } }
/// <exception cref="NGit.Transport.Resolver.ServiceNotEnabledException"></exception> /// <exception cref="NGit.Transport.Resolver.ServiceNotAuthorizedException"></exception> public override UploadPack Create(DaemonClient req, Repository db) { UploadPack up = new UploadPack(db); up.SetTimeout(this._enclosing.GetTimeout()); up.SetPackConfig(this._enclosing.GetPackConfig()); return(up); }
// Do nothing. /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnSendPack <_T0, _T1>(UploadPack up, ICollection <_T0> wants, ICollection <_T1> haves) { }
// Do nothing. /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnEndNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntCommon, int cntNotFound, bool ready) { }
/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void OnBeginNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntOffered) { }
/// <summary>Invoked just before a pack will be sent to the client.</summary> /// <remarks>Invoked just before a pack will be sent to the client.</remarks> /// <param name="up">the upload pack instance handling the connection.</param> /// <param name="wants"> /// the list of wanted objects. These may be RevObject or /// RevCommit if the processed parsed them. Implementors should /// not rely on the values being parsed. /// </param> /// <param name="haves"> /// the list of common objects. Empty on an initial clone request. /// These may be RevObject or RevCommit if the processed parsed /// them. Implementors should not rely on the values being parsed. /// </param> /// <exception cref="ServiceMayNotContinueException">abort; the message will be sent to the user. /// </exception> /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public abstract void OnSendPack <_T0, _T1>(UploadPack up, ICollection <_T0> wants, ICollection <_T1> haves) where _T0 : ObjectId where _T1 : ObjectId;
/// <summary>Invoked after a negotiation round is completed.</summary> /// <remarks>Invoked after a negotiation round is completed.</remarks> /// <param name="up">the upload pack instance handling the connection.</param> /// <param name="wants">the list of wanted objects.</param> /// <param name="cntCommon"> /// number of objects this round found to be common. In a smart /// HTTP transaction this includes the objects that were /// previously found to be common. /// </param> /// <param name="cntNotFound"> /// number of objects in this round the local repository does not /// have, but that were offered as potential common bases. /// </param> /// <param name="ready"> /// true if a pack is ready to be sent (the commit graph was /// successfully cut). /// </param> /// <exception cref="ServiceMayNotContinueException">abort; the message will be sent to the user. /// </exception> /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public abstract void OnEndNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntCommon, int cntNotFound, bool ready) where _T0 : ObjectId;
// Do nothing. /// <summary>Invoked before negotiation round is started.</summary> /// <remarks>Invoked before negotiation round is started.</remarks> /// <param name="up">the upload pack instance handling the connection.</param> /// <param name="wants">the list of wanted objects.</param> /// <param name="cntOffered">number of objects the client has offered.</param> /// <exception cref="ServiceMayNotContinueException">abort; the message will be sent to the user. /// </exception> /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public abstract void OnBeginNegotiateRound <_T0>(UploadPack up, ICollection <_T0> wants , int cntOffered) where _T0 : ObjectId;
public override void Upload(Stream inputStream, Stream outputStream) { using (var repository = GetRepository()) { var pack = new UploadPack(repository); pack.SetBiDirectionalPipe(false); pack.Upload(inputStream, outputStream, outputStream); } }
public override void AdvertiseRefs(UploadPack uploadPack) { }
/// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public override void AdvertiseRefs(UploadPack uploadPack) { uploadPack.SetAdvertisedRefs(GetAdvertisedRefs(uploadPack.GetRepository(), uploadPack .GetRevWalk())); }
// Do nothing. /// <summary> /// Invoked just before /// <see cref="UploadPack.SendAdvertisedRefs(RefAdvertiser)">UploadPack.SendAdvertisedRefs(RefAdvertiser) /// </see> /// . /// </summary> /// <param name="up">the upload pack instance handling the connection.</param> /// <exception cref="UploadPackMayNotContinueException">abort; the message will be sent to the user. /// </exception> /// <exception cref="NGit.Transport.UploadPackMayNotContinueException"></exception> public abstract void OnPreAdvertiseRefs(UploadPack up);
/// <param name="policy"> /// the policy used to enforce validation of a client's want list. /// By default the policy is /// <see cref="RequestPolicy.ADVERTISED">RequestPolicy.ADVERTISED</see> /// , /// which is the Git default requiring clients to only ask for an /// object that a reference directly points to. This may be relaxed /// to /// <see cref="RequestPolicy.REACHABLE_COMMIT">RequestPolicy.REACHABLE_COMMIT</see> /// when callers /// have /// <see cref="SetBiDirectionalPipe(bool)">SetBiDirectionalPipe(bool)</see> /// set to false. /// </param> public virtual void SetRequestPolicy(UploadPack.RequestPolicy policy) { requestPolicy = policy != null ? policy : UploadPack.RequestPolicy.ADVERTISED; }
/// <exception cref="NGit.Transport.UploadPackMayNotContinueException"></exception> public override void OnPreAdvertiseRefs(UploadPack up) { }
// Do nothing. /// <summary>Advertise refs for upload-pack.</summary> /// <remarks>Advertise refs for upload-pack.</remarks> /// <param name="uploadPack"> /// instance on which to call /// <see cref="UploadPack.SetAdvertisedRefs(System.Collections.Generic.IDictionary{K, V}) /// ">UploadPack.SetAdvertisedRefs(System.Collections.Generic.IDictionary<K, V>) /// </see> /// if necessary. /// </param> /// <exception cref="ServiceMayNotContinueException">abort; the message will be sent to the user. /// </exception> /// <exception cref="NGit.Transport.ServiceMayNotContinueException"></exception> public abstract void AdvertiseRefs(UploadPack uploadPack);
/// <exception cref="System.IO.IOException"></exception> internal override void Execute(DaemonClient dc, Repository db) { UploadPack rp = new UploadPack(db); InputStream @in = dc.GetInputStream(); rp.SetTimeout(this._enclosing.GetTimeout()); rp.SetPackConfig(this._enclosing.packConfig); rp.Upload(@in, dc.GetOutputStream(), null); }