blob: a22ab1a59de4f7a447d111071394ed1d3d9a2c46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "WinHttpFetcher.hpp"
#include "WinHttpRewindInputStream.hpp"
WinHttpFetcher::WinHttpFetcher( )
: m_session( 0 )
{
m_session = WinHttpOpen( L"WinHTTP CrawlingWolf/0.0.1",
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
WINHTTP_NO_PROXY_BYPASS, 0 );
}
WinHttpFetcher::~WinHttpFetcher( )
{
WinHttpCloseHandle( m_session );
}
RewindInputStream *WinHttpFetcher::fetch( const URL url )
{
WinHttpRewindInputStream *s = new WinHttpRewindInputStream( url );
return s;
}
REGISTER_MODULE( "winhttp_fetcher", Fetcher, WinHttpFetcher )
|