diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-09-30 14:45:28 (GMT) |
|---|---|---|
| committer | Kevin Smith <kevin.smith@isode.com> | 2015-10-30 18:00:01 (GMT) |
| commit | 87ff0cf5d0efcda674bbeb0aec306e92c7527ac5 (patch) | |
| tree | 232a1d7ff34ed4479ce5c302b112cabc21d95305 /Swiften/Network/ProxiedConnection.h | |
| parent | 4a6950af0f324091553f7ab7271de45721b8667f (diff) | |
| download | swift-87ff0cf5d0efcda674bbeb0aec306e92c7527ac5.zip swift-87ff0cf5d0efcda674bbeb0aec306e92c7527ac5.tar.bz2 | |
Fix issues with HTTPTrafficFilter for HTTP proxy / BOSH usage
This patch fixes the code to handle HTTP/1.0 proxies which
do not keep the connection alive after a single request.
If a HTTPTrafficFilter returns a new header reply, the HTTP
CONNECT proxy code will issue the request over a new connection.
The final connection is kept alive, as it used for the
persistent connection forwarding.
In addition, the response status line is now passed to the
HTTPTrafficFilter handling method to provide ability to act
upon the response status code.
Missing passthrough of the HTTPTrafficFilter object the down
the stack to the HTTPConnectProxiedConnection is added.
Test-Information:
Added a unit test following an NTLM HTTP proxy authentication
with a static HTTPTrafficFilter. This and other unit tests
still pass.
Change-Id: Ida0d1aec08a60f10c1480e1eecaecbd3f87b0dca
Diffstat (limited to 'Swiften/Network/ProxiedConnection.h')
| -rw-r--r-- | Swiften/Network/ProxiedConnection.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Swiften/Network/ProxiedConnection.h b/Swiften/Network/ProxiedConnection.h index 91488a1..f301e84 100644 --- a/Swiften/Network/ProxiedConnection.h +++ b/Swiften/Network/ProxiedConnection.h @@ -4,37 +4,37 @@ * See the COPYING file for more information. */ #pragma once #include <boost/enable_shared_from_this.hpp> #include <Swiften/Base/API.h> +#include <Swiften/Base/SafeString.h> #include <Swiften/Network/Connection.h> #include <Swiften/Network/Connector.h> #include <Swiften/Network/HostAddressPort.h> -#include <Swiften/Base/SafeString.h> namespace boost { class thread; namespace system { class error_code; } } namespace Swift { class ConnectionFactory; class SWIFTEN_API ProxiedConnection : public Connection, public boost::enable_shared_from_this<ProxiedConnection> { public: ProxiedConnection(DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory, const std::string& proxyHost, int proxyPort); - ~ProxiedConnection(); + virtual ~ProxiedConnection(); virtual void listen(); virtual void connect(const HostAddressPort& address); virtual void disconnect(); virtual void write(const SafeByteArray& data); virtual HostAddressPort getLocalAddress() const; private: @@ -47,18 +47,20 @@ namespace Swift { void setProxyInitializeFinished(bool success); virtual void initializeProxy() = 0; virtual void handleProxyInitializeData(boost::shared_ptr<SafeByteArray> data) = 0; const HostAddressPort& getServer() const { return server_; } + void reconnect(); + private: bool connected_; DomainNameResolver* resolver_; ConnectionFactory* connectionFactory_; TimerFactory* timerFactory_; std::string proxyHost_; int proxyPort_; HostAddressPort server_; Connector::ref connector_; |
Swift