~ubuntu-branches/ubuntu/saucy/nginx/saucy-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-echo/src/ngx_http_echo_util.c

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Cyril Lavier, Michael Lustfield
  • Date: 2012-12-18 10:29:18 UTC
  • mfrom: (4.2.56 sid)
  • Revision ID: package-import@ubuntu.com-20121218102918-dxtwj9vj89sbj8dz
Tags: 1.2.6-1
[ Kartik Mistry ]
* New upstream release.
* debian/nginx-common.nginx.init:
  + Used log_*_msg instead of echo for better init messages.
  + Added patch to check start-stop-daemon exit status, Thanks to
    Sergey B Kirpichev <skirpichev@gmail.com> (Closes: #695374).
* debian/po/ja.po:
  + Added new Japanese translation. Thanks to victory <victory.deb@gmail.com>
    (Closes: #692481).
* debian/po/pt_BR.po:
  + Added new Brazilian Portuguese translation. Thanks to
    Adriano Rafael Gomes <adrianorg@gmail.com> (Closes: #692481).

[ Cyril Lavier ]
* debian/rules
  + Added RealIP module in nginx-naxsi (Closes: #693302).
* debian/modules/nginx-cache-purge/
  + Updated nginx-cache-purge module with the 2.0 version.
* debian/modules/nginx-lua/
  + Updated nginx-lua module with the 0.7.8 version.
* debian/modules/nginx-echo/
  + Updated the nginx-echo module with the 0.41 version.
* debian/modules/headers-more-nginx-module/
  + Updated the Headers-more module with the 0.19 version.
* debian/modules/README.Modules-versions
  + Updated the current version of modules following the updates.

[ Michael Lustfield ]
* debian/conf/sites-available/default
  + Uncommented listen lines to make server block default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        ngx_http_echo_ctx_t *ctx, ngx_chain_t *in)
92
92
{
93
93
    ngx_int_t        rc;
94
 
    size_t           size;
95
 
    ngx_chain_t     *cl;
96
94
 
97
95
    rc = ngx_http_echo_send_header_if_needed(r, ctx);
98
96
 
104
102
        return NGX_HTTP_INTERNAL_SERVER_ERROR;
105
103
    }
106
104
 
107
 
    if (r->http_version < NGX_HTTP_VERSION_11 && !ctx->headers_sent) {
108
 
        ctx->headers_sent = 1;
109
 
 
110
 
        size = 0;
111
 
 
112
 
        for (cl = in; cl; cl = cl->next) {
113
 
            size += ngx_buf_size(cl->buf);
114
 
        }
115
 
 
116
 
        r->headers_out.content_length_n = (off_t) size;
117
 
 
118
 
        if (r->headers_out.content_length) {
119
 
            r->headers_out.content_length->hash = 0;
120
 
        }
121
 
 
122
 
        r->headers_out.content_length = NULL;
123
 
 
124
 
        rc = ngx_http_send_header(r);
125
 
 
126
 
        if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
127
 
            return rc;
128
 
        }
129
 
    }
130
 
 
131
105
    if (in == NULL) {
132
106
 
133
107
#if defined(nginx_version) && nginx_version <= 8004
156
130
ngx_http_echo_send_header_if_needed(ngx_http_request_t* r,
157
131
        ngx_http_echo_ctx_t *ctx)
158
132
{
159
 
    /* ngx_int_t   rc; */
160
 
 
161
 
    if ( ! ctx->headers_sent ) {
162
 
        r->headers_out.status = NGX_HTTP_OK;
 
133
    ngx_http_echo_loc_conf_t    *elcf;
 
134
 
 
135
    if (!ctx->headers_sent) {
 
136
        elcf = ngx_http_get_module_loc_conf(r, ngx_http_echo_module);
 
137
 
 
138
        r->headers_out.status = (ngx_uint_t) elcf->status;
163
139
 
164
140
        if (ngx_http_set_content_type(r) != NGX_OK) {
165
141
            return NGX_HTTP_INTERNAL_SERVER_ERROR;
168
144
        ngx_http_clear_content_length(r);
169
145
        ngx_http_clear_accept_ranges(r);
170
146
 
171
 
        if (r->http_version >= NGX_HTTP_VERSION_11) {
172
 
            ctx->headers_sent = 1;
173
 
            return ngx_http_send_header(r);
174
 
        }
 
147
        ctx->headers_sent = 1;
 
148
        return ngx_http_send_header(r);
175
149
    }
176
150
 
177
151
    return NGX_OK;