Fix connection hangs when talking to Boxcar service

Signed-off-by: John Reese <john@noswap.com>
This commit is contained in:
Steven Moazami 2011-12-15 12:49:46 -05:00 committed by John Reese
parent 54340cb90e
commit 0754a2b744
1 changed files with 5 additions and 5 deletions

View File

@ -1241,18 +1241,18 @@ void CPushSocket::Request(bool post, const CString& host, const CString& url, MC
if (post)
{
request += "POST " + url + " HTTP/1.1" + crlf;
request += "Host: " + host + crlf;
request += "Content-Type: application/x-www-form-urlencoded" + crlf;
request += "Content-Length: " + CString(query.length()) + crlf;
request += "User-Agent: " + user_agent + crlf;
}
else
{
request += "GET " + url + "?" + query + " HTTP/1.1" + crlf;
request += "Host: " + host + crlf;
request += "User-Agent: " + user_agent + crlf;
}
request += "Host: " + host + crlf;
request += "Connection: close" + crlf;
request += "User-Agent: " + user_agent + crlf;
if (auth != "")
{
request += "Authorization: Basic " + auth + crlf;
@ -1262,7 +1262,7 @@ void CPushSocket::Request(bool post, const CString& host, const CString& url, MC
if (post)
{
request += query + crlf;
request += query;
}
Write(request);