summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/LINKS1
-rwxr-xr-xtests/fetcher/test1.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/LINKS b/docs/LINKS
index 8e5b042..9d9e6a5 100644
--- a/docs/LINKS
+++ b/docs/LINKS
@@ -31,6 +31,7 @@ http://www.makeuseof.com/tag/build-basic-web-crawler-pull-information-website/
Streams
http://www.mr-edd.co.uk/blog/beginners_guide_streambuf
+http://www.codeproject.com/Articles/4457/zipstream-bzip2stream-iostream-wrappers-for-the-zl
Lua embedding
diff --git a/tests/fetcher/test1.cpp b/tests/fetcher/test1.cpp
index 9e5502d..0355500 100755
--- a/tests/fetcher/test1.cpp
+++ b/tests/fetcher/test1.cpp
@@ -70,6 +70,17 @@ int main( int argc, char *argv[] )
URL url = normalizer.parseUrl( urlString );
RewindInputStream *s = fetcher->fetch( url );
+ if( !s->good( ) ) {
+ cerr << "Failed to fetch '" << url << "': " << s->lastErrMsg( ) << endl;
+ delete s;
+#ifdef USE_MODULELOADER
+ fetchers.destroy( fetcher );
+#else
+ delete fetcher;
+#endif
+ return 1;
+ }
+
copy_stream( *s, cout );
// s->rewind( );
// copy_stream( *s, cout );