/// <summary> /// Initializes a new <c>VssHttpMessageHandler</c> instance with the specified credentials and request /// settings. /// </summary> /// <param name="credentials">The credentials which should be used</param> /// <param name="settings">The request settings which should be used</param> /// <param name="innerHandler"></param> public VssHttpMessageHandler( VssCredentials credentials, VssHttpRequestSettings settings, HttpMessageHandler innerHandler) { this.Credentials = credentials; this.Settings = settings; this.ExpectContinue = settings.ExpectContinue; m_credentialWrapper = new CredentialWrapper(); m_messageInvoker = new HttpMessageInvoker(innerHandler); // If we were given a pipeline make sure we find the inner-most handler to apply our settings as this // will be the actual outgoing transport. { HttpMessageHandler transportHandler = innerHandler; DelegatingHandler delegatingHandler = transportHandler as DelegatingHandler; while (delegatingHandler != null) { transportHandler = delegatingHandler.InnerHandler; delegatingHandler = transportHandler as DelegatingHandler; } m_transportHandler = transportHandler; } ApplySettings(m_transportHandler, m_credentialWrapper, this.Settings); }
/// <summary> /// Copy Constructor /// </summary> /// <param name="copy"></param> protected VssHttpRequestSettings(VssHttpRequestSettings copy) { this.AllowAutoRedirect = copy.AllowAutoRedirect; this.CompressionEnabled = copy.CompressionEnabled; this.ExpectContinue = copy.ExpectContinue; this.BypassProxyOnLocal = copy.BypassProxyOnLocal; this.MaxContentBufferSize = copy.MaxContentBufferSize; this.SendTimeout = copy.SendTimeout; this.m_acceptLanguages = new List <CultureInfo>(copy.AcceptLanguages); this.SessionId = copy.SessionId; this.AgentId = copy.AgentId; this.SuppressFedAuthRedirects = copy.SuppressFedAuthRedirects; this.UserAgent = new List <ProductInfoHeaderValue>(copy.UserAgent); this.OperationName = copy.OperationName; this.ClientCertificateManager = copy.ClientCertificateManager; this.ServerCertificateValidationCallback = copy.ServerCertificateValidationCallback; this.MaxRetryRequest = copy.MaxRetryRequest; this.UseHttp11 = copy.UseHttp11; }
/// <summary> /// Initializes a new <c>VssHttpMessageHandler</c> instance with the specified credentials and request /// settings. /// </summary> /// <param name="credentials">The credentials which should be used</param> /// <param name="settings">The request settings which should be used</param> public VssHttpMessageHandler( VssCredentials credentials, VssHttpRequestSettings settings) : this(credentials, settings, new HttpClientHandler()) { }