pointer-declaration-style: fix style issues
This commit is contained in:
+29
-29
@@ -219,8 +219,8 @@ void copy_headers_from_table(const ngx_list_t &from, Headers* to) {
|
||||
} // namespace
|
||||
|
||||
// modify from NgxBaseFetch::PopulateResponseHeaders()
|
||||
void copy_response_headers_from_ngx(const ngx_http_request_t *r,
|
||||
net_instaweb::ResponseHeaders *headers) {
|
||||
void copy_response_headers_from_ngx(const ngx_http_request_t* r,
|
||||
net_instaweb::ResponseHeaders* headers) {
|
||||
headers->set_major_version(r->http_version / 1000);
|
||||
headers->set_minor_version(r->http_version % 1000);
|
||||
copy_headers_from_table(r->headers_out.headers, headers);
|
||||
@@ -237,8 +237,8 @@ void copy_response_headers_from_ngx(const ngx_http_request_t *r,
|
||||
}
|
||||
|
||||
// modify from NgxBaseFetch::PopulateRequestHeaders()
|
||||
void copy_request_headers_from_ngx(const ngx_http_request_t *r,
|
||||
net_instaweb::RequestHeaders *headers) {
|
||||
void copy_request_headers_from_ngx(const ngx_http_request_t* r,
|
||||
net_instaweb::RequestHeaders* headers) {
|
||||
// TODO(chaizhenhua): only allow RewriteDriver::kPassThroughRequestAttributes?
|
||||
headers->set_major_version(r->http_version / 1000);
|
||||
headers->set_minor_version(r->http_version % 1000);
|
||||
@@ -954,8 +954,8 @@ ps_request_ctx_t* ps_get_request_context(ngx_http_request_t* r) {
|
||||
void ps_release_base_fetch(ps_request_ctx_t* ctx);
|
||||
|
||||
// we are still at pagespeed phase
|
||||
ngx_int_t ps_decline_request(ngx_http_request_t *r) {
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ngx_int_t ps_decline_request(ngx_http_request_t* r) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
CHECK(ctx != NULL);
|
||||
|
||||
// re init ctx
|
||||
@@ -974,8 +974,8 @@ ngx_int_t ps_decline_request(ngx_http_request_t *r) {
|
||||
}
|
||||
|
||||
|
||||
ngx_int_t ps_async_wait_response(ngx_http_request_t *r) {
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ngx_int_t ps_async_wait_response(ngx_http_request_t* r) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
CHECK(ctx != NULL);
|
||||
|
||||
r->count++;
|
||||
@@ -1014,10 +1014,10 @@ ngx_int_t ps_base_fetch_filter(ngx_http_request_t* r, ngx_chain_t* in) {
|
||||
return ctx->fetch_done ? NGX_OK : NGX_AGAIN;
|
||||
}
|
||||
|
||||
ngx_int_t ps_base_fetch_handler(ngx_http_request_t *r) {
|
||||
ngx_int_t ps_base_fetch_handler(ngx_http_request_t* r) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
ngx_int_t rc;
|
||||
ngx_chain_t *cl = NULL;
|
||||
ngx_chain_t* cl = NULL;
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
"ps fetch handler: %V", &r->uri);
|
||||
@@ -1134,7 +1134,7 @@ void ps_connection_read_handler(ngx_event_t* ev) {
|
||||
|
||||
ps_request_ctx_t* ctx = static_cast<ps_request_ctx_t*>(c->data);
|
||||
CHECK(ctx != NULL);
|
||||
ngx_http_request_t *r = ctx->r;
|
||||
ngx_http_request_t* r = ctx->r;
|
||||
CHECK(r != NULL);
|
||||
|
||||
// clear the pipe
|
||||
@@ -1552,8 +1552,8 @@ void ps_release_base_fetch(ps_request_ctx_t* ctx) {
|
||||
}
|
||||
|
||||
// TODO(chaizhenhua): merge into NgxBaseFetch ctor
|
||||
ngx_int_t ps_create_base_fetch(ps_request_ctx_t *ctx) {
|
||||
ngx_http_request_t *r = ctx->r;
|
||||
ngx_int_t ps_create_base_fetch(ps_request_ctx_t* ctx) {
|
||||
ngx_http_request_t* r = ctx->r;
|
||||
ps_srv_conf_t* cfg_s = ps_get_srv_config(r);
|
||||
int file_descriptors[2];
|
||||
|
||||
@@ -1694,13 +1694,13 @@ CreateRequestContext::Response ps_create_request_context(
|
||||
return CreateRequestContext::kResource;
|
||||
}
|
||||
|
||||
ngx_int_t ps_resource_handler(ngx_http_request_t *r, bool html_rewrite) {
|
||||
ngx_int_t ps_resource_handler(ngx_http_request_t* r, bool html_rewrite) {
|
||||
if (r != r->main) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
ps_srv_conf_t* cfg_s = ps_get_srv_config(r);
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
|
||||
CHECK(!(html_rewrite && (ctx == NULL || ctx->html_rewrite == false)));
|
||||
|
||||
@@ -1720,7 +1720,7 @@ ngx_int_t ps_resource_handler(ngx_http_request_t *r, bool html_rewrite) {
|
||||
|
||||
copy_request_headers_from_ngx(r, request_headers.get());
|
||||
|
||||
net_instaweb::RewriteOptions *options = NULL;
|
||||
net_instaweb::RewriteOptions* options = NULL;
|
||||
|
||||
if (!ps_determine_options(r, request_headers.get(), &options, &url)) {
|
||||
return NGX_ERROR;
|
||||
@@ -2222,8 +2222,8 @@ namespace in_place {
|
||||
ngx_http_output_header_filter_pt ngx_http_next_header_filter;
|
||||
ngx_http_output_body_filter_pt ngx_http_next_body_filter;
|
||||
|
||||
ngx_int_t ps_in_place_check_header_filter(ngx_http_request_t *r) {
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ngx_int_t ps_in_place_check_header_filter(ngx_http_request_t* r) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
|
||||
if (ctx == NULL || !ctx->in_place) {
|
||||
return ngx_http_next_header_filter(r);
|
||||
@@ -2289,8 +2289,8 @@ ngx_int_t ps_in_place_check_header_filter(ngx_http_request_t *r) {
|
||||
return ps_decline_request(r);
|
||||
}
|
||||
|
||||
ngx_int_t ps_in_place_body_filter(ngx_http_request_t *r, ngx_chain_t *in) {
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ngx_int_t ps_in_place_body_filter(ngx_http_request_t* r, ngx_chain_t* in) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
if (ctx == NULL || ctx->recorder == NULL) {
|
||||
return ngx_http_next_body_filter(r, in);
|
||||
}
|
||||
@@ -2300,7 +2300,7 @@ ngx_int_t ps_in_place_body_filter(ngx_http_request_t *r, ngx_chain_t *in) {
|
||||
|
||||
net_instaweb::InPlaceResourceRecorder* recorder = ctx->recorder;
|
||||
|
||||
for (ngx_chain_t *cl = in; cl; cl = cl->next) {
|
||||
for (ngx_chain_t* cl = in; cl; cl = cl->next) {
|
||||
if (ngx_buf_size(cl->buf)) {
|
||||
CHECK(ngx_buf_in_memory(cl->buf));
|
||||
StringPiece contents(reinterpret_cast<char *>(cl->buf->pos),
|
||||
@@ -2846,8 +2846,8 @@ ngx_int_t ps_content_handler(ngx_http_request_t* r) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
ngx_int_t ps_phase_handler(ngx_http_request_t *r,
|
||||
ngx_http_phase_handler_t *ph) {
|
||||
ngx_int_t ps_phase_handler(ngx_http_request_t* r,
|
||||
ngx_http_phase_handler_t* ph) {
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
"pagespeed phase: %ui", r->phase_handler);
|
||||
|
||||
@@ -2871,8 +2871,8 @@ ngx_int_t ps_phase_handler(ngx_http_request_t *r,
|
||||
namespace fix_headers {
|
||||
ngx_http_output_header_filter_pt ngx_http_next_header_filter;
|
||||
|
||||
ngx_int_t ps_html_rewrite_fix_headers_filter(ngx_http_request_t *r) {
|
||||
ps_request_ctx_t *ctx = ps_get_request_context(r);
|
||||
ngx_int_t ps_html_rewrite_fix_headers_filter(ngx_http_request_t* r) {
|
||||
ps_request_ctx_t* ctx = ps_get_request_context(r);
|
||||
if (r != r->main || ctx == NULL || !ctx->html_rewrite
|
||||
|| !ctx->modify_caching_headers) {
|
||||
return ngx_http_next_header_filter(r);
|
||||
@@ -2911,12 +2911,12 @@ using fix_headers::ps_html_rewrite_fix_headers_filter_init;
|
||||
|
||||
|
||||
// preaccess_handler should be at generic phase before try_files
|
||||
ngx_int_t ps_preaccess_handler(ngx_http_request_t *r) {
|
||||
ngx_http_core_main_conf_t *cmcf;
|
||||
ngx_http_phase_handler_t *ph;
|
||||
ngx_int_t ps_preaccess_handler(ngx_http_request_t* r) {
|
||||
ngx_http_core_main_conf_t* cmcf;
|
||||
ngx_http_phase_handler_t* ph;
|
||||
ngx_uint_t i;
|
||||
|
||||
cmcf = static_cast<ngx_http_core_main_conf_t *>(
|
||||
cmcf = static_cast<ngx_http_core_main_conf_t*>(
|
||||
ngx_http_get_module_main_conf(r, ngx_http_core_module));
|
||||
|
||||
ph = cmcf->phase_engine.handlers;
|
||||
|
||||
+5
-5
@@ -97,15 +97,15 @@ typedef struct {
|
||||
|
||||
// for in place resource
|
||||
net_instaweb::RewriteDriver* driver;
|
||||
net_instaweb::InPlaceResourceRecorder *recorder;
|
||||
net_instaweb::InPlaceResourceRecorder* recorder;
|
||||
} ps_request_ctx_t;
|
||||
|
||||
|
||||
void copy_request_headers_from_ngx(const ngx_http_request_t *r,
|
||||
net_instaweb::RequestHeaders *headers);
|
||||
void copy_request_headers_from_ngx(const ngx_http_request_t* r,
|
||||
net_instaweb::RequestHeaders* headers);
|
||||
|
||||
void copy_response_headers_from_ngx(const ngx_http_request_t *r,
|
||||
net_instaweb::ResponseHeaders *headers);
|
||||
void copy_response_headers_from_ngx(const ngx_http_request_t* r,
|
||||
net_instaweb::ResponseHeaders* headers);
|
||||
|
||||
ngx_int_t copy_response_headers_to_ngx(
|
||||
ngx_http_request_t* r,
|
||||
|
||||
Reference in New Issue
Block a user