summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-11-13 10:15:29 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-11-13 10:50:15 (GMT)
commit59c1b26ba8f85bfb52f7c8e95bf1eca208d3de7b (patch)
tree8b911fee527973ec3406640b0dfa8c7dcd6cf8b6 /Swiften/Network/BOSHConnection.cpp
parentd26ad781dd4d1fa2019d31d5effabb9d662a8417 (diff)
downloadswift-59c1b26ba8f85bfb52f7c8e95bf1eca208d3de7b.zip
swift-59c1b26ba8f85bfb52f7c8e95bf1eca208d3de7b.tar.bz2
Allow BOSH URL setting again.
Also fixes use of getPort() so that HTTP headers aren't all for port :1. Change-Id: I8ead8a7f4826d1105bf1feafea21e6139e803de7 Resolves: #1178
Diffstat (limited to 'Swiften/Network/BOSHConnection.cpp')
-rw-r--r--Swiften/Network/BOSHConnection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp
index 73f8ed6..4741549 100644
--- a/Swiften/Network/BOSHConnection.cpp
+++ b/Swiften/Network/BOSHConnection.cpp
@@ -101,8 +101,12 @@ std::pair<SafeByteArray, size_t> BOSHConnection::createHTTPRequest(const SafeByt
size = safeContent.size();
- header << "POST /" << boshURL.getPath() << " HTTP/1.1\r\n"
- << "Host: " << boshURL.getHost() << ":" << boshURL.getPort() << "\r\n"
+ header << "POST " << boshURL.getPath() << " HTTP/1.1\r\n"
+ << "Host: " << boshURL.getHost();
+ if (boshURL.getPort()) {
+ header << ":" << *boshURL.getPort();
+ }
+ header << "\r\n"
/*<< "Accept-Encoding: deflate\r\n"*/
<< "Content-Type: text/xml; charset=utf-8\r\n"
<< "Content-Length: " << size << "\r\n\r\n";