~ubuntu-branches/ubuntu/lucid/nginx/lucid

« back to all changes in this revision

Viewing changes to src/http/ngx_http_request.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-11-30 13:34:00 UTC
  • mfrom: (1.1.14 upstream) (4.2.10 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091130133400-n0ux4igma2y3y0pl
Tags: 0.7.63-1ubuntu1
* Merge from debian testing (LP: #490450), remaining changes:
  - Install html files.
    - debian/dirs: Add 'var/www/nginx-default'.
    - debian/nginx.install: Add 'html/* var/www/nginx-default'.
  - Added a UFW profile set: (LP: #308695)
    + debian/nginx.ufw.profile: Added.
    + debian/control: nginx: Suggests ufw.
    + debian/dirs: Added 'etc/ufw/applications.d'
    + debian/rules: Added install rule for the nginx UFW profile. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
    { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive),
130
130
                 ngx_http_process_header_line },
131
131
 
132
 
#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP)
 
132
#if (NGX_HTTP_PROXY || NGX_HTTP_REALIP || NGX_HTTP_GEO)
133
133
    { ngx_string("X-Forwarded-For"),
134
134
                 offsetof(ngx_http_headers_in_t, x_forwarded_for),
135
135
                 ngx_http_process_header_line },
384
384
    r->loc_conf = cscf->ctx->loc_conf;
385
385
 
386
386
    rev->handler = ngx_http_process_request_line;
 
387
    r->read_event_handler = ngx_http_block_reading;
387
388
 
388
389
#if (NGX_HTTP_SSL)
389
390
 
451
452
                      sizeof(ngx_table_elt_t))
452
453
        != NGX_OK)
453
454
    {
454
 
        ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
 
455
        ngx_destroy_pool(r->pool);
 
456
        ngx_http_close_connection(c);
455
457
        return;
456
458
    }
457
459
 
458
460
    r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
459
461
    if (r->ctx == NULL) {
460
 
        ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
 
462
        ngx_destroy_pool(r->pool);
 
463
        ngx_http_close_connection(c);
461
464
        return;
462
465
    }
463
466
 
466
469
    r->variables = ngx_pcalloc(r->pool, cmcf->variables.nelts
467
470
                                        * sizeof(ngx_http_variable_value_t));
468
471
    if (r->variables == NULL) {
469
 
        ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
 
472
        ngx_destroy_pool(r->pool);
 
473
        ngx_http_close_connection(c);
470
474
        return;
471
475
    }
472
476
 
1374
1378
                r->headers_in.msie4 = 1;
1375
1379
                /* fall through */
1376
1380
            case '5':
 
1381
                r->headers_in.msie6 = 1;
 
1382
                break;
1377
1383
            case '6':
1378
 
                r->headers_in.msie6 = 1;
 
1384
                if (ngx_strstrn(msie + 8, "SV1", 3 - 1) == NULL) {
 
1385
                    r->headers_in.msie6 = 1;
 
1386
                }
 
1387
                break;
1379
1388
            }
1380
1389
        }
1381
1390
 
1517
1526
 
1518
1527
        sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module);
1519
1528
 
1520
 
        if (sscf->verify == 1) {
 
1529
        if (sscf->verify) {
1521
1530
            rc = SSL_get_verify_result(c->ssl->connection);
1522
1531
 
1523
1532
            if (rc != X509_V_OK) {
1532
1541
                return;
1533
1542
            }
1534
1543
 
1535
 
            cert = SSL_get_peer_certificate(c->ssl->connection);
1536
 
 
1537
 
            if (cert == NULL) {
1538
 
                ngx_log_error(NGX_LOG_INFO, c->log, 0,
1539
 
                              "client sent no required SSL certificate");
1540
 
 
1541
 
                ngx_ssl_remove_cached_session(sscf->ssl.ctx,
 
1544
            if (sscf->verify == 1) {
 
1545
                cert = SSL_get_peer_certificate(c->ssl->connection);
 
1546
 
 
1547
                if (cert == NULL) {
 
1548
                    ngx_log_error(NGX_LOG_INFO, c->log, 0,
 
1549
                                  "client sent no required SSL certificate");
 
1550
 
 
1551
                    ngx_ssl_remove_cached_session(sscf->ssl.ctx,
1542
1552
                                       (SSL_get0_session(c->ssl->connection)));
1543
1553
 
1544
 
                ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT);
1545
 
                return;
 
1554
                    ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT);
 
1555
                    return;
 
1556
                }
 
1557
 
 
1558
                X509_free(cert);
1546
1559
            }
1547
 
 
1548
 
            X509_free(cert);
1549
1560
        }
1550
1561
    }
1551
1562
 
2703
2714
    }
2704
2715
 
2705
2716
    if (flags & NGX_HTTP_LAST) {
2706
 
        b->last_buf = 1;
 
2717
 
 
2718
        if (r == r->main && !r->post_action) {
 
2719
            b->last_buf = 1;
 
2720
 
 
2721
        } else {
 
2722
            b->sync = 1;
 
2723
            b->last_in_chain = 1;
 
2724
        }
2707
2725
    }
2708
2726
 
2709
2727
    if (flags & NGX_HTTP_FLUSH) {