~yozik04/nginx/rtmp

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/src/ngx_http_lua_headers_out.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-02-15 03:05:42 UTC
  • mfrom: (4.3.10 sid)
  • Revision ID: package-import@ubuntu.com-20140215030542-71ubtowl24vf7nfn
Tags: 1.4.5-1ubuntu1
* Resynchronise with Debian (LP: #1280511).  Remaining changes:
  - debian/patches/ubuntu-branding.patch:
    + Add Ubuntu branding to server_tokens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        goto new_header;
133
133
    }
134
134
 
 
135
#if 1
 
136
    if (r->headers_out.location
 
137
        && r->headers_out.location->value.len
 
138
        && r->headers_out.location->value.data[0] == '/')
 
139
    {
 
140
        /* XXX ngx_http_core_find_config_phase, for example,
 
141
         * may not initialize the "key" and "hash" fields
 
142
         * for a nasty optimization purpose, and
 
143
         * we have to work-around it here */
 
144
 
 
145
        r->headers_out.location->hash = ngx_http_lua_location_hash;
 
146
        ngx_str_set(&r->headers_out.location->key, "Location");
 
147
    }
 
148
#endif
 
149
 
135
150
    part = &r->headers_out.headers.part;
136
151
    h = part->elts;
137
152
 
138
153
    for (i = 0; /* void */; i++) {
 
154
 
139
155
        if (i >= part->nelts) {
140
156
            if (part->next == NULL) {
141
157
                break;
146
162
            i = 0;
147
163
        }
148
164
 
149
 
        if (h[i].key.len == hv->key.len
 
165
        if (h[i].hash != 0
 
166
            && h[i].key.len == hv->key.len
150
167
            && ngx_strncasecmp(hv->key.data, h[i].key.data, h[i].key.len) == 0)
151
168
        {
152
169
            dd("found out header %.*s", (int) h[i].key.len, h[i].key.data);
192
209
    h = ngx_list_push(&r->headers_out.headers);
193
210
 
194
211
    if (h == NULL) {
195
 
        return NGX_HTTP_INTERNAL_SERVER_ERROR;
 
212
        return NGX_ERROR;
196
213
    }
197
214
 
198
215
    if (value->len == 0) {
207
224
 
208
225
    h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
209
226
    if (h->lowcase_key == NULL) {
210
 
        return NGX_HTTP_INTERNAL_SERVER_ERROR;
 
227
        return NGX_ERROR;
211
228
    }
212
229
 
213
230
    ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
320
337
    }
321
338
 
322
339
    ho->value = *value;
323
 
    ho->hash = hv->hash;
324
 
    ngx_str_set(&ho->key, "Cache-Control");
 
340
 
 
341
    if (value->len == 0) {
 
342
        ho->hash = 0;
 
343
 
 
344
    } else {
 
345
        ho->hash = hv->hash;
 
346
    }
 
347
 
 
348
    ho->key = hv->key;
325
349
    *ph = ho;
326
350
 
327
351
    return NGX_OK;
503
527
 
504
528
    found = 0;
505
529
 
 
530
#if 1
 
531
    if (r->headers_out.location
 
532
        && r->headers_out.location->value.len
 
533
        && r->headers_out.location->value.data[0] == '/')
 
534
    {
 
535
        /* XXX ngx_http_core_find_config_phase, for example,
 
536
         * may not initialize the "key" and "hash" fields
 
537
         * for a nasty optimization purpose, and
 
538
         * we have to work-around it here */
 
539
 
 
540
        r->headers_out.location->hash = ngx_http_lua_location_hash;
 
541
        ngx_str_set(&r->headers_out.location->key, "Location");
 
542
    }
 
543
#endif
 
544
 
506
545
    part = &r->headers_out.headers.part;
507
546
    h = part->elts;
508
547
 
509
548
    for (i = 0; /* void */; i++) {
 
549
 
510
550
        if (i >= part->nelts) {
511
551
            if (part->next == NULL) {
512
552
                break;
521
561
            continue;
522
562
        }
523
563
 
524
 
        if (h[i].key.len == key->len
 
564
        if (h[i].hash != 0
 
565
            && h[i].key.len == key->len
525
566
            && ngx_strncasecmp(key->data, h[i].key.data, h[i].key.len) == 0)
526
567
         {
527
568
             if (!found) {