aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-07-15 16:35:51 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-07-15 16:35:51 +0000
commit1c3567ecc81a9f07f3c3d53912114bc5bd5daffa (patch)
treeba0b57b32bb1232af3fad0ff38375df9e498ec66 /src/http/ngx_http_request.c
parent4aa888820d3f13a225ee6bdd596305ea3b4db6f4 (diff)
downloadnginx-1c3567ecc81a9f07f3c3d53912114bc5bd5daffa.tar.gz
nginx-1c3567ecc81a9f07f3c3d53912114bc5bd5daffa.zip
nginx-0.0.7-2004-07-15-20:35:51 import
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index d0c92edcc..49e809462 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -141,6 +141,9 @@ static void ngx_http_init_request(ngx_event_t *rev)
ngx_http_server_name_t *server_name;
ngx_http_core_srv_conf_t *cscf;
ngx_http_core_loc_conf_t *clcf;
+#if (NGX_HTTP_SSL)
+ ngx_http_ssl_srv_conf_t *sscf;
+#endif
c = rev->data;
@@ -229,9 +232,18 @@ static void ngx_http_init_request(ngx_event_t *rev)
r->srv_conf = cscf->ctx->srv_conf;
r->loc_conf = cscf->ctx->loc_conf;
-#if 1
- r->ssl = 1;
- r->filter_need_in_memory = 1;
+#if (NGX_HTTP_SSL)
+
+ sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_filter_module);
+ if (sscf->enable) {
+ if (ngx_ssl_create_session(sscf->ssl_ctx, c) == NGX_ERROR) {
+ ngx_http_close_connection(c);
+ return;
+ }
+
+ r->filter_need_in_memory = 1;
+ }
+
#endif
server_name = cscf->server_names.elts;
@@ -820,22 +832,13 @@ static ssize_t ngx_http_read_request_header(ngx_http_request_t *r)
return NGX_AGAIN;
}
-/* STUB */
-#if (NGX_OPENSSL)
- if (r->ssl) {
- n = ngx_http_ssl_read(r, r->header_in->last,
- r->header_in->end - r->header_in->last);
- } else {
-#endif
- n = ngx_recv(r->connection, r->header_in->last,
- r->header_in->end - r->header_in->last);
-#if (NGX_OPENSSL)
- }
-#endif
+ cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
+
+ n = cscf->recv(r->connection, r->header_in->last,
+ r->header_in->end - r->header_in->last);
if (n == NGX_AGAIN) {
if (!r->header_timeout_set) {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
ngx_add_timer(rev, cscf->client_header_timeout);
r->header_timeout_set = 1;
}