summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-12 12:55:10 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-12 12:55:10 +0200
commitbb12c70e96e7fa3b13335dbfe877dfc68861237f (patch)
tree6e8da241e66d07f32a993e1afe48eac310451dfd /src/modules
parentac286151deff186f69313d1726f669008f145e22 (diff)
downloadcrawler-bb12c70e96e7fa3b13335dbfe877dfc68861237f.tar.gz
crawler-bb12c70e96e7fa3b13335dbfe877dfc68861237f.tar.bz2
we should use WinINet, not WinHttp, spendid!
Diffstat (limited to 'src/modules')
-rwxr-xr-xsrc/modules/fetcher/Makefile.W323
-rwxr-xr-xsrc/modules/fetcher/winhttp/Makefile.W3245
-rwxr-xr-xsrc/modules/fetcher/winhttp/WinHttpFetcher.cpp10
-rwxr-xr-xsrc/modules/fetcher/winhttp/WinHttpFetcher.hpp21
-rwxr-xr-xsrc/modules/fetcher/winhttp/WinHttpRewindInputStream.cpp14
-rwxr-xr-xsrc/modules/fetcher/winhttp/WinHttpRewindInputStream.hpp22
6 files changed, 113 insertions, 2 deletions
diff --git a/src/modules/fetcher/Makefile.W32 b/src/modules/fetcher/Makefile.W32
index 044cb38..aec842a 100755
--- a/src/modules/fetcher/Makefile.W32
+++ b/src/modules/fetcher/Makefile.W32
@@ -1,7 +1,6 @@
TOPDIR = ..\..\..
-SUBDIRS = file
-#libfetch
+SUBDIRS = winhttp file
!INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk
diff --git a/src/modules/fetcher/winhttp/Makefile.W32 b/src/modules/fetcher/winhttp/Makefile.W32
new file mode 100755
index 0000000..49874e0
--- /dev/null
+++ b/src/modules/fetcher/winhttp/Makefile.W32
@@ -0,0 +1,45 @@
+TOPDIR = ..\..\..\..
+
+SUBDIRS =
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk
+
+INCLUDE_CXXFLAGS = \
+ /D_WIN32_WINNT=0x504 /DSHARED
+
+INCLUDE_DIRS = \
+ /I. \
+ /I$(TOPDIR)\src
+
+INCLUDE_LDFLAGS = \
+
+INCLUDE_LIBS = \
+ $(TOPDIR)\src\crawlingwolf.lib
+
+DYNAMIC_MODULE = \
+ mod_fetcher_winhttp.dll
+
+STATIC_LIB = \
+ winhttpfetcher.lib
+
+CPP_OBJS = \
+ WinHttpFetcher.obj \
+ WinHttpRewindInputStream.obj
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\sub.mk
+
+$(STATIC_LIB): $(CPP_OBJS)
+ $(LINK) /lib /nologo /out:$@ $(STATIC_LDFLAGS) $?
+
+$(DYNAMIC_MODULE): $(CPP_OBJS)
+ $(LINK) /dll /nologo /out:$@ $(LDFLAGS) $(LIBS) $?
+
+local_all: $(STATIC_LIB) $(DYNAMIC_MODULE)
+
+local_clean:
+ @-erase $(LOCAL_STATIC_LIB) 2>NUL
+ @-erase $(CPP_OBJS) 2>NUL
+
+local_distclean:
+
+local_test:
diff --git a/src/modules/fetcher/winhttp/WinHttpFetcher.cpp b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp
new file mode 100755
index 0000000..06ab550
--- /dev/null
+++ b/src/modules/fetcher/winhttp/WinHttpFetcher.cpp
@@ -0,0 +1,10 @@
+#include "WinHttpFetcher.hpp"
+#include "WinHttpRewindInputStream.hpp"
+
+RewindInputStream *WinHttpFetcher::fetch( const URL url )
+{
+ WinHttpRewindInputStream *s = new WinHttpRewindInputStream( url );
+ return s;
+}
+
+REGISTER_MODULE( "winhttp", Fetcher, WinHttpFetcher )
diff --git a/src/modules/fetcher/winhttp/WinHttpFetcher.hpp b/src/modules/fetcher/winhttp/WinHttpFetcher.hpp
new file mode 100755
index 0000000..a731da6
--- /dev/null
+++ b/src/modules/fetcher/winhttp/WinHttpFetcher.hpp
@@ -0,0 +1,21 @@
+#ifndef __WINHTTP_FETCHER_H
+#define __WINHTTP_FETCHER_H
+
+#include "Fetcher.hpp"
+#include "ModuleRegistry.hpp"
+
+class WinHttpFetcher : public Fetcher
+{
+ public:
+ WinHttpFetcher( ) {
+ }
+
+ virtual ~WinHttpFetcher( ) {
+ }
+
+ virtual RewindInputStream *fetch( const URL url );
+};
+
+DECLARE_MODULE( Fetcher )
+
+#endif
diff --git a/src/modules/fetcher/winhttp/WinHttpRewindInputStream.cpp b/src/modules/fetcher/winhttp/WinHttpRewindInputStream.cpp
new file mode 100755
index 0000000..35904c3
--- /dev/null
+++ b/src/modules/fetcher/winhttp/WinHttpRewindInputStream.cpp
@@ -0,0 +1,14 @@
+#include "WinHttpRewindInputStream.hpp"
+
+WinHttpRewindInputStream::WinHttpRewindInputStream( const URL &url )
+ : RewindInputStream( url )
+{
+}
+
+WinHttpRewindInputStream::~WinHttpRewindInputStream( )
+{
+}
+
+void WinHttpRewindInputStream::rewind( )
+{
+}
diff --git a/src/modules/fetcher/winhttp/WinHttpRewindInputStream.hpp b/src/modules/fetcher/winhttp/WinHttpRewindInputStream.hpp
new file mode 100755
index 0000000..7c3acfb
--- /dev/null
+++ b/src/modules/fetcher/winhttp/WinHttpRewindInputStream.hpp
@@ -0,0 +1,22 @@
+#ifndef __WINHTTP_REWIND_INPUT_STREAM_H
+#define __WINHTTP_REWIND_INPUT_STREAM_H
+
+#include "RewindInputStream.hpp"
+#include "URL.hpp"
+
+#define WIN32_MEAN_AND_LEAN
+#include <windows.h>
+#include <winhttp.h>
+
+class WinHttpRewindInputStream : public RewindInputStream
+{
+ public:
+ WinHttpRewindInputStream( const URL &url );
+ virtual ~WinHttpRewindInputStream( );
+
+ virtual void rewind( );
+
+ private:
+};
+
+#endif