Beispiel #1
0
		/// <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;
		}
Beispiel #2
0
		/// <param name="twoWay">
		/// if true, this class will assume the socket is a fully
		/// bidirectional pipe between the two peers and takes advantage
		/// of that by first transmitting the known refs, then waiting to
		/// read commands. If false, this class assumes it must read the
		/// commands before writing output and does not perform the
		/// initial advertising.
		/// </param>
		public virtual void SetBiDirectionalPipe(bool twoWay)
		{
			biDirectionalPipe = twoWay;
			if (!biDirectionalPipe && requestPolicy == UploadPack.RequestPolicy.ADVERTISED)
			{
				requestPolicy = UploadPack.RequestPolicy.REACHABLE_COMMIT;
			}
		}