Skip to content

Commit b8f9bed

Browse files
authored
Merge pull request #332 from embhorn/zd14659
Fix server-threaded to release ECC cache
2 parents 279b2d4 + 81b8155 commit b8f9bed

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tls/server-tls-threaded.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* server-tls-threaded.c
22
*
3-
* Copyright (C) 2006-2020 wolfSSL Inc.
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL. (formerly known as CyaSSL)
66
*
@@ -115,7 +115,7 @@ void* ClientHandler(void* args)
115115
wolfSSL_free(ssl); /* Free the wolfSSL object */
116116
close(pkg->connd); /* Close the connection to the server */
117117
pkg->open = 1; /* Indicate that execution is over */
118-
pthread_exit(NULL); /* End theread execution */
118+
pthread_exit(NULL); /* End thread execution */
119119
}
120120

121121
/* Check for server shutdown command */
@@ -147,7 +147,10 @@ void* ClientHandler(void* args)
147147
wolfSSL_free(ssl); /* Free the wolfSSL object */
148148
close(pkg->connd); /* Close the connection to the server */
149149
pkg->open = 1; /* Indicate that execution is over */
150-
pthread_exit(NULL); /* End theread execution */
150+
#if defined(HAVE_ECC) && defined(FP_ECC)
151+
wc_ecc_fp_free(); /* free per thread cache */
152+
#endif
153+
pthread_exit(NULL); /* End thread execution */
151154
}
152155

153156

@@ -245,7 +248,7 @@ int main()
245248

246249

247250

248-
/* initialise thread array */
251+
/* Initialize thread array */
249252
for (i = 0; i < MAX_CONCURRENT_THREADS; ++i) {
250253
printf("Creating %d thread\n", i);
251254
thread[i].open = 1;
@@ -274,7 +277,7 @@ int main()
274277

275278

276279

277-
/* Fill out the relevent thread argument package information */
280+
/* Fill out the relevant thread argument package information */
278281
thread[i].open = 0;
279282
thread[i].connd = connd;
280283

0 commit comments

Comments
 (0)