~ubuntu-branches/debian/squeeze/nginx/squeeze

« back to all changes in this revision

Viewing changes to src/http/modules/ngx_http_rewrite_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-05-31 18:38:56 UTC
  • mfrom: (1.1.10 upstream) (4.1.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20090531183856-3xhvf6wd0bw5556i
Tags: 0.7.59-1
* New upstream release, first in Debian for the 0.7 branch. Among other
  issues, it also fixes the problem with wildcard dns names used with SSL.
  (Closes: #515904)
* debian/watch: updated.
* debian/postinst: fixed a bashism. (Closes: #507913)
* debian/conf/nginx.conf: removed default_type. (Closes: #509390)
* debian/control: updated Standards-Version to 3.8.1, no changes needed.
* debian/NEWS.Debian: documented the issues with
  server_names_hash_bucket_size. (Closes: #524785)

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
typedef struct {
13
13
    ngx_array_t  *codes;        /* uintptr_t */
14
14
 
15
 
    ngx_uint_t    captures;
16
15
    ngx_uint_t    stack_size;
17
16
 
18
17
    ngx_flag_t    log;
157
156
        return NGX_HTTP_INTERNAL_SERVER_ERROR;
158
157
    }
159
158
 
160
 
    if (rlcf->captures) {
161
 
        e->captures = ngx_palloc(r->pool, rlcf->captures * sizeof(int));
162
 
        if (e->captures == NULL) {
163
 
            return NGX_HTTP_INTERNAL_SERVER_ERROR;
164
 
        }
165
 
 
166
 
    } else {
167
 
        e->captures = NULL;
168
 
    }
169
 
 
170
159
    e->ip = rlcf->codes->elts;
171
160
    e->request = r;
172
161
    e->quote = 1;
436
425
 
437
426
    if (regex->ncaptures) {
438
427
        regex->ncaptures = (regex->ncaptures + 1) * 3;
439
 
 
440
 
        if (lcf->captures < regex->ncaptures) {
441
 
            lcf->captures = regex->ncaptures;
442
 
        }
443
428
    }
444
429
 
445
430
    regex_end = ngx_http_script_add_code(lcf->codes,
530
515
    ngx_conf_t                    save;
531
516
    ngx_http_module_t            *module;
532
517
    ngx_http_conf_ctx_t          *ctx, *pctx;
533
 
    ngx_http_core_loc_conf_t     *clcf, *pclcf, **clcfp;
 
518
    ngx_http_core_loc_conf_t     *clcf, *pclcf;
534
519
    ngx_http_script_if_code_t    *if_code;
535
520
    ngx_http_rewrite_loc_conf_t  *nlcf;
536
521
 
573
558
    clcf->name = pclcf->name;
574
559
    clcf->noname = 1;
575
560
 
576
 
    if (pclcf->locations == NULL) {
577
 
        pclcf->locations = ngx_array_create(cf->pool, 2, sizeof(void *));
578
 
        if (pclcf->locations == NULL) {
579
 
            return NGX_CONF_ERROR;
580
 
        }
581
 
    }
582
 
 
583
 
    clcfp = ngx_array_push(pclcf->locations);
584
 
    if (clcfp == NULL) {
 
561
    if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) {
585
562
        return NGX_CONF_ERROR;
586
563
    }
587
564
 
588
 
    *clcfp = clcf;
589
 
 
590
 
 
591
565
    if (ngx_http_rewrite_if_condition(cf, lcf) != NGX_CONF_OK) {
592
566
        return NGX_CONF_ERROR;
593
567
    }
629
603
    }
630
604
 
631
605
 
632
 
    if (lcf->captures < nlcf->captures) {
633
 
        lcf->captures = nlcf->captures;
634
 
    }
635
 
 
636
 
 
637
606
    if (elts != lcf->codes->elts) {
638
607
        if_code = (ngx_http_script_if_code_t *)
639
608
                   ((u_char *) if_code + ((u_char *) lcf->codes->elts - elts));
788
757
 
789
758
            if (n) {
790
759
                regex->ncaptures = (n + 1) * 3;
791
 
 
792
 
                if (lcf->captures < regex->ncaptures) {
793
 
                    lcf->captures = regex->ncaptures;
794
 
                }
795
760
            }
796
761
 
797
762
            return NGX_CONF_OK;