apr and serf: link in apr, apr-utils, and serf

- Links in apr, apr-utils, and serf.
- Replaces the wget fetcher with serf, which will be replaced later
on with the native fetcher.
This commit is contained in:
Otto van der Schaaf
2012-11-07 00:53:14 -08:00
parent 5d488f3281
commit b1eb547275
3 changed files with 31 additions and 4 deletions
+11 -2
View File
@@ -23,10 +23,15 @@ ngx_feature_incs="
#include \"net/instaweb/util/public/string_writer.h\"
#include \"net/instaweb/util/public/null_message_handler.h\"
"
# TODO(oschaaf): include apr/apr-util in a portable manner
pagespeed_include="$mod_pagespeed_dir
$mod_pagespeed_dir/third_party/chromium/src/
$mod_pagespeed_dir/third_party/protobuf/src/
$mod_pagespeed_dir/out/Release/obj/gen/"
$mod_pagespeed_dir/out/Release/obj/gen/
$mod_pagespeed_dir/third_party/apr/src/include/
$mod_pagespeed_dir/third_party/apr/gen/arch/linux/x64/include/
$mod_pagespeed_dir/third_party/aprutil/src/include/
$mod_pagespeed_dir/third_party/aprutil/gen/arch/linux/x64/include/"
ngx_feature_path="$pagespeed_include"
pagespeed_automatic_dir="$mod_pagespeed_dir/net/instaweb/automatic"
pagespeed_libs="-lstdc++ $pagespeed_automatic_dir/pagespeed_automatic.a -lrt"
@@ -59,7 +64,11 @@ if [ $ngx_found = yes ]; then
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ps_src/ngx_rewrite_driver_factory.cc"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ps_src/ngx_base_fetch.cc"
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
CORE_LIBS="$CORE_LIBS $pagespeed_libs"
CORE_LIBS="$CORE_LIBS
$pagespeed_libs
$mod_pagespeed_dir/out/Release/obj.target/third_party/serf/libserf.a
$mod_pagespeed_dir/out/Release/obj.target/third_party/apr/libapr.a
$mod_pagespeed_dir/out/Release/obj.target/third_party/aprutil/libaprutil.a"
CORE_INCS="$CORE_INCS $pagespeed_include"
else
cat << END
+18 -1
View File
@@ -38,6 +38,10 @@
#include "net/instaweb/util/public/thread_system.h"
#include "net/instaweb/util/public/threadsafe_cache.h"
//XXX: discuss the proper way to to this:
#include "net/instaweb/apache/apr_thread_compatible_pool.cc"
#include "net/instaweb/apache/serf_url_async_fetcher.cc"
namespace net_instaweb {
class CacheInterface;
@@ -49,11 +53,15 @@ class Timer;
class UrlAsyncFetcher;
class UrlFetcher;
class Writer;
//class SerfUrlAsyncFetcher;
NgxRewriteDriverFactory::NgxRewriteDriverFactory() {
RewriteDriverFactory::InitStats(&simple_stats_);
SerfUrlAsyncFetcher::InitStats(&simple_stats_);
SetStatistics(&simple_stats_);
timer_ = DefaultTimer();
apr_initialize();
apr_pool_create(&pool_,NULL);
}
NgxRewriteDriverFactory::~NgxRewriteDriverFactory() {
@@ -69,7 +77,16 @@ UrlFetcher* NgxRewriteDriverFactory::DefaultUrlFetcher() {
}
UrlAsyncFetcher* NgxRewriteDriverFactory::DefaultAsyncUrlFetcher() {
return new FakeUrlAsyncFetcher(ComputeUrlFetcher());
net_instaweb::UrlAsyncFetcher* fetcher = new net_instaweb::SerfUrlAsyncFetcher(
// "127.0.0.1:80",
"",
pool_,
thread_system(),
statistics(),
timer(),
2500,
message_handler());
return fetcher;
}
MessageHandler* NgxRewriteDriverFactory::DefaultHtmlParseMessageHandler() {
+2 -1
View File
@@ -21,6 +21,7 @@
#include "net/instaweb/rewriter/public/rewrite_driver_factory.h"
#include "net/instaweb/util/public/simple_stats.h"
#include "apr_pools.h"
namespace net_instaweb {
@@ -41,7 +42,7 @@ class NgxRewriteDriverFactory : public RewriteDriverFactory {
private:
SimpleStats simple_stats_;
Timer* timer_;
apr_pool_t* pool_;
DISALLOW_COPY_AND_ASSIGN(NgxRewriteDriverFactory);
};