Lines Matching refs:cur

65     mbedtls_ssl_cache_entry *cur, *entry;  in mbedtls_ssl_cache_get()  local
72 cur = cache->chain; in mbedtls_ssl_cache_get()
75 while( cur != NULL ) in mbedtls_ssl_cache_get()
77 entry = cur; in mbedtls_ssl_cache_get()
78 cur = cur->next; in mbedtls_ssl_cache_get()
145 mbedtls_ssl_cache_entry *cur, *prv; in mbedtls_ssl_cache_set() local
153 cur = cache->chain; in mbedtls_ssl_cache_set()
156 while( cur != NULL ) in mbedtls_ssl_cache_set()
162 (int) ( t - cur->timestamp ) > cache->timeout ) in mbedtls_ssl_cache_set()
164 cur->timestamp = t; in mbedtls_ssl_cache_set()
169 if( memcmp( session->id, cur->session.id, cur->session.id_len ) == 0 ) in mbedtls_ssl_cache_set()
173 if( oldest == 0 || cur->timestamp < oldest ) in mbedtls_ssl_cache_set()
175 oldest = cur->timestamp; in mbedtls_ssl_cache_set()
176 old = cur; in mbedtls_ssl_cache_set()
180 prv = cur; in mbedtls_ssl_cache_set()
181 cur = cur->next; in mbedtls_ssl_cache_set()
184 if( cur == NULL ) in mbedtls_ssl_cache_set()
198 cur = old; in mbedtls_ssl_cache_set()
213 cur = cache->chain; in mbedtls_ssl_cache_set()
214 cache->chain = cur->next; in mbedtls_ssl_cache_set()
215 cur->next = NULL; in mbedtls_ssl_cache_set()
216 prv->next = cur; in mbedtls_ssl_cache_set()
224 cur = mbedtls_calloc( 1, sizeof(mbedtls_ssl_cache_entry) ); in mbedtls_ssl_cache_set()
225 if( cur == NULL ) in mbedtls_ssl_cache_set()
232 cache->chain = cur; in mbedtls_ssl_cache_set()
234 prv->next = cur; in mbedtls_ssl_cache_set()
238 cur->timestamp = t; in mbedtls_ssl_cache_set()
242 memcpy( &cur->session, session, sizeof( mbedtls_ssl_session ) ); in mbedtls_ssl_cache_set()
248 if( cur->peer_cert.p != NULL ) in mbedtls_ssl_cache_set()
250 mbedtls_free( cur->peer_cert.p ); in mbedtls_ssl_cache_set()
251 memset( &cur->peer_cert, 0, sizeof(mbedtls_x509_buf) ); in mbedtls_ssl_cache_set()
259 cur->peer_cert.p = mbedtls_calloc( 1, session->peer_cert->raw.len ); in mbedtls_ssl_cache_set()
260 if( cur->peer_cert.p == NULL ) in mbedtls_ssl_cache_set()
266 memcpy( cur->peer_cert.p, session->peer_cert->raw.p, in mbedtls_ssl_cache_set()
268 cur->peer_cert.len = session->peer_cert->raw.len; in mbedtls_ssl_cache_set()
270 cur->session.peer_cert = NULL; in mbedtls_ssl_cache_set()
303 mbedtls_ssl_cache_entry *cur, *prv; in mbedtls_ssl_cache_free() local
305 cur = cache->chain; in mbedtls_ssl_cache_free()
307 while( cur != NULL ) in mbedtls_ssl_cache_free()
309 prv = cur; in mbedtls_ssl_cache_free()
310 cur = cur->next; in mbedtls_ssl_cache_free()