Update to pagespeed_automatic.ca more symbols + symbol renaming
This make it possible to build w/o disabling SSL, makes us need less extra .a + .cc files, but does mean that APR can't be used directly (since it got renamed), so just use PosixTimer where it was used.
This commit is contained in:
@@ -89,9 +89,7 @@ if [ "$uname_arch" = "i686" ]; then
|
|||||||
FLAG_MARCH='-march=i686'
|
FLAG_MARCH='-march=i686'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Building with HTTPS fetching enabled pulls in a version of OpenSSL that causes
|
CFLAGS="$CFLAGS $FLAG_MARCH"
|
||||||
# linker errors, so disable it here.
|
|
||||||
CFLAGS="$CFLAGS -DSERF_HTTPS_FETCHING=0 $FLAG_MARCH"
|
|
||||||
|
|
||||||
case "$NGX_GCC_VER" in
|
case "$NGX_GCC_VER" in
|
||||||
4.8*)
|
4.8*)
|
||||||
@@ -128,17 +126,10 @@ ngx_feature_path="$pagespeed_include"
|
|||||||
|
|
||||||
if $build_from_source ; then
|
if $build_from_source ; then
|
||||||
psol_library_binaries="\
|
psol_library_binaries="\
|
||||||
$mod_pagespeed_dir/net/instaweb/automatic/pagespeed_automatic.a \
|
$mod_pagespeed_dir/net/instaweb/automatic/pagespeed_automatic.a"
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj.target/third_party/serf/libserf.a \
|
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj.target/third_party/aprutil/libaprutil.a \
|
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj.target/third_party/apr/libapr.a"
|
|
||||||
else
|
else
|
||||||
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
|
psol_library_dir="$ngx_addon_dir/psol/lib/$buildtype/$os_name/$arch_name"
|
||||||
psol_library_binaries="\
|
psol_library_binaries="$psol_library_dir/pagespeed_automatic.a"
|
||||||
$psol_library_dir/pagespeed_automatic.a \
|
|
||||||
$psol_library_dir/libserf.a \
|
|
||||||
$psol_library_dir/libaprutil.a \
|
|
||||||
$psol_library_dir/libapr.a"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pagespeed_libs="-lstdc++ $psol_library_binaries -lrt -pthread -lm"
|
pagespeed_libs="-lstdc++ $psol_library_binaries -lrt -pthread -lm"
|
||||||
@@ -190,13 +181,7 @@ if [ $ngx_found = yes ]; then
|
|||||||
$ps_src/ngx_rewrite_driver_factory.cc \
|
$ps_src/ngx_rewrite_driver_factory.cc \
|
||||||
$ps_src/ngx_rewrite_options.cc \
|
$ps_src/ngx_rewrite_options.cc \
|
||||||
$ps_src/ngx_server_context.cc \
|
$ps_src/ngx_server_context.cc \
|
||||||
$ps_src/ngx_url_async_fetcher.cc \
|
$ps_src/ngx_url_async_fetcher.cc"
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj/gen/data2c_out/instaweb/net/instaweb/apache/install/mod_pagespeed_example/mod_pagespeed_console_out.cc \
|
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj/gen/data2c_out/instaweb/net/instaweb/apache/install/mod_pagespeed_example/mod_pagespeed_console_css_out.cc \
|
|
||||||
$mod_pagespeed_dir/out/$buildtype/obj/gen/data2c_out/instaweb/net/instaweb/apache/install/mod_pagespeed_example/mod_pagespeed_console_html_out.cc \
|
|
||||||
$mod_pagespeed_dir/net/instaweb/system/add_headers_fetcher.cc \
|
|
||||||
$mod_pagespeed_dir/net/instaweb/system/loopback_route_fetcher.cc \
|
|
||||||
$mod_pagespeed_dir/net/instaweb/system/serf_url_async_fetcher.cc"
|
|
||||||
|
|
||||||
# Make pagespeed run immediately before gzip.
|
# Make pagespeed run immediately before gzip.
|
||||||
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "apr_time.h"
|
|
||||||
|
|
||||||
#include "net/instaweb/util/public/abstract_mutex.h"
|
#include "net/instaweb/util/public/abstract_mutex.h"
|
||||||
#include "net/instaweb/util/public/debug.h"
|
#include "net/instaweb/util/public/debug.h"
|
||||||
#include "net/instaweb/util/public/shared_circular_buffer.h"
|
#include "net/instaweb/util/public/shared_circular_buffer.h"
|
||||||
#include "net/instaweb/util/public/string_util.h"
|
#include "net/instaweb/util/public/string_util.h"
|
||||||
#include "net/instaweb/public/version.h"
|
#include "net/instaweb/public/version.h"
|
||||||
|
#include "pagespeed/kernel/base/posix_timer.h"
|
||||||
|
#include "pagespeed/kernel/base/time_util.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -118,10 +118,9 @@ void NgxMessageHandler::MessageVImpl(MessageType type, const char* msg,
|
|||||||
// Prepend time and severity to message.
|
// Prepend time and severity to message.
|
||||||
// Format is [time] [severity] [pid] message.
|
// Format is [time] [severity] [pid] message.
|
||||||
GoogleString message;
|
GoogleString message;
|
||||||
char time_buffer[APR_CTIME_LEN + 1];
|
GoogleString time;
|
||||||
const char* time = time_buffer;
|
PosixTimer timer;
|
||||||
apr_status_t status = apr_ctime(time_buffer, apr_time_now());
|
if (!ConvertTimeToString(timer.NowMs(), &time)) {
|
||||||
if (status != APR_SUCCESS) {
|
|
||||||
time = "?";
|
time = "?";
|
||||||
}
|
}
|
||||||
StrAppend(&message, "[", time, "] ",
|
StrAppend(&message, "[", time, "] ",
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
#include "net/instaweb/util/public/string_writer.h"
|
#include "net/instaweb/util/public/string_writer.h"
|
||||||
#include "net/instaweb/util/public/time_util.h"
|
#include "net/instaweb/util/public/time_util.h"
|
||||||
#include "net/instaweb/util/stack_buffer.h"
|
#include "net/instaweb/util/stack_buffer.h"
|
||||||
|
#include "pagespeed/kernel/base/posix_timer.h"
|
||||||
#include "pagespeed/kernel/thread/pthread_shared_mem.h"
|
#include "pagespeed/kernel/thread/pthread_shared_mem.h"
|
||||||
#include "pagespeed/kernel/html/html_keywords.h"
|
#include "pagespeed/kernel/html/html_keywords.h"
|
||||||
|
|
||||||
@@ -1296,8 +1297,9 @@ bool ps_set_experiment_state_and_cookie(ngx_http_request_t* r,
|
|||||||
bool need_cookie = cfg_s->server_context->experiment_matcher()->
|
bool need_cookie = cfg_s->server_context->experiment_matcher()->
|
||||||
ClassifyIntoExperiment(*request_headers, options);
|
ClassifyIntoExperiment(*request_headers, options);
|
||||||
if (need_cookie && host.length() > 0) {
|
if (need_cookie && host.length() > 0) {
|
||||||
int64 time_now_us = apr_time_now();
|
PosixTimer timer;
|
||||||
int64 expiration_time_ms = (time_now_us/1000 +
|
int64 time_now_ms = timer.NowMs();
|
||||||
|
int64 expiration_time_ms = (time_now_ms +
|
||||||
options->experiment_cookie_duration_ms());
|
options->experiment_cookie_duration_ms());
|
||||||
|
|
||||||
// TODO(jefftk): refactor SetExperimentCookie to expose the value we want to
|
// TODO(jefftk): refactor SetExperimentCookie to expose the value we want to
|
||||||
|
|||||||
Reference in New Issue
Block a user