comparison src/http/modules/ngx_http_static_handler.c @ 143:5526213be452

nginx-0.0.1-2003-10-10-19:10:50 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 10 Oct 2003 15:10:50 +0000
parents cb77c084acdb
children 5afee0074707
comparison
equal deleted inserted replaced
142:cb77c084acdb 143:5526213be452
125 ngx_test_null(h->file, ngx_pcalloc(r->pool, sizeof(ngx_file_t)), 125 ngx_test_null(h->file, ngx_pcalloc(r->pool, sizeof(ngx_file_t)),
126 NGX_HTTP_INTERNAL_SERVER_ERROR); 126 NGX_HTTP_INTERNAL_SERVER_ERROR);
127 127
128 128
129 rc = ngx_http_send_header(r); 129 rc = ngx_http_send_header(r);
130 if (rc == NGX_ERROR || rc > NGX_OK) { 130
131 ngx_http_finalize_request(r, rc); 131 if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
132 return NGX_OK; 132 return rc;
133 } 133 }
134 134
135 if (r->header_only) {
136 ngx_http_finalize_request(r, rc);
137
138 #if 0
139 if (rc == NGX_AGAIN) {
140 ngx_http_set_write_handler(r);
141
142 } else {
143 ngx_http_finalize_request(r, 0);
144 }
145 #endif
146
147 return NGX_OK;
148 }
149
150
151 #if 0
152 h->type = r->main ? NGX_HUNK_FILE : NGX_HUNK_FILE|NGX_HUNK_LAST; 135 h->type = r->main ? NGX_HUNK_FILE : NGX_HUNK_FILE|NGX_HUNK_LAST;
153 #else
154 h->type = NGX_HUNK_FILE;
155 #endif
156
157 136
158 h->file_pos = 0; 137 h->file_pos = 0;
159 h->file_last = ngx_file_size(r->file.info); 138 h->file_last = ngx_file_size(r->file.info);
160 139
161 h->file->fd = r->file.fd; 140 h->file->fd = r->file.fd;
162 h->file->log = r->connection->log; 141 h->file->log = r->connection->log;
163 142
164 rc = ngx_http_output_filter(r, h); 143 return ngx_http_output_filter(r, h);
165
166 ngx_http_finalize_request(r, rc);
167
168 #if 0
169 if (r->main == NULL) {
170 if (rc == NGX_AGAIN) {
171 ngx_http_set_write_handler(r);
172
173 } else {
174 ngx_http_finalize_request(r, 0);
175 }
176 }
177 #endif
178
179 return NGX_OK;
180 } 144 }