Skip to content

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abnanda1 committed May 2, 2013
1 parent 38f8d03 commit 87373da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 0 additions & 5 deletions src/Microsoft.AspNet.SignalR.Client/Http/IRequest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.

using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
#if (NET4 || NET45)
using System.Security.Cryptography.X509Certificates;
#endif

namespace Microsoft.AspNet.SignalR.Client.Http
{
Expand Down
10 changes: 4 additions & 6 deletions src/Microsoft.AspNet.SignalR.Client45/Http/DefaultHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void Initialize(IConnection connection)
var handler = new DefaultHttpHandler(connection);

_longRunningClient = new HttpClient(handler);
_shortRunningClient = new HttpClient(handler);
_shortRunningClient = new HttpClient(handler);
}

/// <summary>
Expand All @@ -53,7 +53,7 @@ public Task<IResponse> Get(string url, Action<IRequest> prepareRequest, bool isL

prepareRequest(request);

HttpClient httpClient = (isLongRunning) ? _longRunningClient : _shortRunningClient;
HttpClient httpClient = isLongRunning ? _longRunningClient : _shortRunningClient;

return httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead, cts.Token)
.Then(responseMessage =>
Expand All @@ -68,7 +68,7 @@ public Task<IResponse> Get(string url, Action<IRequest> prepareRequest, bool isL
ConnectionTrace("get request unsuccessful - throwing client exception, responseMessage : {0}", responseMessage.ToString());
throw new HttpClientException(responseMessage);
}
return (IResponse)new HttpResponseMessageWrapper(responseMessage);
});
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public Task<IResponse> Post(string url, Action<IRequest> prepareRequest, IDictio

ConnectionTrace("post request content : {0}", requestMessage.ToString());

HttpClient httpClient = (isLongRunning) ? _longRunningClient : _shortRunningClient;
HttpClient httpClient = isLongRunning ? _longRunningClient : _shortRunningClient;

return httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead, cts.Token).
Then(responseMessage =>
Expand All @@ -118,8 +118,6 @@ public Task<IResponse> Post(string url, Action<IRequest> prepareRequest, IDictio
return (IResponse)new HttpResponseMessageWrapper(responseMessage);
});

// return retVal.Finally((state) => { return (IResponse)new HttpResponseMessageWrapper((HttpResponseMessage)state, client); }, resMessage);
}

public void ConnectionTrace(string format, params object[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public void SetRequestHeaders(IDictionary<string, string> headers)
// request.Headers.UserAgent.Add(new ProductInfoHeaderValue(UserAgent));
}

//_httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(Accept));
if (Accept != null)
{
_httpRequestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(Accept));
}

foreach (KeyValuePair<string, string> headerEntry in headers)
{
Expand Down

0 comments on commit 87373da

Please sign in to comment.