From e88467ce621c7cc2a33fce2a452979a84f05f82c Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 26 Feb 2018 16:02:14 +0000 Subject: [PATCH] In ssl.h rev. 1.142 2018/02/22 17:25:18, jsing@ provided SSL_SESSION_up_ref(3). Merge the documentation from OpenSSL, tweaked by me. --- lib/libssl/man/SSL_SESSION_free.3 | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/libssl/man/SSL_SESSION_free.3 b/lib/libssl/man/SSL_SESSION_free.3 index 1a37af2775b..13c03fda438 100644 --- a/lib/libssl/man/SSL_SESSION_free.3 +++ b/lib/libssl/man/SSL_SESSION_free.3 @@ -1,8 +1,10 @@ -.\" $OpenBSD: SSL_SESSION_free.3,v 1.2 2016/12/06 18:53:55 schwarze Exp $ -.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 +.\" $OpenBSD: SSL_SESSION_free.3,v 1.3 2018/02/26 16:02:14 schwarze Exp $ +.\" full merge up to: OpenSSL b31db505 Mar 24 16:01:50 2017 +0000 .\" -.\" This file was written by Lutz Jaenicke . -.\" Copyright (c) 2000, 2001, 2009 The OpenSSL Project. All rights reserved. +.\" This file was written by Lutz Jaenicke +.\" and Matt Caswell . +.\" Copyright (c) 2000, 2001, 2009, 2017 The OpenSSL Project. +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -48,25 +50,31 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 6 2016 $ +.Dd $Mdocdate: February 26 2018 $ .Dt SSL_SESSION_FREE 3 .Os .Sh NAME +.Nm SSL_SESSION_up_ref , .Nm SSL_SESSION_free -.Nd free an allocated SSL_SESSION structure +.Nd SSL_SESSION reference counting .Sh SYNOPSIS .In openssl/ssl.h +.Ft int +.Fn SSL_SESSION_up_ref "SSL_SESSION *session" .Ft void .Fn SSL_SESSION_free "SSL_SESSION *session" .Sh DESCRIPTION -.Fn SSL_SESSION_free -decrements the reference count of +.Fn SSL_SESSION_up_ref +increments the reference count of the given .Fa session -and removes the -.Vt SSL_SESSION -structure pointed to by +by 1. +.Pp +.Fn SSL_SESSION_free +decrements the reference count of the given .Fa session -and frees up the allocated memory, if the reference count has reached 0. +by 1. +If the reference count reaches 0, it frees the memory used by the +.Fa session . If .Fa session is a @@ -120,6 +128,9 @@ It must not be called on other .Vt SSL_SESSION objects, as this would cause incorrect reference counts and therefore program failures. +.Sh RETURN VALUES +.Fn SSL_SESSION_up_ref +returns 1 on success or 0 on error. .Sh SEE ALSO .Xr d2i_SSL_SESSION 3 , .Xr SSL_CTX_flush_sessions 3 , -- 2.20.1