Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4aeb203468 | |||
| 30e85eff1f | |||
| b3c883d54f |
-18
@@ -1,18 +0,0 @@
|
|||||||
[submodule "testing-dependencies/mod_pagespeed"]
|
|
||||||
path = testing-dependencies/mod_pagespeed
|
|
||||||
url = https://github.com/apache/incubator-pagespeed-mod.git
|
|
||||||
[submodule "testing-dependencies/ngx_cache_purge"]
|
|
||||||
path = testing-dependencies/ngx_cache_purge
|
|
||||||
url = https://github.com/FRiCKLE/ngx_cache_purge.git
|
|
||||||
[submodule "testing-dependencies/nginx"]
|
|
||||||
path = testing-dependencies/nginx
|
|
||||||
url = https://github.com/nginx/nginx.git
|
|
||||||
[submodule "testing-dependencies/set-misc-nginx-module"]
|
|
||||||
path = testing-dependencies/set-misc-nginx-module
|
|
||||||
url = https://github.com/openresty/set-misc-nginx-module
|
|
||||||
[submodule "testing-dependencies/ngx_devel_kit"]
|
|
||||||
path = testing-dependencies/ngx_devel_kit
|
|
||||||
url = https://github.com/simpl/ngx_devel_kit
|
|
||||||
[submodule "testing-dependencies/headers-more-nginx-module"]
|
|
||||||
path = testing-dependencies/headers-more-nginx-module
|
|
||||||
url = https://github.com/openresty/headers-more-nginx-module
|
|
||||||
|
|||||||
+1
-4
@@ -1,4 +1 @@
|
|||||||
In a release this file would contain the URL to download the pre-compiled PSOL
|
https://dist.apache.org/repos/dist/release/incubator/pagespeed/1.14.36.1/x64/psol-1.14.36.1-apache-incubating-$BIT_SIZE_NAME.tar.gz
|
||||||
binary, but on development branches (like this one) you have to build PSOL from
|
|
||||||
source yourself. See:
|
|
||||||
https://github.com/apache/incubator-pagespeed-ngx/wiki/Building-PSOL-From-Source
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||

|

|
||||||
|
|
||||||
[](https://travis-ci.org/apache/incubator-pagespeed-ngx)
|
[](https://travis-ci.org/apache/incubator-pagespeed-ngx)
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
This podling has been retired, please see: http://incubator.apache.org/projects/index.html#pagespeed
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
# or more contributor license agreements. See the NOTICE file
|
# or more contributor license agreements. See the NOTICE file
|
||||||
# distributed with this work for additional information
|
# distributed with this work for additional information
|
||||||
|
|||||||
+7
-53
@@ -6,9 +6,9 @@
|
|||||||
* to you under the Apache License, Version 2.0 (the
|
* to you under the Apache License, Version 2.0 (the
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
@@ -396,35 +396,6 @@ namespace {
|
|||||||
//
|
//
|
||||||
// Based on ngx_http_add_cache_control.
|
// Based on ngx_http_add_cache_control.
|
||||||
ngx_int_t ps_set_cache_control(ngx_http_request_t* r, char* cache_control) {
|
ngx_int_t ps_set_cache_control(ngx_http_request_t* r, char* cache_control) {
|
||||||
#if defined(nginx_version) && nginx_version >= 1023000
|
|
||||||
ngx_table_elt_t* cc = r->headers_out.cache_control;
|
|
||||||
|
|
||||||
if (cc == NULL) {
|
|
||||||
|
|
||||||
cc = reinterpret_cast<ngx_table_elt_t*>(ngx_list_push(&r->headers_out.headers));
|
|
||||||
if (cc == NULL) {
|
|
||||||
return NGX_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
r->headers_out.cache_control = cc;
|
|
||||||
cc->next = NULL;
|
|
||||||
|
|
||||||
cc->hash = 1;
|
|
||||||
ngx_str_set(&cc->key, "Cache-Control");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
for (cc = cc->next; cc; cc = cc->next) {
|
|
||||||
cc->hash = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
cc = r->headers_out.cache_control;
|
|
||||||
cc->next = NULL;
|
|
||||||
}
|
|
||||||
cc->value.len = strlen(cache_control);
|
|
||||||
cc->value.data =
|
|
||||||
reinterpret_cast<u_char*>(cache_control);
|
|
||||||
|
|
||||||
#else
|
|
||||||
// First strip existing cache-control headers.
|
// First strip existing cache-control headers.
|
||||||
ngx_table_elt_t* header;
|
ngx_table_elt_t* header;
|
||||||
NgxListIterator it(&(r->headers_out.headers.part));
|
NgxListIterator it(&(r->headers_out.headers.part));
|
||||||
@@ -434,6 +405,7 @@ ngx_int_t ps_set_cache_control(ngx_http_request_t* r, char* cache_control) {
|
|||||||
header->hash = 0;
|
header->hash = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now add our new cache control header.
|
// Now add our new cache control header.
|
||||||
if (r->headers_out.cache_control.elts == NULL) {
|
if (r->headers_out.cache_control.elts == NULL) {
|
||||||
ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
|
ngx_int_t rc = ngx_array_init(&r->headers_out.cache_control, r->pool,
|
||||||
@@ -457,7 +429,7 @@ ngx_int_t ps_set_cache_control(ngx_http_request_t* r, char* cache_control) {
|
|||||||
cache_control_headers[0]->value.len = strlen(cache_control);
|
cache_control_headers[0]->value.len = strlen(cache_control);
|
||||||
cache_control_headers[0]->value.data =
|
cache_control_headers[0]->value.data =
|
||||||
reinterpret_cast<u_char*>(cache_control);
|
reinterpret_cast<u_char*>(cache_control);
|
||||||
#endif
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -467,23 +439,6 @@ bool ps_get_cache_control(ngx_http_request_t* r, GoogleString* cache_control) {
|
|||||||
// Use headers_out.cache_control instead of looking for Cache-Control in
|
// Use headers_out.cache_control instead of looking for Cache-Control in
|
||||||
// headers_out.headers, because if an upstream sent multiple Cache-Control
|
// headers_out.headers, because if an upstream sent multiple Cache-Control
|
||||||
// headers they're already combined in headers_out.cache_control.
|
// headers they're already combined in headers_out.cache_control.
|
||||||
#if defined(nginx_version) && nginx_version >= 1023000
|
|
||||||
ngx_table_elt_t* cc = r->headers_out.cache_control;
|
|
||||||
bool first_segment = true;
|
|
||||||
|
|
||||||
while (cc != NULL) {
|
|
||||||
if (cc->hash) {
|
|
||||||
if (first_segment) {
|
|
||||||
first_segment = false;
|
|
||||||
} else {
|
|
||||||
cache_control->append(", ");
|
|
||||||
}
|
|
||||||
cache_control->append(reinterpret_cast<char*>(cc->value.data),
|
|
||||||
cc->value.len);
|
|
||||||
}
|
|
||||||
cc = cc->next;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
|
auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
|
||||||
if (ccp == nullptr) {
|
if (ccp == nullptr) {
|
||||||
return false; // Header not present.
|
return false; // Header not present.
|
||||||
@@ -501,7 +456,6 @@ bool ps_get_cache_control(ngx_http_request_t* r, GoogleString* cache_control) {
|
|||||||
cache_control->append(reinterpret_cast<char*>(ccp[i]->value.data),
|
cache_control->append(reinterpret_cast<char*>(ccp[i]->value.data),
|
||||||
ccp[i]->value.len);
|
ccp[i]->value.len);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1074,7 +1028,7 @@ void* ps_create_main_conf(ngx_conf_t* cf) {
|
|||||||
}
|
}
|
||||||
ps_main_conf_t* cfg_m = ps_create_conf<ps_main_conf_t>(cf);
|
ps_main_conf_t* cfg_m = ps_create_conf<ps_main_conf_t>(cf);
|
||||||
if (cfg_m == NULL) {
|
if (cfg_m == NULL) {
|
||||||
return NULL;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
CHECK(!factory_deleted);
|
CHECK(!factory_deleted);
|
||||||
NgxRewriteOptions::Initialize();
|
NgxRewriteOptions::Initialize();
|
||||||
@@ -1095,7 +1049,7 @@ void* ps_create_main_conf(ngx_conf_t* cf) {
|
|||||||
void* ps_create_srv_conf(ngx_conf_t* cf) {
|
void* ps_create_srv_conf(ngx_conf_t* cf) {
|
||||||
ps_srv_conf_t* cfg_s = ps_create_conf<ps_srv_conf_t>(cf);
|
ps_srv_conf_t* cfg_s = ps_create_conf<ps_srv_conf_t>(cf);
|
||||||
if (cfg_s == NULL) {
|
if (cfg_s == NULL) {
|
||||||
return NULL;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
ps_set_conf_cleanup_handler(cf, ps_cleanup_srv_conf, cfg_s);
|
ps_set_conf_cleanup_handler(cf, ps_cleanup_srv_conf, cfg_s);
|
||||||
return cfg_s;
|
return cfg_s;
|
||||||
@@ -1104,7 +1058,7 @@ void* ps_create_srv_conf(ngx_conf_t* cf) {
|
|||||||
void* ps_create_loc_conf(ngx_conf_t* cf) {
|
void* ps_create_loc_conf(ngx_conf_t* cf) {
|
||||||
ps_loc_conf_t* cfg_l = ps_create_conf<ps_loc_conf_t>(cf);
|
ps_loc_conf_t* cfg_l = ps_create_conf<ps_loc_conf_t>(cf);
|
||||||
if (cfg_l == NULL) {
|
if (cfg_l == NULL) {
|
||||||
return NULL;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
ps_set_conf_cleanup_handler(cf, ps_cleanup_loc_conf, cfg_l);
|
ps_set_conf_cleanup_handler(cf, ps_cleanup_loc_conf, cfg_l);
|
||||||
return cfg_l;
|
return cfg_l;
|
||||||
|
|||||||
Submodule testing-dependencies/headers-more-nginx-module deleted from 30fb25901c
Submodule testing-dependencies/mod_pagespeed deleted from a863f1d506
Submodule testing-dependencies/nginx deleted from c556874e17
Submodule testing-dependencies/ngx_cache_purge deleted from 331fe43e8d
Submodule testing-dependencies/ngx_devel_kit deleted from e443262071
Submodule testing-dependencies/set-misc-nginx-module deleted from 72be6512cf
Reference in New Issue
Block a user