[nginx] svn commit: r5025 - trunk/src/event
mdounin at mdounin.ru
mdounin at mdounin.ru
Fri Feb 1 14:37:44 UTC 2013
Author: mdounin
Date: 2013-02-01 14:37:43 +0000 (Fri, 01 Feb 2013)
New Revision: 5025
URL: http://trac.nginx.org/nginx/changeset/5025/nginx
Log:
SSL: fixed ngx_ssl_handshake() with level-triggered event methods.
Missing calls to ngx_handle_write_event() and ngx_handle_read_event()
resulted in a CPU hog during SSL handshake if an level-triggered event
method (e.g. select) was used.
Modified:
trunk/src/event/ngx_event_openssl.c
Modified: trunk/src/event/ngx_event_openssl.c
===================================================================
--- trunk/src/event/ngx_event_openssl.c 2013-01-28 15:41:12 UTC (rev 5024)
+++ trunk/src/event/ngx_event_openssl.c 2013-02-01 14:37:43 UTC (rev 5025)
@@ -808,6 +808,10 @@
return NGX_ERROR;
}
+ if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
return NGX_AGAIN;
}
@@ -816,6 +820,10 @@
c->read->handler = ngx_ssl_handshake_handler;
c->write->handler = ngx_ssl_handshake_handler;
+ if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
return NGX_ERROR;
}
More information about the nginx-devel
mailing list