From 0754a2b7444afacbc7ab47f95fdf2aaabd590b67 Mon Sep 17 00:00:00 2001 From: Steven Moazami Date: Thu, 15 Dec 2011 12:49:46 -0500 Subject: [PATCH] Fix connection hangs when talking to Boxcar service Signed-off-by: John Reese --- push.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/push.cpp b/push.cpp index 66ef657..b6c3ffd 100644 --- a/push.cpp +++ b/push.cpp @@ -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);