Klaus Demo nginx / 73c3121
delete surplus upstream.schema field Igor Sysoev 13 years ago
4 changed file(s) with 9 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
16801680 * conf->upstream.next_upstream = 0;
16811681 * conf->upstream.temp_path = NULL;
16821682 * conf->upstream.hide_headers_hash = { NULL, 0 };
1683 * conf->upstream.schema = { 0, NULL };
16841683 * conf->upstream.uri = { 0, NULL };
16851684 * conf->upstream.location = NULL;
16861685 * conf->upstream.store_lengths = NULL;
19101909
19111910 if (conf->upstream.upstream == NULL) {
19121911 conf->upstream.upstream = prev->upstream.upstream;
1913 conf->upstream.schema = prev->upstream.schema;
19141912 }
19151913
19161914 if (conf->fastcgi_lengths == NULL) {
21062104 ngx_http_core_loc_conf_t *clcf;
21072105 ngx_http_script_compile_t sc;
21082106
2109 if (flcf->upstream.schema.len) {
2107 if (flcf->upstream.upstream || flcf->fastcgi_lengths) {
21102108 return "is duplicate";
21112109 }
21122110
21132111 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
21142112 clcf->handler = ngx_http_fastcgi_handler;
2115
2116 flcf->upstream.schema.len = sizeof("fastcgi://") - 1;
2117 flcf->upstream.schema.data = (u_char *) "fastcgi://";
21182113
21192114 value = cf->args->elts;
21202115
182182 return NGX_HTTP_INTERNAL_SERVER_ERROR;
183183 }
184184
185 u->schema = mlcf->upstream.schema;
185 u->schema.len = sizeof("memcached://") - 1;
186 u->schema.data = (u_char *) "memcached://";
186187
187188 u->peer.log = r->connection->log;
188189 u->peer.log_error = NGX_ERROR_ERR;
520521 * conf->upstream.bufs.num = 0;
521522 * conf->upstream.next_upstream = 0;
522523 * conf->upstream.temp_path = NULL;
523 * conf->upstream.schema = { 0, NULL };
524524 * conf->upstream.uri = { 0, NULL };
525525 * conf->upstream.location = NULL;
526526 */
583583
584584 if (conf->upstream.upstream == NULL) {
585585 conf->upstream.upstream = prev->upstream.upstream;
586 conf->upstream.schema = prev->upstream.schema;
587586 }
588587
589588 if (conf->index == NGX_CONF_UNSET) {
603602 ngx_url_t u;
604603 ngx_http_core_loc_conf_t *clcf;
605604
606 if (lcf->upstream.schema.len) {
605 if (lcf->upstream.upstream) {
607606 return "is duplicate";
608607 }
609608
618617 if (lcf->upstream.upstream == NULL) {
619618 return NGX_CONF_ERROR;
620619 }
621
622 lcf->upstream.schema.len = sizeof("memcached://") - 1;
623 lcf->upstream.schema.data = (u_char *) "memcached://";
624620
625621 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
626622
3131
3232
3333 typedef struct {
34 ngx_str_t schema;
3435 ngx_str_t host_header;
3536 ngx_str_t port;
3637 ngx_str_t uri;
479480
480481 if (plcf->proxy_lengths == 0) {
481482 ctx->vars = plcf->vars;
482 u->schema = plcf->upstream.schema;
483 u->schema = plcf->vars.schema;
483484 #if (NGX_HTTP_SSL)
484485 u->ssl = (plcf->upstream.ssl != NULL);
485486 #endif
16301631 * conf->upstream.next_upstream = 0;
16311632 * conf->upstream.temp_path = NULL;
16321633 * conf->upstream.hide_headers_hash = { NULL, 0 };
1633 * conf->upstream.schema = { 0, NULL };
16341634 * conf->upstream.uri = { 0, NULL };
16351635 * conf->upstream.location = NULL;
16361636 * conf->upstream.store_lengths = NULL;
19301930
19311931 if (conf->upstream.upstream == NULL) {
19321932 conf->upstream.upstream = prev->upstream.upstream;
1933
19341933 conf->vars = prev->vars;
1935 conf->upstream.schema = prev->upstream.schema;
19361934 }
19371935
19381936
22152213 ngx_http_core_loc_conf_t *clcf;
22162214 ngx_http_script_compile_t sc;
22172215
2218 if (plcf->upstream.schema.len) {
2216 if (plcf->upstream.upstream || plcf->proxy_lengths) {
22192217 return "is duplicate";
22202218 }
22212219
22952293 return NGX_CONF_ERROR;
22962294 }
22972295
2298 plcf->upstream.schema.len = add;
2299 plcf->upstream.schema.data = url->data;
2296 plcf->vars.schema.len = add;
2297 plcf->vars.schema.data = url->data;
23002298 plcf->location = clcf->name;
23012299
23022300 clcf->handler = ngx_http_proxy_handler;
143143 ngx_array_t *hide_headers;
144144 ngx_array_t *pass_headers;
145145
146 ngx_str_t schema;
147
148146 ngx_array_t *store_lengths;
149147 ngx_array_t *store_values;
150148