diff options
| author | Kevin Smith <git@kismith.co.uk> | 2012-12-04 08:04:52 (GMT) |
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2012-12-04 08:04:52 (GMT) |
| commit | 33c379ef63279833c49919fd619668b19b138f3b (patch) | |
| tree | 3ce9f6ecebbf49602e9eda862413847d59eca686 | |
| parent | c06c4d264aca4e252495181a8de01960abad983f (diff) | |
| download | swift-33c379ef63279833c49919fd619668b19b138f3b.zip swift-33c379ef63279833c49919fd619668b19b138f3b.tar.bz2 | |
Remove double // and :1 port from BOSH paths
Change-Id: Iff89e5a01565676295f634ee92760854c4872e6d
Resolves: #1187
| -rw-r--r-- | Swiften/Network/BOSHConnection.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swiften/Network/BOSHConnection.cpp b/Swiften/Network/BOSHConnection.cpp index 4741549..539109a 100644 --- a/Swiften/Network/BOSHConnection.cpp +++ b/Swiften/Network/BOSHConnection.cpp @@ -152,26 +152,30 @@ void BOSHConnection::startStream(const std::string& to, unsigned long long rid) << " to='" << to << "'" << " rid='" << rid << "'" << " ver='1.6'" << " wait='60'" /* FIXME: we probably want this configurable*/ /*<< " ack='0'" FIXME: support acks */ << " xml:lang='en'" << " xmlns:xmpp='urn:xmpp:bosh'" << " xmpp:version='1.0'" << " xmlns='http://jabber.org/protocol/httpbind' />"; std::string contentString = content.str(); - 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: " << contentString.size() << "\r\n\r\n" << contentString; waitingForStartResponse_ = true; SafeByteArray safeHeader = createSafeByteArray(header.str()); onBOSHDataWritten(safeHeader); connection_->write(safeHeader); SWIFT_LOG(debug) << "write stream header: " << safeByteArrayToString(safeHeader) << std::endl; } |
Swift