Skip to content

Commit a10091b

Browse files
committed
Fixed build on nginx latest stable
1 parent 93dc582 commit a10091b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/ngx_http_socks_upstream.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,9 +2752,16 @@ ngx_http_socks_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t
27522752
p->temp_file->persistent = 1;
27532753

27542754
#if (NGX_HTTP_CACHE)
2755+
#if (nginx_version < 1011006)
27552756
if (r->cache && r->cache->file_cache->temp_path) {
27562757
p->temp_file->path = r->cache->file_cache->temp_path;
27572758
}
2759+
#else
2760+
if (r->cache && !r->cache->file_cache->use_temp_path) {
2761+
p->temp_file->path = r->cache->file_cache->path;
2762+
p->temp_file->file.name = r->cache->file.name;
2763+
}
2764+
#endif
27582765
#endif
27592766

27602767
} else {
@@ -4790,13 +4797,13 @@ ngx_http_socks_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
47904797
{
47914798
continue;
47924799
}
4793-
4800+
#if (nginx_version < 1011006)
47944801
if (uscfp[i]->default_port && u->default_port
47954802
&& uscfp[i]->default_port != u->default_port)
47964803
{
47974804
continue;
47984805
}
4799-
4806+
#endif
48004807
if (flags & NGX_HTTP_UPSTREAM_CREATE) {
48014808
uscfp[i]->flags = flags;
48024809
}
@@ -4814,7 +4821,9 @@ ngx_http_socks_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
48144821
uscf->file_name = cf->conf_file->file.name.data;
48154822
uscf->line = cf->conf_file->line;
48164823
uscf->port = u->port;
4824+
#if (nginx_version < 1011006)
48174825
uscf->default_port = u->default_port;
4826+
#endif
48184827
uscf->no_port = u->no_port;
48194828

48204829
if (u->naddrs == 1 && (u->port || u->family == AF_UNIX)) {

0 commit comments

Comments
 (0)