diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-08-12 19:13:52 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-08-12 19:13:52 +0200 |
commit | 5fe4ec20a6aa83dc8728ff83766efc35c7818ab6 (patch) | |
tree | d81a1be98664433080e69521982d6d3092d1a9f9 /src/modules | |
parent | 63929b266e3000374c5e5161e4495d64142b907e (diff) | |
download | crawler-5fe4ec20a6aa83dc8728ff83766efc35c7818ab6.tar.gz crawler-5fe4ec20a6aa83dc8728ff83766efc35c7818ab6.tar.bz2 |
added a fetcher module test
Diffstat (limited to 'src/modules')
-rwxr-xr-x | src/modules/fetcher/winhttp/WinHttpFetcher.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/fetcher/winhttp/WinHttpFetcher.cpp b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp index a22ab1a..1adc7a0 100755 --- a/src/modules/fetcher/winhttp/WinHttpFetcher.cpp +++ b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp @@ -1,6 +1,11 @@ #include "WinHttpFetcher.hpp" #include "WinHttpRewindInputStream.hpp" +#include "win32/errormsg.hpp" + +#include <sstream> +#include <stdexcept> + WinHttpFetcher::WinHttpFetcher( ) : m_session( 0 ) { @@ -8,6 +13,12 @@ WinHttpFetcher::WinHttpFetcher( ) WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0 ); + + if( !m_session ) { + std::ostringstream ss; + ss << "Error creating WinHttp session: " << getLastError( ); + throw new std::runtime_error( ss.str( ) ); + } } WinHttpFetcher::~WinHttpFetcher( ) |