2008-09-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Moved isProxyGETRequest function outside #ifdef ENABLE_ASYNC_DNS 
clause
	to fix compile error when async DNS is not enabled by 
configuration.
	* src/AbstractCommand.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2008-09-16 10:57:27 +00:00
parent c921529d68
commit a1bac34778
2 changed files with 19 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2008-09-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Moved isProxyGETRequest function outside #ifdef ENABLE_ASYNC_DNS clause
to fix compile error when async DNS is not enabled by configuration.
* src/AbstractCommand.cc
2008-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If establishing conneciton to a server is failed, then mark error on

View File

@ -269,6 +269,19 @@ void AbstractCommand::setWriteCheckSocket(const SocketHandle& socket) {
}
}
static bool isProxyGETRequest(const std::string& protocol, const Option* option)
{
return
// For HTTP/HTTPS
((protocol == Request::PROTO_HTTP || protocol == Request::PROTO_HTTPS) &&
(option->getAsBool(PREF_HTTP_PROXY_ENABLED) &&
option->get(PREF_HTTP_PROXY_METHOD) == V_GET)) ||
// For FTP
(protocol == Request::PROTO_FTP &&
(option->getAsBool(PREF_HTTP_PROXY_ENABLED) &&
option->get(PREF_FTP_VIA_HTTP_PROXY) == V_GET));
}
#ifdef ENABLE_ASYNC_DNS
bool AbstractCommand::isAsyncNameResolverInitialized() const
@ -284,19 +297,6 @@ void AbstractCommand::initAsyncNameResolver(const std::string& hostname)
setNameResolverCheck(_asyncNameResolver);
}
static bool isProxyGETRequest(const std::string& protocol, const Option* option)
{
return
// For HTTP/HTTPS
((protocol == Request::PROTO_HTTP || protocol == Request::PROTO_HTTPS) &&
(option->getAsBool(PREF_HTTP_PROXY_ENABLED) &&
option->get(PREF_HTTP_PROXY_METHOD) == V_GET)) ||
// For FTP
(protocol == Request::PROTO_FTP &&
(option->getAsBool(PREF_HTTP_PROXY_ENABLED) &&
option->get(PREF_FTP_VIA_HTTP_PROXY) == V_GET));
}
bool AbstractCommand::asyncResolveHostname()
{
switch(_asyncNameResolver->getStatus()) {