nginx-0.0.7-2004-07-16-10:33:35 import
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 49e8094..302b924 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1423,7 +1423,7 @@
ngx_connection_t *c;
ngx_http_log_ctx_t *ctx;
- c = (ngx_connection_t *) rev->data;
+ c = rev->data;
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http keepalive handler");
@@ -1725,6 +1725,26 @@
}
+#if (NGX_HTTP_SSL)
+
+void ngx_ssl_close_handler(ngx_event_t *ev)
+{
+ ngx_connection_t *c;
+
+ c = ev->data;
+
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0, "http ssl close handler");
+
+ if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
+ return;
+ }
+
+ ngx_http_close_connection(c);
+}
+
+#endif
+
+
void ngx_http_close_connection(ngx_connection_t *c)
{
ngx_socket_t fd;
@@ -1737,6 +1757,18 @@
return;
}
+#if (NGX_HTTP_SSL)
+
+ if (c->ssl) {
+ if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
+ c->read->event_handler = ngx_ssl_close_handler;
+ c->write->event_handler = ngx_ssl_close_handler;
+ return;
+ }
+ }
+
+#endif
+
if (c->read->timer_set) {
ngx_del_timer(c->read);
}