Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 393:5659d773cfa8
nginx-0.0.7-2004-07-15-20:35:51 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 15 Jul 2004 16:35:51 +0000 |
parents | d1222d46b3f9 |
children | e7a68e14ccd3 |
comparison
equal
deleted
inserted
replaced
392:d1222d46b3f9 | 393:5659d773cfa8 |
---|---|
139 ngx_http_in_port_t *in_port; | 139 ngx_http_in_port_t *in_port; |
140 ngx_http_in_addr_t *in_addr; | 140 ngx_http_in_addr_t *in_addr; |
141 ngx_http_server_name_t *server_name; | 141 ngx_http_server_name_t *server_name; |
142 ngx_http_core_srv_conf_t *cscf; | 142 ngx_http_core_srv_conf_t *cscf; |
143 ngx_http_core_loc_conf_t *clcf; | 143 ngx_http_core_loc_conf_t *clcf; |
144 #if (NGX_HTTP_SSL) | |
145 ngx_http_ssl_srv_conf_t *sscf; | |
146 #endif | |
144 | 147 |
145 c = rev->data; | 148 c = rev->data; |
146 | 149 |
147 if (rev->timedout) { | 150 if (rev->timedout) { |
148 ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out"); | 151 ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out"); |
227 | 230 |
228 r->main_conf = cscf->ctx->main_conf; | 231 r->main_conf = cscf->ctx->main_conf; |
229 r->srv_conf = cscf->ctx->srv_conf; | 232 r->srv_conf = cscf->ctx->srv_conf; |
230 r->loc_conf = cscf->ctx->loc_conf; | 233 r->loc_conf = cscf->ctx->loc_conf; |
231 | 234 |
232 #if 1 | 235 #if (NGX_HTTP_SSL) |
233 r->ssl = 1; | 236 |
234 r->filter_need_in_memory = 1; | 237 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_filter_module); |
238 if (sscf->enable) { | |
239 if (ngx_ssl_create_session(sscf->ssl_ctx, c) == NGX_ERROR) { | |
240 ngx_http_close_connection(c); | |
241 return; | |
242 } | |
243 | |
244 r->filter_need_in_memory = 1; | |
245 } | |
246 | |
235 #endif | 247 #endif |
236 | 248 |
237 server_name = cscf->server_names.elts; | 249 server_name = cscf->server_names.elts; |
238 r->server_name = &server_name->name; | 250 r->server_name = &server_name->name; |
239 | 251 |
818 | 830 |
819 if (!rev->ready) { | 831 if (!rev->ready) { |
820 return NGX_AGAIN; | 832 return NGX_AGAIN; |
821 } | 833 } |
822 | 834 |
823 /* STUB */ | 835 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |
824 #if (NGX_OPENSSL) | 836 |
825 if (r->ssl) { | 837 n = cscf->recv(r->connection, r->header_in->last, |
826 n = ngx_http_ssl_read(r, r->header_in->last, | 838 r->header_in->end - r->header_in->last); |
827 r->header_in->end - r->header_in->last); | |
828 } else { | |
829 #endif | |
830 n = ngx_recv(r->connection, r->header_in->last, | |
831 r->header_in->end - r->header_in->last); | |
832 #if (NGX_OPENSSL) | |
833 } | |
834 #endif | |
835 | 839 |
836 if (n == NGX_AGAIN) { | 840 if (n == NGX_AGAIN) { |
837 if (!r->header_timeout_set) { | 841 if (!r->header_timeout_set) { |
838 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | |
839 ngx_add_timer(rev, cscf->client_header_timeout); | 842 ngx_add_timer(rev, cscf->client_header_timeout); |
840 r->header_timeout_set = 1; | 843 r->header_timeout_set = 1; |
841 } | 844 } |
842 | 845 |
843 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) { | 846 if (ngx_handle_read_event(rev, 0) == NGX_ERROR) { |