mirror of https://github.com/SeanOMik/znc-push.git
Fix connection hangs when talking to Boxcar service
Signed-off-by: John Reese <john@noswap.com>
This commit is contained in:
parent
54340cb90e
commit
0754a2b744
10
push.cpp
10
push.cpp
|
@ -1241,18 +1241,18 @@ void CPushSocket::Request(bool post, const CString& host, const CString& url, MC
|
||||||
if (post)
|
if (post)
|
||||||
{
|
{
|
||||||
request += "POST " + url + " HTTP/1.1" + crlf;
|
request += "POST " + url + " HTTP/1.1" + crlf;
|
||||||
request += "Host: " + host + crlf;
|
|
||||||
request += "Content-Type: application/x-www-form-urlencoded" + crlf;
|
request += "Content-Type: application/x-www-form-urlencoded" + crlf;
|
||||||
request += "Content-Length: " + CString(query.length()) + crlf;
|
request += "Content-Length: " + CString(query.length()) + crlf;
|
||||||
request += "User-Agent: " + user_agent + crlf;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
request += "GET " + url + "?" + query + " HTTP/1.1" + crlf;
|
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 != "")
|
if (auth != "")
|
||||||
{
|
{
|
||||||
request += "Authorization: Basic " + auth + crlf;
|
request += "Authorization: Basic " + auth + crlf;
|
||||||
|
@ -1262,7 +1262,7 @@ void CPushSocket::Request(bool post, const CString& host, const CString& url, MC
|
||||||
|
|
||||||
if (post)
|
if (post)
|
||||||
{
|
{
|
||||||
request += query + crlf;
|
request += query;
|
||||||
}
|
}
|
||||||
|
|
||||||
Write(request);
|
Write(request);
|
||||||
|
|
Loading…
Reference in New Issue