Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r5154 - in branches/stable-1.2: . src/event

Anonymous User
March 29, 2013 01:18PM
Author: mdounin
Date: 2013-03-29 17:17:45 +0000 (Fri, 29 Mar 2013)
New Revision: 5154
URL: http://trac.nginx.org/nginx/changeset/5154/nginx

Log:
Merge of r5082: SSL: retry "sess_id" and "id" allocations.

SSL: retry "sess_id" and "id" allocations.

In case of fully populated SSL session cache with no memory left for
new allocations, ngx_ssl_new_session() will try to expire the oldest
non-expired session and retry, but only in case when slab allocation
fails for "cached_sess", not when slab allocation fails for either
"sess_id" or "id", which can happen for number of reasons and results
in new session not being cached.

Patch fixes this by adding retry logic to "sess_id" & "id" allocations.

Patch by Piotr Sikora.


Modified:
branches/stable-1.2/
branches/stable-1.2/src/event/ngx_event_openssl.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2 2013-03-29 17:15:34 UTC (rev 5153)
+++ branches/stable-1.2 2013-03-29 17:17:45 UTC (rev 5154)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5005,5011-5025,5027-5031,5066,5070-5071,5078
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5005,5011-5025,5027-5031,5066,5070-5071,5078,5082
\ No newline at end of property
Modified: branches/stable-1.2/src/event/ngx_event_openssl.c
===================================================================
--- branches/stable-1.2/src/event/ngx_event_openssl.c 2013-03-29 17:15:34 UTC (rev 5153)
+++ branches/stable-1.2/src/event/ngx_event_openssl.c 2013-03-29 17:17:45 UTC (rev 5154)
@@ -1716,8 +1716,18 @@
}

sess_id = ngx_slab_alloc_locked(shpool, sizeof(ngx_ssl_sess_id_t));
+
if (sess_id == NULL) {
- goto failed;
+
+ /* drop the oldest non-expired session and try once more */
+
+ ngx_ssl_expire_sessions(cache, shpool, 0);
+
+ sess_id = ngx_slab_alloc_locked(shpool, sizeof(ngx_ssl_sess_id_t));
+
+ if (sess_id == NULL) {
+ goto failed;
+ }
}

#if (NGX_PTR_SIZE == 8)
@@ -1727,8 +1737,18 @@
#else

id = ngx_slab_alloc_locked(shpool, sess->session_id_length);
+
if (id == NULL) {
- goto failed;
+
+ /* drop the oldest non-expired session and try once more */
+
+ ngx_ssl_expire_sessions(cache, shpool, 0);
+
+ id = ngx_slab_alloc_locked(shpool, sess->session_id_length);
+
+ if (id == NULL) {
+ goto failed;
+ }
}

#endif

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r5154 - in branches/stable-1.2: . src/event

Anonymous User 692 March 29, 2013 01:18PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready