Skip to content

Commit 0126124

Browse files
committed
Fix build on Solaris with SunCC (Solaris Studio).
Reported by Jussi Sallinen. Change-Id: Ib221700fa85dbcd18d4177f3232a3202aef3ff71 Signed-off-by: Piotr Sikora <[email protected]>
1 parent b763f35 commit 0126124

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2014-05-19
2+
* Fix build on Solaris with SunCC (Solaris Studio).
3+
Reported by Jussi Sallinen.
4+
15
2013-03-19 VERSION 2.1
26
* When enabled, cache purge will now catch all requests with
37
PURGE (or specified) method, even if cache isn't configured.

ngx_cache_purge_module.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,8 @@ ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf)
11391139
* conf->*.method = { 0, NULL }
11401140
* conf->*.access = NULL
11411141
* conf->*.access6 = NULL
1142+
* conf->handler = NULL
1143+
* conf->original_handler = NULL
11421144
*/
11431145

11441146
# if (NGX_HTTP_FASTCGI)
@@ -1155,8 +1157,6 @@ ngx_http_cache_purge_create_loc_conf(ngx_conf_t *cf)
11551157
# endif /* NGX_HTTP_UWSGI */
11561158

11571159
conf->conf = NGX_CONF_UNSET_PTR;
1158-
conf->handler = NGX_CONF_UNSET_PTR;
1159-
conf->original_handler = NGX_CONF_UNSET_PTR;
11601160

11611161
return conf;
11621162
}
@@ -1258,9 +1258,14 @@ ngx_http_cache_purge_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
12581258
# endif /* NGX_HTTP_UWSGI */
12591259

12601260
ngx_conf_merge_ptr_value(conf->conf, prev->conf, NULL);
1261-
ngx_conf_merge_ptr_value(conf->handler, prev->handler, NULL);
1262-
ngx_conf_merge_ptr_value(conf->original_handler, prev->original_handler,
1263-
NULL);
1261+
1262+
if (conf->handler == NULL) {
1263+
conf->handler = prev->handler;
1264+
}
1265+
1266+
if (conf->original_handler == NULL) {
1267+
conf->original_handler = prev->original_handler;
1268+
}
12641269

12651270
return NGX_CONF_OK;
12661271
}

0 commit comments

Comments
 (0)