trunk-tracking: merge changes in from master:

* release: prepare 1.7.30.3
* Don't call chown() when initializing config dirs unless owner != worker user.
* Update README.md
* release: build against backported change
* release: udpate version number 1.7.30.3 to 1.7.30.4
This commit is contained in:
Huibao Lin
2014-01-16 15:06:49 -05:00
committed by Jeff Kaufman
parent c754cf1be0
commit d90245af69
3 changed files with 28 additions and 16 deletions
+10 -10
View File
@@ -37,11 +37,11 @@ recompiling Tengine](https://github.com/pagespeed/ngx_pagespeed/wiki/Using-ngx_p
```bash ```bash
$ cd ~ $ cd ~
$ wget https://github.com/pagespeed/ngx_pagespeed/archive/v1.7.30.3-beta.zip $ wget https://github.com/pagespeed/ngx_pagespeed/archive/v1.7.30.4-beta.zip
$ unzip v1.7.30.3-beta.zip # or unzip v1.7.30.3-beta $ unzip v1.7.30.4-beta.zip # or unzip v1.7.30.4-beta
$ cd ngx_pagespeed-1.7.30.3-beta/ $ cd ngx_pagespeed-1.7.30.4-beta/
$ wget https://dl.google.com/dl/page-speed/psol/1.7.30.3.tar.gz $ wget https://dl.google.com/dl/page-speed/psol/1.7.30.4.tar.gz
$ tar -xzvf 1.7.30.3.tar.gz # expands to psol/ $ tar -xzvf 1.7.30.4.tar.gz # expands to psol/
``` ```
3. Download and build nginx: 3. Download and build nginx:
@@ -49,10 +49,10 @@ recompiling Tengine](https://github.com/pagespeed/ngx_pagespeed/wiki/Using-ngx_p
```bash ```bash
$ cd ~ $ cd ~
$ # check http://nginx.org/en/download.html for the latest version $ # check http://nginx.org/en/download.html for the latest version
$ wget http://nginx.org/download/nginx-1.4.4.tar.gz $ wget http://nginx.org/download/nginx-1.4.6.tar.gz
$ tar -xvzf nginx-1.4.4.tar.gz $ tar -xvzf nginx-1.4.6.tar.gz
$ cd nginx-1.4.4/ $ cd nginx-1.4.6/
$ ./configure --add-module=$HOME/ngx_pagespeed-1.7.30.3-beta $ ./configure --add-module=$HOME/ngx_pagespeed-1.7.30.4-beta
$ make $ make
$ sudo make install $ sudo make install
``` ```
@@ -95,7 +95,7 @@ To confirm that the module is loaded, fetch a page and check that you see the
```bash ```bash
$ curl -I 'http://localhost:8050/some_page/' | grep X-Page-Speed $ curl -I 'http://localhost:8050/some_page/' | grep X-Page-Speed
X-Page-Speed: 1.7.30.3-... X-Page-Speed: 1.7.30.4-...
``` ```
Looking at the source of a few pages you should see various changes, such as Looking at the source of a few pages you should see various changes, such as
+2 -2
View File
@@ -27,8 +27,8 @@ if [ "$mod_pagespeed_dir" = "unset" ] ; then
echo " You need to separately download the pagespeed library:" echo " You need to separately download the pagespeed library:"
echo "" echo ""
echo " $ cd /path/to/ngx_pagespeed" echo " $ cd /path/to/ngx_pagespeed"
echo " $ wget https://dl.google.com/dl/page-speed/psol/1.7.30.2.tar.gz" echo " $ wget https://dl.google.com/dl/page-speed/psol/1.7.30.4.tar.gz"
echo " $ tar -xzvf 1.7.30.2.tar.gz # expands to psol/" echo " $ tar -xzvf 1.7.30.4.tar.gz # expands to psol/"
echo "" echo ""
echo " Or see the installation instructions:" echo " Or see the installation instructions:"
echo " https://github.com/pagespeed/ngx_pagespeed#how-to-build" echo " https://github.com/pagespeed/ngx_pagespeed#how-to-build"
+16 -4
View File
@@ -504,15 +504,24 @@ char* ps_init_dir(const StringPiece& directive,
return NULL; // We're not root, so we're staying whoever we are. return NULL; // We're not root, so we're staying whoever we are.
} }
// chown if owner differs from nginx worker user.
ngx_core_conf_t* ccf = ngx_core_conf_t* ccf =
(ngx_core_conf_t*)(ngx_get_conf(cf->cycle->conf_ctx, ngx_core_module)); (ngx_core_conf_t*)(ngx_get_conf(cf->cycle->conf_ctx, ngx_core_module));
CHECK(ccf != NULL); CHECK(ccf != NULL);
struct stat gs_stat;
if (chown(gs_path.c_str(), ccf->user, ccf->group) != 0) { if (stat(gs_path.c_str(), &gs_stat) != 0) {
return string_piece_to_pool_string( return string_piece_to_pool_string(
cf->pool, net_instaweb::StrCat( cf->pool, net_instaweb::StrCat(
directive, " ", path, " unable to set permissions")); directive, " ", path, " stat() failed"));
} }
if (gs_stat.st_uid != ccf->user) {
if (chown(gs_path.c_str(), ccf->user, ccf->group) != 0) {
return string_piece_to_pool_string(
cf->pool, net_instaweb::StrCat(
directive, " ", path, " unable to set permissions"));
}
}
return NULL; return NULL;
} }
@@ -2128,6 +2137,7 @@ ngx_int_t ps_in_place_check_header_filter(ngx_http_request_t* r) {
// (or at least a note that it cannot be cached stored there). // (or at least a note that it cannot be cached stored there).
// We do that using an Apache output filter. // We do that using an Apache output filter.
ctx->recorder = new InPlaceResourceRecorder( ctx->recorder = new InPlaceResourceRecorder(
RequestContextPtr(cfg_s->server_context->NewRequestContext(r)),
url, url,
request_headers, request_headers,
options->respect_vary(), options->respect_vary(),
@@ -2192,7 +2202,9 @@ ngx_int_t ps_in_place_body_filter(ngx_http_request_t* r, ngx_chain_t* in) {
// Unlike in Apache we get the final response headers before we get the // Unlike in Apache we get the final response headers before we get the
// content. This means we can consider them earlier and abort the // content. This means we can consider them earlier and abort the
// request if need be without buffering everything. // request if need be without buffering everything.
recorder->ConsiderResponseHeaders(ctx->ipro_response_headers); recorder->ConsiderResponseHeaders(
InPlaceResourceRecorder::kPreliminaryHeaders,
ctx->ipro_response_headers);
} }
for (ngx_chain_t* cl = in; cl; cl = cl->next) { for (ngx_chain_t* cl = in; cl; cl = cl->next) {